refac
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user