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
7f8be4a7
Commit
7f8be4a7
authored
May 29, 2024
by
Timothy J. Baek
Browse files
refac
parent
5cf44ac7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
22 deletions
+19
-22
backend/main.py
backend/main.py
+19
-22
No files found.
backend/main.py
View file @
7f8be4a7
...
@@ -484,7 +484,6 @@ async def get_pipeline_valves(pipeline_id: str, user=Depends(get_admin_user)):
...
@@ -484,7 +484,6 @@ async def get_pipeline_valves(pipeline_id: str, user=Depends(get_admin_user)):
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
if
key
!=
""
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
r
=
requests
.
get
(
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves"
,
headers
=
headers
)
r
=
requests
.
get
(
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves"
,
headers
=
headers
)
...
@@ -533,7 +532,6 @@ async def get_pipeline_valves_spec(pipeline_id: str, user=Depends(get_admin_user
...
@@ -533,7 +532,6 @@ async def get_pipeline_valves_spec(pipeline_id: str, user=Depends(get_admin_user
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
if
key
!=
""
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
r
=
requests
.
get
(
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves/spec"
,
headers
=
headers
)
r
=
requests
.
get
(
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves/spec"
,
headers
=
headers
)
...
@@ -583,7 +581,6 @@ async def update_pipeline_valves(
...
@@ -583,7 +581,6 @@ async def update_pipeline_valves(
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
url
=
openai_app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
key
=
openai_app
.
state
.
config
.
OPENAI_API_KEYS
[
urlIdx
]
if
key
!=
""
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
r
=
requests
.
post
(
r
=
requests
.
post
(
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves/update"
,
f
"
{
url
}
/
{
pipeline
[
'id'
]
}
/valves/update"
,
...
...
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