diff --git a/examples/cai/agent_patterns/LLM_as_judge.py b/examples/cai/agent_patterns/LLM_as_judge.py index 81e64f0d..d222fcc9 100644 --- a/examples/cai/agent_patterns/LLM_as_judge.py +++ b/examples/cai/agent_patterns/LLM_as_judge.py @@ -29,7 +29,7 @@ ctf_task_planner = Agent( model= os.getenv('CAI_MODEL', "qwen2.5:14b"), openai_client=AsyncOpenAI(), ), - tools =[] + tools=[] ) @@ -53,6 +53,7 @@ ctf_plan_evaluator = Agent[None]( model= os.getenv('CAI_MODEL', "qwen2.5:14b"), openai_client=AsyncOpenAI(), ), + tools=[], output_type=EvaluationFeedback, ) diff --git a/src/cai/sdk/agents/models/openai_chatcompletions.py b/src/cai/sdk/agents/models/openai_chatcompletions.py index 3ea39a94..a5a354d5 100644 --- a/src/cai/sdk/agents/models/openai_chatcompletions.py +++ b/src/cai/sdk/agents/models/openai_chatcompletions.py @@ -973,6 +973,10 @@ class OpenAIChatCompletionsModel(Model): # Only remove tool_choice if model starts with "gpt" and has no tools if self.model.startswith("gpt") and not converted_tools: kwargs.pop("tool_choice", None) + + # TODO: review this. Remove tool_choice for Anthropic/Claude models when no tools are provided + if ("claude" in str(self.model).lower() or "anthropic" in str(self.model).lower()) and not converted_tools: + kwargs.pop("tool_choice", None) # Model adjustments if any(x in self.model for x in ["claude"]):