mirror of
https://github.com/open-webui/open-webui
synced 2025-06-23 02:16:52 +00:00
refac
This commit is contained in:
parent
22b88f9593
commit
1e36282708
@ -399,6 +399,7 @@ async def get_all_models(request: Request, user: UserModel) -> dict[str, list]:
|
|||||||
|
|
||||||
for idx, models in enumerate(model_lists):
|
for idx, models in enumerate(model_lists):
|
||||||
if models is not None and "error" not in models:
|
if models is not None and "error" not in models:
|
||||||
|
|
||||||
merged_list.extend(
|
merged_list.extend(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -409,18 +410,21 @@ async def get_all_models(request: Request, user: UserModel) -> dict[str, list]:
|
|||||||
"urlIdx": idx,
|
"urlIdx": idx,
|
||||||
}
|
}
|
||||||
for model in models
|
for model in models
|
||||||
if "api.openai.com"
|
if (model.get("id") or model.get("name"))
|
||||||
not in request.app.state.config.OPENAI_API_BASE_URLS[idx]
|
and (
|
||||||
or not any(
|
"api.openai.com"
|
||||||
name in model["id"]
|
not in request.app.state.config.OPENAI_API_BASE_URLS[idx]
|
||||||
for name in [
|
or not any(
|
||||||
"babbage",
|
name in model["id"]
|
||||||
"dall-e",
|
for name in [
|
||||||
"davinci",
|
"babbage",
|
||||||
"embedding",
|
"dall-e",
|
||||||
"tts",
|
"davinci",
|
||||||
"whisper",
|
"embedding",
|
||||||
]
|
"tts",
|
||||||
|
"whisper",
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -342,6 +342,28 @@
|
|||||||
{$i18n.t('All')}
|
{$i18n.t('All')}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="min-w-fit outline-none p-1.5 {selectedTag === ''
|
||||||
|
? ''
|
||||||
|
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
|
||||||
|
on:click={() => {
|
||||||
|
selectedTag = '';
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{$i18n.t('Ollama')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="min-w-fit outline-none p-1.5 {selectedTag === ''
|
||||||
|
? ''
|
||||||
|
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
|
||||||
|
on:click={() => {
|
||||||
|
selectedTag = '';
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{$i18n.t('OpenAI')}
|
||||||
|
</button>
|
||||||
|
|
||||||
{#each tags as tag}
|
{#each tags as tag}
|
||||||
<button
|
<button
|
||||||
class="min-w-fit outline-none p-1.5 {selectedTag === tag
|
class="min-w-fit outline-none p-1.5 {selectedTag === tag
|
||||||
|
Loading…
Reference in New Issue
Block a user