mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: unified /models endpoint
This commit is contained in:
@@ -242,8 +242,6 @@ async def get_models(user=Depends(get_current_user)):
|
||||
)
|
||||
)
|
||||
|
||||
for model in data["data"]:
|
||||
add_custom_info_to_model(model)
|
||||
return data
|
||||
except Exception as e:
|
||||
|
||||
@@ -284,12 +282,6 @@ async def get_models(user=Depends(get_current_user)):
|
||||
}
|
||||
|
||||
|
||||
def add_custom_info_to_model(model: dict):
|
||||
model["custom_info"] = next(
|
||||
(item for item in app.state.MODEL_CONFIG if item.id == model["id"]), None
|
||||
)
|
||||
|
||||
|
||||
@app.get("/model/info")
|
||||
async def get_model_list(user=Depends(get_admin_user)):
|
||||
return {"data": app.state.CONFIG["model_list"]}
|
||||
|
||||
Reference in New Issue
Block a user