Skip to content

Commit 9901e3d

Browse files
authored
Merge pull request #510 from lmtr0/main
Support for more openai models
2 parents 7f9f957 + 72768c2 commit 9901e3d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/pipelines/providers/openai_manifold_pipeline.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,21 @@ def get_openai_models(self):
5959
f"{self.valves.OPENAI_API_BASE_URL}/models", headers=headers
6060
)
6161

62+
allowed_models = [
63+
"gpt",
64+
"o1",
65+
"o3",
66+
"o4",
67+
]
68+
6269
models = r.json()
6370
return [
6471
{
6572
"id": model["id"],
6673
"name": model["name"] if "name" in model else model["id"],
6774
}
6875
for model in models["data"]
69-
if "gpt" in model["id"] or "o1" in model["id"] or "o3" in model["id"]
76+
if any(substring in model["id"] for substring in allowed_models)
7077
]
7178

7279
except Exception as e:

0 commit comments

Comments
 (0)