We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e2ed3b commit 8100480Copy full SHA for 8100480
sample/Cnblogs.DashScope.Sample/Program.cs
@@ -206,7 +206,12 @@ async Task ChatWithMicrosoftExtensions()
206
{
207
Console.WriteLine("Requesting model...");
208
var chatClient = dashScopeClient.AsChatClient("qwen-max");
209
- var response = await chatClient.CompleteAsync("你好,很高兴认识你");
+ List<ChatMessage> conversation =
210
+ [
211
+ new(ChatRole.System, "You are a helpful AI assistant"),
212
+ new(ChatRole.User, "What is AI?")
213
+ ];
214
+ var response = await chatClient.CompleteAsync(conversation);
215
var serializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web) { WriteIndented = true };
216
Console.WriteLine(JsonSerializer.Serialize(response, serializerOptions));
217
}
0 commit comments