diff --git a/docs/docs/plugins/cohere.md b/docs/docs/plugins/cohere.md index fdea4fa8..698edc13 100644 --- a/docs/docs/plugins/cohere.md +++ b/docs/docs/plugins/cohere.md @@ -37,12 +37,35 @@ Install the plugin in your project with your favorite package manager: ## Usage -:::warning - -Documentation is currently work in progress. - -::: - +### Basic examples + +The simplest way to call the text generation model is by using the helper function `generate`: +``` +// Basic usage of an LLM +const response = await generate({ + model: commandRPlus, + prompt: 'Tell me a joke.', +}); + +console.log(await response.text()); +``` + +Using the same interface, you can prompt a multimodal model: +``` +const response = await generate({ + model: commandRPlus, + prompt: [ + { text: 'What animal is in the photo?' }, + { media: { url: imageUrl} }, + ], + config:{ + // control of the level of visual detail when processing image embeddings + // Low detail level also decreases the token usage + visualDetailLevel: 'low', + } +}); +console.log(await response.text()); +``` ## Contributing Want to contribute to the project? That's awesome! Head over to our [Contribution Guidelines](https://github.com/TheFireCo/genkit-plugins/blob/main/https://github.com/TheFireCo/genkit-plugins/blob/main/CONTRIBUTING.md). diff --git a/plugins/cohere/README.md b/plugins/cohere/README.md index 900ad625..e72f19ea 100644 --- a/plugins/cohere/README.md +++ b/plugins/cohere/README.md @@ -32,8 +32,36 @@ Install the plugin in your project with your favorite package manager: ## Usage -> \[!WARNING\]\ -> Documentation is currently work in progress. +### Basic examples + +The simplest way to call the text generation model is by using the helper function `generate`: +``` +// Basic usage of an LLM +const response = await generate({ + model: commandRPlus, + prompt: 'Tell me a joke.', +}); + +console.log(await response.text()); +``` + +Using the same interface, you can prompt a multimodal model: +``` +const response = await generate({ + model: commandRPlus, + prompt: [ + { text: 'What animal is in the photo?' }, + { media: { url: imageUrl} }, + ], + config:{ + // control of the level of visual detail when processing image embeddings + // Low detail level also decreases the token usage + visualDetailLevel: 'low', + } +}); +console.log(await response.text()); +``` + ## Contributing