Skip to content

Commit 8100480

Browse files
committed
chore: update sample
1 parent 2e2ed3b commit 8100480

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sample/Cnblogs.DashScope.Sample/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ async Task ChatWithMicrosoftExtensions()
206206
{
207207
Console.WriteLine("Requesting model...");
208208
var chatClient = dashScopeClient.AsChatClient("qwen-max");
209-
var response = await chatClient.CompleteAsync("你好,很高兴认识你");
209+
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);
210215
var serializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web) { WriteIndented = true };
211216
Console.WriteLine(JsonSerializer.Serialize(response, serializerOptions));
212217
}

0 commit comments

Comments
 (0)