Skip to content

Commit 0d51b70

Browse files
Merge pull request #70 from mainframecomputer/bugfix/update-context-to-system-prompt
Bugfix/update context to system prompt
2 parents 6a2b862 + b7ffa7b commit 0d51b70

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

packages/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mainframe-orchestra"
3-
version = "0.0.30"
3+
version = "0.0.31"
44
description = "Mainframe-Orchestra is a lightweight, open-source agentic framework for building LLM based pipelines and self-orchestrating multi-agent teams"
55
authors = [
66
"Mainframe Computer Inc. <hi@mainfra.me>",

packages/python/src/mainframe_orchestra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
# Copyright 2024 Mainframe-Orchestra Contributors. Licensed under Apache License 2.0.
55

6-
__version__ = "0.0.30"
6+
__version__ = "0.0.31"
77

88
import importlib
99

packages/python/src/mainframe_orchestra/task.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,20 +312,14 @@ async def _create_async(
312312
f"You are {role or (agent.role if agent else None)}. "
313313
f"Your goal is {goal or (agent.goal if agent else None)}"
314314
f"{' Your attributes are: ' + (attributes or (agent.attributes if agent else '')) if attributes or (agent.attributes if agent else '') else ''}"
315+
f"{'\nAdditional context: ' + (context or '') if context else ''}"
315316
).strip(),
316317
}
317318
messages.insert(0, system_message)
318319

319-
# Combine context and instruction
320-
user_content = []
321-
if context:
322-
user_content.append(context)
323-
user_content.append(instruction)
324-
user_message_content = "\n\n".join(user_content)
325-
326320
# Only append if different from last message
327-
if not messages or messages[-1].get("content") != user_message_content:
328-
messages.append({"role": "user", "content": user_message_content})
321+
if not messages or messages[-1].get("content") != instruction:
322+
messages.append({"role": "user", "content": instruction})
329323

330324
task_data = {
331325
"agent_id": agent.agent_id if agent else None,
@@ -615,8 +609,6 @@ def hash_tool_call(tool_call: dict) -> str:
615609

616610
# Include tool results in context if we have any
617611
context_parts = []
618-
if self.context:
619-
context_parts.append(self.context)
620612
context_parts.append(tool_descriptions)
621613

622614
if tool_results: # Using existing tool_results list

0 commit comments

Comments
 (0)