Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rai_bench/rai_bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse_tool_calling_benchmark_args():
type=int,
nargs="+",
help="Number of extra tools calls agent can make and still pass the task",
default=0,
default=[0],
)
parser.add_argument(
"--complexities",
Expand Down
2 changes: 1 addition & 1 deletion src/rai_core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "rai_core"
version = "2.5.1"
version = "2.5.2"
description = "Core functionality for RAI framework"
authors = ["Maciej Majek <maciej.majek@robotec.ai>", "Bartłomiej Boczek <bartlomiej.boczek@robotec.ai>", "Kajetan Rachwał <kajetan.rachwal@robotec.ai>"]
readme = "README.md"
Expand Down
15 changes: 9 additions & 6 deletions src/rai_core/rai/agents/langchain/core/megamind.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class StepSuccess(BaseModel):
"""Output of success attacher"""

success: bool = Field(description="Whether the task was completed successfully")
explanation: str = Field(description="Explanation of what happened")
explanation: str = Field(description="Summarize briefly what happened")


class MegamindState(MessagesState):
Expand Down Expand Up @@ -102,7 +102,9 @@ def analyzer_node(
state["step_success"] = StepSuccess(
success=analysis.success, explanation=analysis.explanation
)
state["steps_done"].append(f"{state['step_success'].explanation}")
state["steps_done"].append(
f"objective: {state['step']}, success: {state['step_success'].success}, explanation: {state['step_success'].explanation}"
)
return state


Expand Down Expand Up @@ -158,7 +160,7 @@ def create_react_structured_agent(
return graph.compile()


def create_handoff_tool(agent_name: str, description: str = None):
def create_handoff_tool(agent_name: str, description: Optional[str] = None):
"""Create a handoff tool for transferring tasks to specialist agents."""
name = f"transfer_to_{agent_name}"
description = description or f" {agent_name} for help."
Expand Down Expand Up @@ -221,9 +223,10 @@ def plan_step(
state["step"] = None

megamind_prompt = f"You are given objective to complete: {state['original_task']}"
for provider in context_providers:
megamind_prompt += provider.get_context()
megamind_prompt += "\n"
if context_providers:
for provider in context_providers:
megamind_prompt += provider.get_context()
megamind_prompt += "\n"
if state["steps_done"]:
megamind_prompt += "\n\n"
megamind_prompt += "Steps that were already done successfully:\n"
Expand Down