Cisharpai.Cohere 0.2.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cisharpai.Cohere --version 0.2.2
                    
NuGet\Install-Package Cisharpai.Cohere -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cisharpai.Cohere" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cisharpai.Cohere" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Cisharpai.Cohere" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cisharpai.Cohere --version 0.2.2
                    
#r "nuget: Cisharpai.Cohere, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cisharpai.Cohere@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cisharpai.Cohere&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Cisharpai.Cohere&version=0.2.2
                    
Install as a Cake Tool

Cisharpai.Cohere

Cohere provider for the Cisharpai unified LLM client library.

Features

Chat

  • Chat completions via Cohere v2 Chat API
  • JSON Mode and Structured Outputs (response_format with json_schema)
  • Tool calling with uppercase ToolChoice mapping and strict_tools flag
  • Grounded chat (RAG) with document citations via IGroundedChatFeature
  • Streaming (token-by-token via SSE)

Embeddings

  • Text embeddings (Embed v3 models)
  • Image embeddings via IImageEmbeddingFeature
  • Multimodal embeddings (Embed v4) — mixed text + image inputs, Matryoshka dimension control via IMultimodalEmbeddingFeature

Quick Start — Chat

using Cisharpai;
using Cisharpai.Models;
using Cisharpai.Cohere;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddCohereChatClient(options =>
{
    options.ApiKey = "YOUR_API_KEY";
    options.DefaultModel = CohereModels.Chat.CommandA;
});

var provider = services.BuildServiceProvider();
var client = provider.GetRequiredService<IChatCompletionClient>();

var response = await client.GetChatCompletionAsync(
    new ChatCompletionRequest(
        Messages: [new LlmMessage(LlmRole.User, "Hello!")]));

Quick Start — Embeddings

services.AddCohereEmbeddingClient(options =>
{
    options.ApiKey = "YOUR_API_KEY";
    options.DefaultModel = CohereModels.Embedding.EmbedV4;
});

var embeddingClient = provider.GetRequiredService<IEmbeddingClient>();
var result = await embeddingClient.GetEmbeddingAsync(
    new EmbeddingRequest(Input: ["Hello world"], InputType: "search_document"));

Grounded Chat (RAG)

Cohere is the only provider supporting IGroundedChatFeature — pass documents and get back citations with character offsets:

var feature = ((IHasFeatures)client).Features.Get<IGroundedChatFeature>();
var result = await feature!.GetGroundedChatCompletionAsync(request,
    new GroundedChatOptions(
        Documents: [new DocumentChunk("doc1", Text: "The capital of France is Paris.")],
        CitationMode: CitationMode.Accurate));

Available Models

Chat: CommandA, CommandRPlus, CommandR

Embedding: EmbedV4, EmbedEnglishV3, EmbedMultilingualV3, EmbedEnglishLightV3, EmbedMultilingualLightV3

Keyed Services

services.AddCohereChatClient("chat", options => { /* ... */ });
services.AddCohereEmbeddingClient("embed", options => { /* ... */ });
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.12.202 36 5/19/2026
0.3.0-alpha.11.197 43 5/15/2026
0.3.0-alpha.10.196 51 5/15/2026
0.3.0-alpha.9.186 59 5/8/2026
0.3.0-alpha.8.185 58 5/8/2026
0.3.0-alpha.7.164 45 5/6/2026
0.3.0-alpha.6.161 45 5/6/2026
0.3.0-alpha.5.159 48 5/6/2026
0.3.0-alpha.5.155 42 5/6/2026
0.3.0-alpha.4.156 45 5/6/2026
0.3.0-alpha.4.154 48 5/6/2026
0.3.0-alpha.3.150 46 4/30/2026
0.3.0-alpha.2.145 41 4/30/2026
0.2.2 98 4/30/2026
0.2.2-beta.1.147 45 4/30/2026
0.2.2-beta.1.146 47 4/30/2026
0.2.1 86 4/30/2026
0.2.1-beta.1.142 44 4/30/2026
0.2.1-beta.1.140 47 4/30/2026
0.2.1-beta.1.138 43 4/30/2026
Loading failed