Skip to content

Commit

Permalink
fix: missing field in api response causing backend failure (#99)
Browse files Browse the repository at this point in the history
One line update to avoid missing field in api response causing backend failing to start.
  • Loading branch information
ryuzio committed May 9, 2024
1 parent 508a16b commit ee939e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/model_deployments/cohere_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def list_models(cls) -> List[str]:
return []

models = response.json()["models"]
return [model["name"] for model in models if "chat" in model["endpoints"]]
return [
model["name"]
for model in models
if model.get("endpoints") and "chat" in model["endpoints"]
]

@classmethod
def is_available(cls) -> bool:
Expand Down

0 comments on commit ee939e1

Please sign in to comment.