1 min read
The Vercel AI SDK now supports Cohere through a new official provider. To use the provider, install the relevant package:
pnpm install ai @ai-sdk/cohere
You can then use the provider with all AI SDK Core methods. For example, here's how you can use it with generateText
:
import { cohere } from '@ai-sdk/cohere';import { generateText } from 'ai';
const { text } = await generateText({ model: cohere('command-r-plus'), prompt: 'Write a vegetarian lasagna recipe for 4 people.',});
Using the Cohere provider with the Vercel AI SDK
For more information, please see the documentation.