Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
9832e6ed
Commit
9832e6ed
authored
Apr 28, 2024
by
Timothy J. Baek
Browse files
enhancement: OpenAI API
api.together.xyz, api.replicate.com
parent
7bc17da5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
backend/apps/openai/main.py
backend/apps/openai/main.py
+5
-2
No files found.
backend/apps/openai/main.py
View file @
9832e6ed
...
...
@@ -171,6 +171,7 @@ async def fetch_url(url, key):
def
merge_models_lists
(
model_lists
):
log
.
info
(
f
"merge_models_lists
{
model_lists
}
"
)
merged_list
=
[]
for
idx
,
models
in
enumerate
(
model_lists
):
...
...
@@ -199,14 +200,16 @@ async def get_all_models():
]
responses
=
await
asyncio
.
gather
(
*
tasks
)
log
.
info
(
f
"get_all_models:responses()
{
responses
}
"
)
models
=
{
"data"
:
merge_models_lists
(
list
(
map
(
lambda
response
:
(
response
[
"data"
]
if
response
and
"data"
in
response
else
None
if
(
response
and
"data"
in
response
)
else
(
response
if
isinstance
(
response
,
list
)
else
None
)
),
responses
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment