From 14f5b2d95e71c836a115611ec6fe0da7acf65570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20W=C4=85sik?= <32049761+Eghizio@users.noreply.github.com> Date: Mon, 14 Apr 2025 00:53:01 +0200 Subject: [PATCH] Update quickstart TypeScript example, "chatResponse.choices" is possibly undefined --- docs/getting-started/quickstart.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx index 5717564e..133408c8 100644 --- a/docs/getting-started/quickstart.mdx +++ b/docs/getting-started/quickstart.mdx @@ -71,7 +71,7 @@ const chatResponse = await client.chat.complete({ messages: [{role: 'user', content: 'What is the best French cheese?'}], }); -console.log('Chat:', chatResponse.choices[0].message.content); +console.log('Chat:', chatResponse.choices?.[0].message.content); ```