Skip to content

Commit

Permalink
Fixes API response for OpenWebUI
Browse files Browse the repository at this point in the history
  • Loading branch information
vmesel committed Oct 30, 2024
1 parent c24e6d5 commit 1fba27b
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/dialog/routers/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,23 @@ async def get_models():
Returns the model that is available inside Dialog in the OpenAI format.
"""

return {
"models": [
OpenAIModel(**{
"id": "talkd-ai",
"object": "model",
"created": int(datetime.datetime.now().timestamp()),
"owned_by": "system",
"digest": str(uuid4())
})
] + [
OpenAIModel(**{
"id": model["model_name"],
"object": "model",
"created": int(datetime.datetime.now().timestamp()),
"owned_by": "system",
"digest": str(uuid4())
}) for model in Settings().PROJECT_CONFIG.get("endpoint", [])
]
}
return [
OpenAIModel(**{
"id": "talkd-ai",
"object": "model",
"created": int(datetime.datetime.now().timestamp()),
"owned_by": "system",
"digest": str(uuid4())
})
] + [
OpenAIModel(**{
"id": model["model_name"],
"object": "model",
"created": int(datetime.datetime.now().timestamp()),
"owned_by": "system",
"digest": str(uuid4())
}) for model in Settings().PROJECT_CONFIG.get("endpoint", [])
]

@open_ai_api_router.get("/api/tags")
async def get_tags():
Expand Down

0 comments on commit 1fba27b

Please sign in to comment.