Building AI agents, atomically
Fix the tool interface agent
KennyVaneetvelde732d7b79aeec
diff --git a/atomic_agents/agents/tool_interface_agent.py b/atomic_agents/agents/tool_interface_agent.pyindex ecf2389..b44907d 100644--- a/atomic_agents/agents/tool_interface_agent.py+++ b/atomic_agents/agents/tool_interface_agent.py@@ -101,7 +101,7 @@ class ToolInterfaceAgent(BaseAgent):))- def _get_and_handle_response(self):+ def get_response(self, response_model=None):"""Handles obtaining and processing the response from the tool.@@ -112,7 +112,7 @@ class ToolInterfaceAgent(BaseAgent):Returns:BaseModel: The processed response or raw tool output."""- tool_input = self.get_response(response_model=self.tool_instance.input_schema)+ tool_input = super().get_response(response_model=self.tool_instance.input_schema)formatted_tool_input = format_tool_message(tool_input)self.memory.add_message("assistant", "TOOL CALL: " + json.dumps(formatted_tool_input))@@ -126,5 +126,5 @@ class ToolInterfaceAgent(BaseAgent):"assistant","I will now formulate a response for the user based on the tool output.",)- response = self.get_response(response_model=self.output_schema)+ response = super().get_response(response_model=self.output_schema)return responsediff --git a/examples/simple_web_search_agent.py b/examples/simple_web_search_agent.pyindex 47d5969..722c520 100644--- a/examples/simple_web_search_agent.py+++ b/examples/simple_web_search_agent.py@@ -29,11 +29,7 @@ def initialize_agent(client, searx_tool):def main():console = Console()- client = instructor.from_openai(- openai.OpenAI(- base_url='http://localhost:1234/v1'- )- )+ client = instructor.from_openai(openai.OpenAI())searx_tool = initialize_searx_tool()agent = initialize_agent(client, searx_tool)@@ -46,7 +42,7 @@ def main():break# Fix this- response = agent.run(agent.input_schema(tool_input=user_input))+ response = agent.run(agent.input_schema(tool_input_SearxNGSearchTool=user_input))console.print(f'Agent: {response.chat_message}')if __name__ == "__main__":