From 1d66c57a658d0a538c1836c56252aae2db11546d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A2=A7=E8=88=9E=E3=81=99=E3=81=BF=E3=81=BB?= Date: Sat, 18 May 2024 01:43:17 +0900 Subject: Improve compatibility of openai-node (#1966) * improve compatibility of openai-node * improve compatibility with OpenAI's models api * allow image upload --- g4f/api/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'g4f/api/__init__.py') diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py index 9772f8d7..7296a542 100644 --- a/g4f/api/__init__.py +++ b/g4f/api/__init__.py @@ -120,7 +120,10 @@ class Api: 'created': 0, 'owned_by': model.base_provider } for model_id, model in model_list.items()] - return JSONResponse(model_list) + return JSONResponse({ + "object": "list", + "data": model_list, + }) @self.app.get("/v1/models/{model_name}") async def model_info(model_name: str): -- cgit v1.2.3