feat: fix model listing for openai (#1372)

This commit is contained in:
Sarah Wooders 2025-03-24 16:38:32 -07:00 committed by GitHub
parent e1ec91baff
commit de16a17f65
3 changed files with 575 additions and 61 deletions

View File

@ -157,6 +157,23 @@ class OpenAIProvider(Provider):
# if "config" in data and "chat_template" in data["config"] and "tools" not in data["config"]["chat_template"]:
# continue
# for openai, filter models
if self.base_url == "https://api.openai.com/v1":
allowed_types = ["gpt-4", "o1", "o3"]
disallowed_types = ["transcribe", "search", "realtime", "tts", "audio", "computer"]
skip = True
for model_type in allowed_types:
if model_name.startswith(model_type):
skip = False
break
for keyword in disallowed_types:
if keyword in model_name:
skip = True
break
# ignore this model
if skip:
continue
configs.append(
LLMConfig(
model=model_name,

615
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -56,8 +56,8 @@ nltk = "^3.8.1"
jinja2 = "^3.1.5"
locust = {version = "^2.31.5", optional = true}
wikipedia = {version = "^1.4.0", optional = true}
composio-langchain = "^0.7.7"
composio-core = "^0.7.7"
composio-langchain = "^0.7.10"
composio-core = "^0.7.10"
alembic = "^1.13.3"
pyhumps = "^3.8.0"
psycopg2 = {version = "^2.9.10", optional = true}