"vscode:/vscode.git/clone" did not exist on "e12d610faacfe69f2de28b5a6e67fcd1501367b2"
Unverified Commit 6cc823c9 authored by Matt Williams's avatar Matt Williams Committed by GitHub
Browse files

Update examples/typescript-simplechat/client.ts


Co-authored-by: default avatarBruce MacDonald <brucewmacdonald@gmail.com>
parent b84d34e6
...@@ -30,7 +30,7 @@ async function chat(messages: Message[]): Promise<Message> { ...@@ -30,7 +30,7 @@ async function chat(messages: Message[]): Promise<Message> {
if (!reader) { if (!reader) {
throw new Error("Failed to read response body") throw new Error("Failed to read response body")
} }
const content: string[] = [] let content = ""
while (true) { while (true) {
const { done, value } = await reader.read() const { done, value } = await reader.read()
if (done) { if (done) {
...@@ -41,7 +41,7 @@ async function chat(messages: Message[]): Promise<Message> { ...@@ -41,7 +41,7 @@ async function chat(messages: Message[]): Promise<Message> {
if (json.done === false) { if (json.done === false) {
process.stdout.write(json.message.content); process.stdout.write(json.message.content);
content.push(json.message.content) content += json.message.content
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment