Unverified Commit d5e2a374 authored by Muqi Li's avatar Muqi Li Committed by GitHub
Browse files

Benchmark: Support API_KEY without 'bearer' (#10380)

parent 366043db
...@@ -105,10 +105,13 @@ def remove_suffix(text: str, suffix: str) -> str: ...@@ -105,10 +105,13 @@ def remove_suffix(text: str, suffix: str) -> str:
def get_auth_headers() -> Dict[str, str]: def get_auth_headers() -> Dict[str, str]:
api_key = os.environ.get("OPENAI_API_KEY") openai_api_key = os.environ.get("OPENAI_API_KEY")
if api_key: if openai_api_key:
return {"Authorization": f"Bearer {api_key}"} return {"Authorization": f"Bearer {openai_api_key}"}
else: else:
api_key = os.environ.get("API_KEY")
if api_key:
return {"Authorization": f"{api_key}"}
return {} return {}
......
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