mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(anthropic): add regression test for tool_choice type 'none'
This commit is contained in:
parent
3c591f0379
commit
b3e5dd377e
1 changed files with 13 additions and 0 deletions
|
|
@ -2111,3 +2111,16 @@ class TestTranslateAnthropicOutputFormatToOpenAI:
|
|||
assert self.adapter.translate_anthropic_output_format_to_openai("invalid") is None
|
||||
assert self.adapter.translate_anthropic_output_format_to_openai({"type": "text"}) is None
|
||||
assert self.adapter.translate_anthropic_output_format_to_openai({"type": "json_schema"}) is None
|
||||
|
||||
|
||||
def test_translate_anthropic_tool_choice_none():
|
||||
"""
|
||||
Regression test for issue #24443.
|
||||
|
||||
tool_choice={"type": "none"} should be translated to "none" for OpenAI format,
|
||||
not raise a ValueError.
|
||||
"""
|
||||
adapter = LiteLLMAnthropicMessagesAdapter()
|
||||
|
||||
result = adapter.translate_anthropic_tool_choice_to_openai({"type": "none"})
|
||||
assert result == "none"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue