Skip to content

Commit 6d533d5

Browse files
Update aspnetcore/tutorials/ai-powered-group-chat/ai-powered-group-chat.md
Co-authored-by: David Pine <[email protected]>
1 parent cb2b291 commit 6d533d5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

aspnetcore/tutorials/ai-powered-group-chat/ai-powered-group-chat.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@ In this section, we'll walk through the key parts of the code that integrate Sig
4646
The `GroupChatHub` class manages user connections, message broadcasting, and AI interactions. When a user sends a message starting with `@gpt`, the hub forwards it to OpenAI, which generates a response. The AI's response is streamed back to the group in real-time.
4747
```csharp
4848
var chatClient = _openAI.GetChatClient(_options.Model);
49-
await foreach (var completion in chatClient.CompleteChatStreamingAsync(messagesInludeHistory))
49+
50+
await foreach (var completion in
51+
chatClient.CompleteChatStreamingAsync(messagesInludeHistory))
5052
{
5153
// ...
5254
// Buffering and sending the AI's response in chunks
53-
await Clients.Group(groupName).SendAsync("newMessageWithId", "ChatGPT", id, totalCompletion.ToString());
55+
await Clients.Group(groupName).SendAsync(
56+
"newMessageWithId",
57+
"ChatGPT",
58+
id,
59+
totalCompletion.ToString());
5460
// ...
5561
}
5662
```

0 commit comments

Comments
 (0)