@@ -67,7 +67,7 @@ async def _prepare_tools(self) -> list[ChatCompletionFunctionToolParam]:
6767 tools -= {
6868 WebSearchTool ,
6969 }
70- return [pydantic_function_tool (tool , name = tool .tool_name , description = "" ) for tool in tools ]
70+ return [pydantic_function_tool (tool , name = tool .tool_name ) for tool in tools ]
7171
7272 async def _reasoning_phase (self ) -> ReasoningTool :
7373 async with self .openai_client .chat .completions .stream (
@@ -119,17 +119,6 @@ async def _select_action_phase(self, reasoning: ReasoningTool) -> BaseTool:
119119 async for event in stream :
120120 if event .type == "chunk" :
121121 self .streaming_generator .add_chunk (event .chunk )
122- completion = await stream .get_final_completion ()
123- try :
124- tool = completion .choices [0 ].message .tool_calls [0 ].function .parsed_arguments
125- except (IndexError , AttributeError , TypeError ):
126- # LLM returned a text response instead of a tool call - treat as completion
127- final_content = completion .choices [0 ].message .content or "Task completed successfully"
128- tool = AgentCompletionTool (
129- reasoning = "Agent decided to complete the task" ,
130- completed_steps = [final_content ],
131- status = AgentStatesEnum .COMPLETED ,
132- )
133122
134123 completion = await stream .get_final_completion ()
135124
0 commit comments