agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Bug]:OpenAIClient ignores GenerateOptions.additionalBodyParams

Open Mrjyw opened this issue 7 months ago • 2 comments

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();

Mrjyw avatar May 02 '26 08:05 Mrjyw

I'd like to work on this. I have a fix ready.

Mrjyw avatar May 02 '26 08:05 Mrjyw

Closing — OpenAIChatFormatter.applyOptions() already merges additionalBodyParams into OpenAIRequest via applyAdditionalBodyParams() (line 116-117). No change needed in OpenAIClient.

Mrjyw avatar May 02 '26 08:05 Mrjyw