agentscope-java
agentscope-java copied to clipboard
[Bug]:OpenAIClient ignores GenerateOptions.additionalBodyParams
Background
GenerateOptions.additionalBodyParams() exists but is only applied in DashScopeHttpClient.
OpenAIClient ignores it, which prevents users from passing provider-specific parameters
(e.g., thinking: {type: "enabled"} for DeepSeek) when using OpenAI-compatible models.
Proposed Change
Merge additionalBodyParams from GenerateOptions into the OpenAIRequest before
serialization in OpenAIClient.call() and OpenAIClient.stream().
Use Case
OpenAIChatModel.builder()
.generateOptions(GenerateOptions.builder()
.additionalBodyParam("thinking", Map.of("type", "enabled"))
.build())
.build();
I'd like to work on this. I have a fix ready.
Closing — OpenAIChatFormatter.applyOptions() already merges additionalBodyParams
into OpenAIRequest via applyAdditionalBodyParams() (line 116-117).
No change needed in OpenAIClient.