Implement test for LlmSettings API type

Add test for API type override settings in LlmSettings.
This commit is contained in:
RAJVARDHAN 2026-09-15 19:24:16 +05:30 • committed by GitHub
parent 9585cea6d0
commit bb15b95cf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,3 +168,12 @@ def test_routes_through_litellm_matches_the_provider(
while isinstance(model, _NonStreamingModel | _TurnGuardModel):
model = model._inner
assert isinstance(model, LitellmModel) is litellm
def test_api_type_override_settings() -> None:
from strix.config.settings import LlmSettings, Settings
from strix.config.models import uses_chat_completions_tool_schema
settings_chat = Settings(llm=LlmSettings(api_type="chat_completions", model="gpt-4"))
assert uses_chat_completions_tool_schema("gpt-4", settings_chat) is True
settings_resp = Settings(llm=LlmSettings(api_type="responses", model="openai/gpt-4"))
assert uses_chat_completions_tool_schema("openai/gpt-4", settings_resp) is False