diff --git a/cheddahbot/agent.py b/cheddahbot/agent.py index 4bbd86f..76d2c4e 100644 --- a/cheddahbot/agent.py +++ b/cheddahbot/agent.py @@ -16,7 +16,7 @@ from .router import build_system_prompt, format_messages_for_llm log = logging.getLogger(__name__) -MAX_TOOL_ITERATIONS = 5 +MAX_TOOL_ITERATIONS = 15 _IMAGE_MIME = { ".png": "image/png", @@ -250,9 +250,17 @@ class Agent: ) for i, tc in enumerate(unique_tool_calls): - yield f"\n\n*Calling {tc['name']}...*\n" + args = tc.get("input", {}) + # Build a brief summary of the args for the user + arg_summary = ", ".join( + f"{k}={repr(v)[:60]}" for k, v in args.items() + ) + if arg_summary: + yield f"\n\n*Calling {tc['name']}({arg_summary})...*\n" + else: + yield f"\n\n*Calling {tc['name']}...*\n" try: - result = self._tools.execute(tc["name"], tc.get("input", {})) + result = self._tools.execute(tc["name"], args) except Exception as e: result = f"Tool error: {e}" log.info("Tool %s result: %s", tc["name"], result[:500])