fix: use auto function calling for together models (#2097)

This commit is contained in:
Kevin Lin
2025-05-09 17:46:35 -07:00
committed by GitHub
parent bf1874dbc9
commit 6a33859224
2 changed files with 2 additions and 11 deletions

View File

@@ -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

View File

@@ -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