LLM AS A JUDGE - works for anthropic

This commit is contained in:
lidia9 2025-04-30 16:00:50 +02:00
parent 27a09c576e
commit f6cc6e1283
2 changed files with 6 additions and 1 deletions

View File

@ -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,
)

View File

@ -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"]):