diff --git a/letta/llm_api/openai_client.py b/letta/llm_api/openai_client.py index dc6804d1..61089bbf 100644 --- a/letta/llm_api/openai_client.py +++ b/letta/llm_api/openai_client.py @@ -93,6 +93,8 @@ def requires_auto_tool_choice(llm_config: LLMConfig) -> bool: if "nebius.com" in llm_config.model_endpoint: return True + if "together.ai" in llm_config.model_endpoint or "together.xyz" in llm_config.model_endpoint: + return True # proxy also has this issue (FIXME check) elif llm_config.model_endpoint == LETTA_MODEL_ENDPOINT: return True diff --git a/letta/schemas/providers.py b/letta/schemas/providers.py index 822b291a..b55d9267 100644 --- a/letta/schemas/providers.py +++ b/letta/schemas/providers.py @@ -222,17 +222,6 @@ class OpenAIProvider(Provider): # } if "config" not in model: continue - if "chat_template" not in model["config"]: - continue - if model["config"]["chat_template"] is None: - continue - if model["config"]["chat_template"] is not None and "tools" not in model["config"]["chat_template"]: - # NOTE: this is a hack to filter out models that don't support tool calling - continue - if "tools" not in model["config"]["chat_template"]: - continue - # if "config" in data and "chat_template" in data["config"] and "tools" not in data["config"]["chat_template"]: - # continue if "nebius.com" in self.base_url: # Nebius includes the type, which we can use to filter for text models