fix: delete temp competely from params when calling openai o3 (#1629)

This commit is contained in:
Parham Saidi
2025-02-10 05:07:21 +01:00
committed by GitHub
parent bd940d1d43
commit 15563a0f70
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@llamaindex/openai": patch
---
fix: moved the temp exclusion lower level for o3 mini openai
+4 -1
View File
@@ -364,7 +364,7 @@ export class OpenAI extends ToolCallLLM<OpenAIAdditionalChatOptions> {
const { messages, stream, tools, additionalChatOptions } = params;
const baseRequestParams = <OpenAILLM.Chat.ChatCompletionCreateParams>{
model: this.model,
temperature: isTemperatureSupported(this.model) ? this.temperature : null,
temperature: this.temperature,
reasoning_effort: this.reasoningEffort,
max_tokens: this.maxTokens,
tools: tools?.map(OpenAI.toTool),
@@ -381,6 +381,9 @@ export class OpenAI extends ToolCallLLM<OpenAIAdditionalChatOptions> {
delete baseRequestParams.tools;
}
if (!isTemperatureSupported(baseRequestParams.model))
delete baseRequestParams.temperature;
// Streaming
if (stream) {
return this.streamChat(baseRequestParams);