You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling the assistant update endpoint using the provided Go client (specifically via the UpdateAssistantOnOpenAI method), the generated JSON payload inadvertently includes the temperature field—even when I don't explicitly set it in my update configuration. This causes the API to reject the request with a 400 Bad Request error and the following message:
Unsupported parameter: 'temperature' is not supported with this model.
The problem appears to be caused by the way the library's BetaAssistantUpdateParams struct is defined. Since it includes a field for temperature:
—even when no value is set—the default (or zero) value is serialized and sent in the payload. For models that do not support a temperature parameter (such as o1 and o3-mini), this leads to an error.
Steps to Reproduce
Use the client's update method similar to the following snippet (note that no temperature is being explicitly provided):
toolResources:= openailib.BetaAssistantUpdateParamsToolResources{
FileSearch: openailib.F(openailib.BetaAssistantUpdateParamsToolResourcesFileSearch{
VectorStoreIDs: openailib.F([]string{s.vectorStoreID}),
}),
}
tools:= []openailib.AssistantToolUnionParam{
openailib.FileSearchToolParam{
Type: openailib.F(openailib.FileSearchToolTypeFileSearch),
FileSearch: openailib.F(openailib.FileSearchToolFileSearchParam{}),
},
}
params:= openailib.BetaAssistantUpdateParams{
Description: openailib.F(cfg.Description),
Instructions: openailib.F(fullInstructions),
Model: openailib.F(cfg.Model),
Name: openailib.F(cfg.Name),
ToolResources: openailib.F(toolResources),
Tools: openailib.F(tools),
TopP: openailib.F(0.0), // example value for top_p// Temperature is not explicitly set, but still gets serialized
}
if_, err:=s.client.Beta.Assistants.Update(ctx, externalAssistantID, params); err!=nil {
returnfmt.Errorf("error updating assistant on openai: %w", err)
}
Observe that the request payload still includes the "temperature" field, which then triggers the error.
Expected Behavior
If no temperature value is explicitly provided, the client should omit the temperature field from the JSON payload. Alternatively, there should be a clear mechanism (e.g., an omitempty option or a dedicated method) to prevent sending the parameter when it is unsupported by the model.
Actual Behavior
The request payload always includes a temperature field (even if set to zero by default), which leads to a 400 error for models that do not support this parameter (such as o1 and o3-mini).
Environment
OpenAI Go SDK version: v0.1.0-alpha.55
Go version: 1.23
Models affected: o1, o3-mini
Request
I kindly request that the library either:
Adjust the serialization of BetaAssistantUpdateParams to omit the temperature field when it is not explicitly set (for example, by adding omitempty to the JSON tag), or
Provide an alternative method or configuration that prevents sending unsupported parameters for models that do not accept them.
Thank you for your consideration and for maintaining the SDK.
The text was updated successfully, but these errors were encountered:
Description
When calling the assistant update endpoint using the provided Go client (specifically via the
UpdateAssistantOnOpenAI
method), the generated JSON payload inadvertently includes thetemperature
field—even when I don't explicitly set it in my update configuration. This causes the API to reject the request with a 400 Bad Request error and the following message:The problem appears to be caused by the way the library's
BetaAssistantUpdateParams
struct is defined. Since it includes a field for temperature:—even when no value is set—the default (or zero) value is serialized and sent in the payload. For models that do not support a temperature parameter (such as o1 and o3-mini), this leads to an error.
Steps to Reproduce
Use the client's update method similar to the following snippet (note that no temperature is being explicitly provided):
Observe that the request payload still includes the "temperature" field, which then triggers the error.
Expected Behavior
If no temperature value is explicitly provided, the client should omit the temperature field from the JSON payload. Alternatively, there should be a clear mechanism (e.g., an omitempty option or a dedicated method) to prevent sending the parameter when it is unsupported by the model.
Actual Behavior
The request payload always includes a temperature field (even if set to zero by default), which leads to a 400 error for models that do not support this parameter (such as o1 and o3-mini).
Environment
Request
I kindly request that the library either:
Thank you for your consideration and for maintaining the SDK.
The text was updated successfully, but these errors were encountered: