Skip to content

Commit 095de8e

Browse files
committed
Update mock_server.py
1 parent 93be3ab commit 095de8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/mock_server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ class DeepSeekProxy:
118118
def __init__(self, api_key: str, extra_headers: Optional[Dict[str, str]] = None):
119119
# We instantiate a new client per request to ensure isolation of user credentials
120120
logger.debug("Initializing DeepSeekProxy client with headers: %s", extra_headers)
121+
if extra_headers is None:
122+
extra_headers = {}
123+
if "x-api-key" in extra_headers and extra_headers["x-api-key"]:
124+
api_key = extra_headers["x-api-key"]
125+
121126
kv = {"api_key": api_key} if api_key != DUMMY_KEY else {}
122127
self.client = AsyncOpenAI(
123128
base_url=SILICON_FLOW_BASE_URL,

0 commit comments

Comments
 (0)