fix(openai): make store opt-in so it stops leaking to non-OpenAI backends (#4757)
This commit is contained in:
+6
-5
@@ -126,11 +126,12 @@ class OpenAILLM(LLMBase):
|
||||
params.update(**openrouter_params)
|
||||
|
||||
else:
|
||||
openai_specific_generation_params = ["store"]
|
||||
for param in openai_specific_generation_params:
|
||||
if hasattr(self.config, param):
|
||||
params[param] = getattr(self.config, param)
|
||||
|
||||
# Only send OpenAI-specific parameters when the user has explicitly
|
||||
# configured them. OpenAI-compatible backends (Gemini, Groq, vLLM, etc.)
|
||||
# reject unknown fields, so `store` must be opt-in, not opt-out.
|
||||
if self.config.store is not None:
|
||||
params["store"] = self.config.store
|
||||
|
||||
if response_format:
|
||||
params["response_format"] = response_format
|
||||
if tools: # TODO: Remove tools if no issues found with new memory addition logic
|
||||
|
||||
Reference in New Issue
Block a user