Skip to content

Commit 0cbf009

Browse files
committed
fix typo and add comments
1 parent d01c975 commit 0cbf009

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Examples/text_chat/Sources/TextChat.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ struct TextChat {
6868
.withPrompt(prompt)
6969
} else {
7070
// append the new prompt to the existing request
71-
// ConverseRequestBuilder is stateles, it doesn't keep track of the history
71+
// ConverseRequestBuilder is stateless, it doesn't keep track of the history
72+
// thanks to the `if` above, we're sure `request` is not nil
7273
request = try ConverseRequestBuilder(from: request!)
7374
.withHistory(history)
7475
.withPrompt(prompt)
@@ -77,7 +78,7 @@ struct TextChat {
7778
// keep track of the history of the conversation
7879
history.append(Message(prompt))
7980

80-
// send the request
81+
// send the request. We are sure `request` is not nil
8182
let reply = try await bedrock.converseStream(with: request!)
8283

8384
for try await element in reply.stream {

0 commit comments

Comments
 (0)