mirror of
https://github.com/usestrix/strix.git
synced 2026-10-13 03:57:59 +00:00
fix(models): keep LiteLLM chat-completions tool schema when STRIX_API_TYPE=responses
This commit is contained in:
parent
7968ab44c6
commit
80c7f6cd60
2 changed files with 4 additions and 4 deletions
|
|
@ -808,13 +808,11 @@ def uses_chat_completions_tool_schema(model_name: str, settings: Settings) -> bo
|
|||
"""Return whether the resolved SDK route can only receive JSON function tools."""
|
||||
if codex.subscription_model(model_name):
|
||||
return False
|
||||
if settings.llm.api_type == "chat_completions":
|
||||
return True
|
||||
if settings.llm.api_type == "responses":
|
||||
return False
|
||||
model = model_name.strip().lower()
|
||||
if "/" in model and not model.startswith("openai/"):
|
||||
return True
|
||||
if settings.llm.api_type is not None:
|
||||
return settings.llm.api_type == "chat_completions"
|
||||
if settings.llm.api_base:
|
||||
return True
|
||||
return not model_supports_reasoning(model_name)
|
||||
|
|
|
|||
|
|
@ -184,6 +184,8 @@ def test_api_type_override_settings(monkeypatch: pytest.MonkeyPatch) -> None:
|
|||
monkeypatch.setenv("STRIX_LLM", "openai/gpt-4")
|
||||
monkeypatch.setenv("STRIX_API_TYPE", "responses")
|
||||
assert uses_chat_completions_tool_schema("openai/gpt-4", Settings()) is False
|
||||
monkeypatch.setenv("STRIX_LLM", "anthropic/claude-sonnet-4-5")
|
||||
assert uses_chat_completions_tool_schema("anthropic/claude-sonnet-4-5", Settings()) is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue