新增list_models接口的授权验证逻辑,完善模型格式转换结构

This commit is contained in:
yinpeng
2024-12-15 21:09:11 +08:00
parent 7c8baed1ff
commit 829c1b02ec
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ class ModelService:
def convert_to_openai_models_format(
self, gemini_models: Dict[str, Any]
) -> Dict[str, Any]:
openai_format = {"object": "list", "data": []}
openai_format = {"object": "list", "data": [],"success": True}
for model in gemini_models.get("models", []):
model_id = model["name"].split("/")[-1]
@@ -43,7 +43,7 @@ class ModelService:
"permission": [],
"root": model["name"],
"parent": None,
"success": True,
}
openai_format["data"].append(openai_model)