Pass API Key fallback value

Seems OpenAI insists on an API key, so lets pass a default value when none is used.
This commit is contained in:
Beda Schmid
2025-11-04 10:12:20 -03:00
parent bdfaed3896
commit 3af40bc285

View File

@@ -37,6 +37,9 @@ class OpenAIRecommender:
}
if api_key is not None:
client_kwargs["api_key"] = api_key or None
elif base_url:
# OpenAI Python SDK insists on an api_key; use a benign placeholder for keyless endpoints.
client_kwargs["api_key"] = "not-provided"
if base_url:
client_kwargs["base_url"] = base_url
if default_headers: