From a4513a7e4f7169cb251b8d9c595cfe1b6f8440d7 Mon Sep 17 00:00:00 2001 From: Jungkyu Yang Date: Sun, 4 Jan 2026 20:27:21 +0900 Subject: [PATCH] fix: correct streamChunk content access in README example the example incorrectly uses streamChunk.content, but the actual response structure requires streamChunk.choices[0].message.content to access the message content. this change updates the README to reflect the correct API response structure, ensuring developers can properly access the message content from chat completions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3716a09..a8da0bb 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ const streamChunk = await client.chat.completions.create({ model: 'sonar', }); -console.log(streamChunk.content); +console.log(streamChunk.choices[0].message.content); ``` ### Advanced Search Features