Commit 7f8be4a7 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent 5cf44ac7
...@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment