Fix model list for GitHub Models via its catalog endpoint
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bdd7a9f7bf
commit
5721a0a36f
2 files changed
+13
-2
No files matched your search
@@ -77,6 +77,17 @@ def get_client() -> OpenAI:
|
||||
return _client
|
||||
|
||||
|
||||
GITHUB_CATALOG_URL = "https://models.github.ai/catalog/models"
|
||||
|
||||
|
||||
def list_model_ids() -> list[str]:
|
||||
"""Modèles accessibles avec la clé en place (GitHub Models : catalogue dédié, /models n'est pas OpenAI-compatible)."""
|
||||
client = get_client()
|
||||
if "models.github.ai" in str(client.base_url):
|
||||
return sorted(m["id"] for m in client.get(GITHUB_CATALOG_URL, cast_to=object))
|
||||
return sorted(m.id for m in client.models.list().data)
|
||||
|
||||
|
||||
def filter_idea(content: str) -> dict:
|
||||
"""
|
||||
Filtre une idée selon le cadre légal international des droits humains
|
||||
|
||||
Reference in new issue
Block a user