diff --git a/src/dialog/routers/openai.py b/src/dialog/routers/openai.py index a90c9d4..0972e86 100644 --- a/src/dialog/routers/openai.py +++ b/src/dialog/routers/openai.py @@ -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():