Skip to content

Commit

Permalink
chore: update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesnowy committed Nov 27, 2024
1 parent 2e2ed3b commit 8100480
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sample/Cnblogs.DashScope.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ async Task ChatWithMicrosoftExtensions()
{
Console.WriteLine("Requesting model...");
var chatClient = dashScopeClient.AsChatClient("qwen-max");
var response = await chatClient.CompleteAsync("你好,很高兴认识你");
List<ChatMessage> conversation =
[
new(ChatRole.System, "You are a helpful AI assistant"),
new(ChatRole.User, "What is AI?")
];
var response = await chatClient.CompleteAsync(conversation);
var serializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web) { WriteIndented = true };
Console.WriteLine(JsonSerializer.Serialize(response, serializerOptions));
}

0 comments on commit 8100480

Please sign in to comment.