Skip to content

Commit cbf3089

Browse files
committed
feat: add thinking budget parameter
1 parent 6ad384a commit cbf3089

File tree

5 files changed

+52
-451
lines changed

5 files changed

+52
-451
lines changed

src/Cnblogs.DashScope.Core/ITextGenerationParameters.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ public interface ITextGenerationParameters
4545
/// </summary>
4646
public bool? EnableThinking { get; }
4747

48+
/// <summary>
49+
/// Maximum length of thinking content. Valid for supported models.(e.g. qwen3)
50+
/// </summary>
51+
public int? ThinkingBudget { get; set; }
52+
53+
/// <summary>
54+
/// Include log possibilities in response.
55+
/// </summary>
56+
public bool? Logprobs { get; set; }
57+
58+
/// <summary>
59+
/// How many choices should be returned. Range: [0, 5]
60+
/// </summary>
61+
public int? TopLogprobs { get; set; }
62+
4863
/// <summary>
4964
/// Available tools for model to call.
5065
/// </summary>

src/Cnblogs.DashScope.Core/TextGenerationParameters.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public class TextGenerationParameters : ITextGenerationParameters
4141
/// <inheritdoc />
4242
public bool? EnableThinking { get; set; }
4343

44+
/// <inheritdoc />
45+
public int? ThinkingBudget { get; set; }
46+
47+
/// <inheritdoc />
48+
public bool? Logprobs { get; set; }
49+
50+
/// <inheritdoc />
51+
public int? TopLogprobs { get; set; }
52+
4453
/// <inheritdoc />
4554
public IEnumerable<ToolDefinition>? Tools { get; set; }
4655

test/Cnblogs.DashScope.Tests.Shared/RawHttpData/single-generation-message-reasoning-sse.request.body.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
]
1010
},
1111
"parameters": {
12-
"incremental_output": true,
1312
"result_format": "message",
14-
"enable_thinking": true
13+
"incremental_output": true,
14+
"enable_thinking": true,
15+
"thinking_budget": 10
1516
}
1617
}

0 commit comments

Comments
 (0)