From 71dcb69e1a2dfe4b50dee8aab92d3a93af835794 Mon Sep 17 00:00:00 2001 From: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:14:42 -0500 Subject: [PATCH] Update fern/pages/v2/text-generation/chat-api.mdx Co-authored-by: Meor Amer <92068895+mrmer1@users.noreply.github.com> Signed-off-by: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> --- fern/pages/v2/text-generation/chat-api.mdx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fern/pages/v2/text-generation/chat-api.mdx b/fern/pages/v2/text-generation/chat-api.mdx index abb40a7b..af750615 100644 --- a/fern/pages/v2/text-generation/chat-api.mdx +++ b/fern/pages/v2/text-generation/chat-api.mdx @@ -48,19 +48,26 @@ public class ChatPost { } ``` ```typescript TYPESCRIPT -const { CohereClient } = require('cohere-ai'); +const { CohereClientV2 } = require('cohere-ai'); -const cohere = new CohereClient({ - token: '', +const cohere = new CohereClientV2({ + token: '<>', }); (async () => { const response = await cohere.chat({ - message: 'Write a title for a blog post about API design. Only output the title text.', + model: 'command-r-plus', + messages: [ + { + role: 'user', + content: 'hello world!', + }, + ], }); - console.log(response.text) + console.log(response); })(); + ```