Cohere.Client
0.1.1
dotnet add package Cohere.Client --version 0.1.1
NuGet\Install-Package Cohere.Client -Version 0.1.1
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="Cohere.Client" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cohere.Client" Version="0.1.1" />
<PackageReference Include="Cohere.Client" />
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 Cohere.Client --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cohere.Client, 0.1.1"
#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 Cohere.Client@0.1.1
#: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=Cohere.Client&version=0.1.1
#tool nuget:?package=Cohere.Client&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Cohere.Extensions.AI
Cohere.Extensions.AI is an open-source library that provides:
- A lightweight .NET client for the Cohere API (v1/v2, including SSE streaming).
- An
IChatClientadapter forMicrosoft.Extensions.AI.
⚠️ This project is independent and not maintained or endorsed by Cohere Inc.
Installation
dotnet add package Cohere.Client
dotnet add package Cohere.Extensions.AI
Quickstart
Direct access to Cohere API
using Cohere.Client;
var client = new CohereClient(Environment.GetEnvironmentVariable("COHERE_API_KEY")!);
var resp = await client.ChatV2Async(new ChatRequestV2 {
Model = "command-r-08-2024",
Messages = [ new() { Role = "user", Content = "Hello" } ]
});
Console.WriteLine(resp.Text);
Integration with Microsoft.Extensions.AI
using Cohere.Extensions.AI.Chat;
using Microsoft.Extensions.AI;
var chat = new CohereChatClient(
new CohereClient(Environment.GetEnvironmentVariable("COHERE_API_KEY")!),
new CohereChatClientOptions { ModelId = "command-r-08-2024" }
);
var answer = await chat.GetResponseAsync(
new[] { new ChatMessage(ChatRole.User, "Ping") },
new ChatOptions(), CancellationToken.None
);
Console.WriteLine(answer.Message?.Text);
Features
- Support for Cohere Chat API v1 and v2.
- Streaming responses via SSE (
IAsyncEnumerable). - Seamless integration with
Microsoft.Extensions.AI.IChatClient. - Configurable
HttpClient,BaseUri, and cancellation support.
Documentation
License
MIT — see LICENSE.
| Product | Versions 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 is compatible. 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 was computed. 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.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cohere.Client:
| Package | Downloads |
|---|---|
|
Cohere.Extensions.AI
Adapter that integrates Cohere models with Microsoft.Extensions.AI.IChatClient. Enables seamless use of Cohere within the new .NET AI abstractions, including support for streaming responses, cancellation, and flexible model selection. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1 | 308 | 9/21/2025 |
Initial release with chat completion support.