@@ -123,19 +123,6 @@ var completion = await client.GetQWenCompletionAsync(QWenLlm.QWenMax, prompt);
123
123
Console .WriteLine (completion .Output .Text );
124
124
```
125
125
126
- ## Reasoning
127
-
128
- Use ` completion.Output.Choices![0].Message.ReasoningContent ` to access the reasoning content from model.
129
-
130
- ``` csharp
131
- var history = new List <ChatMessage >
132
- {
133
- ChatMessage .User (" Calculate 1+1" )
134
- };
135
- var completion = await client .GetDeepSeekChatCompletionAsync (DeepSeekLlm .DeepSeekR1 , history );
136
- Console .WriteLine (completion .Output .Choices [0 ]! .Message .ReasoningContent );
137
- ```
138
-
139
126
## Multi-round chat
140
127
141
128
``` csharp
@@ -153,6 +140,36 @@ var completion = await client.GetQWenChatCompletionAsync(QWenLlm.QWenMax, histor
153
140
Console .WriteLine (completion .Output .Choices [0 ].Message .Content ); // The number is 42
154
141
```
155
142
143
+ ## Reasoning
144
+
145
+ Use ` completion.Output.Choices![0].Message.ReasoningContent ` to access the thoughts from reasoning model.
146
+
147
+ ``` csharp
148
+ var history = new List <ChatMessage >
149
+ {
150
+ ChatMessage .User (" Calculate 1+1" )
151
+ };
152
+ var completion = await client .GetDeepSeekChatCompletionAsync (DeepSeekLlm .DeepSeekR1 , history );
153
+ Console .WriteLine (completion .Output .Choices [0 ]! .Message .ReasoningContent );
154
+ ```
155
+
156
+ ### QWen3
157
+
158
+ Use ` TextGenerationParameters.EnableThinking ` to toggle reasoning.
159
+
160
+ ``` csharp
161
+ var stream = dashScopeClient
162
+ .GetQWenChatStreamAsync (
163
+ QWenLlm .QWenPlusLatest ,
164
+ history ,
165
+ new TextGenerationParameters
166
+ {
167
+ IncrementalOutput = true ,
168
+ ResultFormat = ResultFormats .Message ,
169
+ EnableThinking = true
170
+ });
171
+ ```
172
+
156
173
## Function Call
157
174
158
175
Creates a function with parameters
@@ -182,7 +199,7 @@ public enum TemperatureUnit
182
199
}
183
200
```
184
201
185
- Append tool information to chat messages.
202
+ Append tool information to chat messages (Here we use ` JsonSchema.NET ` to generate JSON Schema) .
186
203
187
204
``` csharp
188
205
var tools = new List <ToolDefinition >()
0 commit comments