forked from open-webui/open-webui
enhancement: OpenAI API
api.together.xyz, api.replicate.com
This commit is contained in:
parent
7bc17da534
commit
9832e6edba
1 changed files with 5 additions and 2 deletions
|
@ -171,6 +171,7 @@ async def fetch_url(url, key):
|
||||||
|
|
||||||
|
|
||||||
def merge_models_lists(model_lists):
|
def merge_models_lists(model_lists):
|
||||||
|
log.info(f"merge_models_lists {model_lists}")
|
||||||
merged_list = []
|
merged_list = []
|
||||||
|
|
||||||
for idx, models in enumerate(model_lists):
|
for idx, models in enumerate(model_lists):
|
||||||
|
@ -199,14 +200,16 @@ async def get_all_models():
|
||||||
]
|
]
|
||||||
|
|
||||||
responses = await asyncio.gather(*tasks)
|
responses = await asyncio.gather(*tasks)
|
||||||
|
log.info(f"get_all_models:responses() {responses}")
|
||||||
|
|
||||||
models = {
|
models = {
|
||||||
"data": merge_models_lists(
|
"data": merge_models_lists(
|
||||||
list(
|
list(
|
||||||
map(
|
map(
|
||||||
lambda response: (
|
lambda response: (
|
||||||
response["data"]
|
response["data"]
|
||||||
if response and "data" in response
|
if (response and "data" in response)
|
||||||
else None
|
else (response if isinstance(response, list) else None)
|
||||||
),
|
),
|
||||||
responses,
|
responses,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue