diff --git a/src/rai_bench/rai_bench/utils.py b/src/rai_bench/rai_bench/utils.py index 6e6943b1e..e43503171 100644 --- a/src/rai_bench/rai_bench/utils.py +++ b/src/rai_bench/rai_bench/utils.py @@ -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", diff --git a/src/rai_core/pyproject.toml b/src/rai_core/pyproject.toml index c7567590d..7e11aca83 100644 --- a/src/rai_core/pyproject.toml +++ b/src/rai_core/pyproject.toml @@ -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 ", "Bartłomiej Boczek ", "Kajetan Rachwał "] readme = "README.md" diff --git a/src/rai_core/rai/agents/langchain/core/megamind.py b/src/rai_core/rai/agents/langchain/core/megamind.py index f1b9d6af1..860820d6a 100644 --- a/src/rai_core/rai/agents/langchain/core/megamind.py +++ b/src/rai_core/rai/agents/langchain/core/megamind.py @@ -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): @@ -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 @@ -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." @@ -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"