From 1a88f4f4432b08c2d80f4b1867a8153eb3ad05eb Mon Sep 17 00:00:00 2001 From: eastriver Date: Sat, 27 Jan 2024 20:41:20 +0900 Subject: [PATCH] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index be8f251..2a5165d 100644 --- a/README.md +++ b/README.md @@ -98,14 +98,14 @@ public func respond(to input: String, with makeOutputFrom: @escaping (AsyncStrea open func respond(to input: String) async { await respond(to: input) { [self] response in - await setOutput(to: "") + output = "" for await responseDelta in response { update(responseDelta) - await setOutput(to: output + responseDelta) + output += responseDelta } update(nil) let trimmedOutput = output.trimmingCharacters(in: .whitespacesAndNewlines) - await setOutput(to: trimmedOutput.isEmpty ? "..." : trimmedOutput) + output = trimmedOutput.isEmpty ? "..." : trimmedOutput return output } }