new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

cohere/models

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Cohere language model instantiation

Create Cohere language models using the provider instance with model ID as argument. Example: const model = cohere('command-r-plus'); Models are called via the Cohere chat API and some support tool calls.

Cohere generateText example

Example of using Cohere language models with generateText function: 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.', });

Cohere embedding model instantiation

Create Cohere embedding models using the .embedding() factory method. Example: const model = cohere.embedding('embed-english-v3.0'); Models are called via the Cohere embed API.

Cohere embed function example

Example of using Cohere embedding models with embed function: import { cohere, type CohereEmbeddingModelOptions } from '@ai-sdk/cohere'; import { embed } from 'ai'; const { embedding } = await embed({ model: cohere.embedding('embed-english-v3.0'), value: 'sunny day at the beach', providerOptions: { cohere: { inputType: 'search_document', } satisfies CohereEmbeddingModelOptions, }, });

Cohere reranking model instantiation

Create Cohere reranking models using the .reranking() factory method. Example: const model = cohere.reranking('rerank-v3.5'); Models are called via the Cohere rerank API.

Cohere rerank function example

Example of using Cohere reranking models with rerank function: import { cohere } from '@ai-sdk/cohere'; import { rerank } from 'ai'; const documents = [ 'sunny day at the beach', 'rainy afternoon in the city', 'snowy night in the mountains', ]; const { ranking } = await rerank({ model: cohere.reranking('rerank-v3.5'), documents, query: 'talk about rain', topN: 2, }); console.log(ranking); // [ // { originalIndex: 1, score: 0.9, document: 'rainy afternoon in the city' }, // { originalIndex: 0, score: 0.3, document: 'sunny day at the beach' } // ]

Give your agent this brain