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
df49e4e1
Commit
df49e4e1
authored
Mar 06, 2024
by
Timothy J. Baek
Browse files
fix: default openai api value
parent
35918cef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
.dockerignore
.dockerignore
+0
-1
backend/apps/openai/main.py
backend/apps/openai/main.py
+1
-2
backend/config.py
backend/config.py
+3
-0
No files found.
.dockerignore
View file @
df49e4e1
...
@@ -7,7 +7,6 @@ node_modules
...
@@ -7,7 +7,6 @@ node_modules
/package
/package
.env
.env
.env.*
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
vite.config.ts.timestamp-*
__pycache__
__pycache__
...
...
backend/apps/openai/main.py
View file @
df49e4e1
...
@@ -175,8 +175,7 @@ async def get_all_models():
...
@@ -175,8 +175,7 @@ async def get_all_models():
for
idx
,
url
in
enumerate
(
app
.
state
.
OPENAI_API_BASE_URLS
)
for
idx
,
url
in
enumerate
(
app
.
state
.
OPENAI_API_BASE_URLS
)
]
]
responses
=
await
asyncio
.
gather
(
*
tasks
)
responses
=
await
asyncio
.
gather
(
*
tasks
)
responses
=
list
(
filter
(
lambda
x
:
x
is
not
None
,
responses
))
responses
=
list
(
filter
(
lambda
x
:
x
is
not
None
and
"error"
not
in
x
,
responses
))
models
=
{
models
=
{
"data"
:
merge_models_lists
(
"data"
:
merge_models_lists
(
list
(
map
(
lambda
response
:
response
[
"data"
],
responses
))
list
(
map
(
lambda
response
:
response
[
"data"
],
responses
))
...
...
backend/config.py
View file @
df49e4e1
...
@@ -234,6 +234,9 @@ OLLAMA_BASE_URLS = [url.strip() for url in OLLAMA_BASE_URLS.split(";")]
...
@@ -234,6 +234,9 @@ OLLAMA_BASE_URLS = [url.strip() for url in OLLAMA_BASE_URLS.split(";")]
OPENAI_API_KEY
=
os
.
environ
.
get
(
"OPENAI_API_KEY"
,
""
)
OPENAI_API_KEY
=
os
.
environ
.
get
(
"OPENAI_API_KEY"
,
""
)
OPENAI_API_BASE_URL
=
os
.
environ
.
get
(
"OPENAI_API_BASE_URL"
,
""
)
OPENAI_API_BASE_URL
=
os
.
environ
.
get
(
"OPENAI_API_BASE_URL"
,
""
)
if
OPENAI_API_KEY
==
""
:
OPENAI_API_KEY
=
"none"
if
OPENAI_API_BASE_URL
==
""
:
if
OPENAI_API_BASE_URL
==
""
:
OPENAI_API_BASE_URL
=
"https://api.openai.com/v1"
OPENAI_API_BASE_URL
=
"https://api.openai.com/v1"
...
...
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