fix(anthropic): handle tool_choice type 'none' in messages API

This commit is contained in:
BillionClaw 2026-03-24 07:37:17 +08:00
parent 63425b4cb4
commit 3c591f0379

View file

@ -776,6 +776,8 @@ class LiteLLMAnthropicMessagesAdapter:
return ChatCompletionToolChoiceObjectParam(
type="function", function=tc_function_param
)
elif tool_choice["type"] == "none":
return "none"
else:
raise ValueError(
"Incompatible tool choice param submitted - {}".format(tool_choice)