mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 22:05:19 +00:00
refac
This commit is contained in:
parent
5cf44ac7da
commit
7f8be4a709
1 changed files with 19 additions and 22 deletions
|
|
@ -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
|
||||||
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(
|
||||||
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",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue