mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-17 14:55:23 +00:00
refac
This commit is contained in:
parent
424062d75f
commit
b31d314638
1 changed files with 6 additions and 2 deletions
|
|
@ -910,8 +910,6 @@ async def get_all_models():
|
||||||
openai_models = []
|
openai_models = []
|
||||||
ollama_models = []
|
ollama_models = []
|
||||||
|
|
||||||
open_webui_models = await get_open_webui_models()
|
|
||||||
|
|
||||||
if app.state.config.ENABLE_OPENAI_API:
|
if app.state.config.ENABLE_OPENAI_API:
|
||||||
openai_models = await get_openai_models()
|
openai_models = await get_openai_models()
|
||||||
openai_models = openai_models["data"]
|
openai_models = openai_models["data"]
|
||||||
|
|
@ -930,8 +928,14 @@ async def get_all_models():
|
||||||
for model in ollama_models["models"]
|
for model in ollama_models["models"]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
open_webui_models = await get_open_webui_models()
|
||||||
|
|
||||||
models = open_webui_models + openai_models + ollama_models
|
models = open_webui_models + openai_models + ollama_models
|
||||||
|
|
||||||
|
# If there are no models, return an empty list
|
||||||
|
if len([model for model in models if model["owned_by"] != "arena"]) == 0:
|
||||||
|
return []
|
||||||
|
|
||||||
global_action_ids = [
|
global_action_ids = [
|
||||||
function.id for function in Functions.get_global_action_functions()
|
function.id for function in Functions.get_global_action_functions()
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue