Together 0.9.2-dev.22
See the version list below for details.
dotnet add package Together --version 0.9.2-dev.22
NuGet\Install-Package Together -Version 0.9.2-dev.22
<PackageReference Include="Together" Version="0.9.2-dev.22" />
<PackageVersion Include="Together" Version="0.9.2-dev.22" />
<PackageReference Include="Together" />
paket add Together --version 0.9.2-dev.22
#r "nuget: Together, 0.9.2-dev.22"
#:package Together@0.9.2-dev.22
#addin nuget:?package=Together&version=0.9.2-dev.22&prerelease
#tool nuget:?package=Together&version=0.9.2-dev.22&prerelease
Together
Features 🔥
- Fully generated C# SDK based on the official Together OpenAPI specification using OpenApiGenerator
- Same day update to support new features
- Updated and supported automatically if there are no breaking changes
- All modern .NET features - nullability, trimming, NativeAOT, etc.
- Support .Net Framework/.Net Standard 2.0
- Microsoft.Extensions.AI
IChatClientandIEmbeddingGeneratorsupport
Usage
using Together;
using var client = new TogetherClient(apiKey);
Microsoft.Extensions.AI
The SDK implements IChatClient and IEmbeddingGenerator:
using Together;
using Meai = Microsoft.Extensions.AI;
// IChatClient
Meai.IChatClient chatClient = new TogetherClient(apiKey);
var response = await chatClient.GetResponseAsync(
[new Meai.ChatMessage(Meai.ChatRole.User, "Hello!")],
new Meai.ChatOptions { ModelId = "meta-llama/Llama-3.3-70B-Instruct-Turbo" });
// IEmbeddingGenerator
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = new TogetherClient(apiKey);
var embeddings = await generator.GenerateAsync(
["Hello, world!"],
new Meai.EmbeddingGenerationOptions { ModelId = "BAAI/bge-large-en-v1.5" });
Note: Use the
Meaialias because the Together SDK has its own generatedIChatClientinterface.
Chat Client Five Random Words Streaming
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var updates = chatClient.GetStreamingResponseAsync(
[
new Meai.ChatMessage(Meai.ChatRole.User, "Generate 5 random words.")
],
new Meai.ChatOptions
{
ModelId = "meta-llama/Llama-3-8b-chat-hf",
});
var deltas = new List<string>();
await foreach (var update in updates)
{
if (!string.IsNullOrWhiteSpace(update.Text))
{
deltas.Add(update.Text);
}
}
Chat Client Five Random Words
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var response = await chatClient.GetResponseAsync(
[
new Meai.ChatMessage(Meai.ChatRole.User, "Generate 5 random words.")
],
new Meai.ChatOptions
{
ModelId = "meta-llama/Llama-3-8b-chat-hf",
});
Chat Client Get Service Returns Chat Client Metadata
using var client = CreateTestClient();
Meai.IChatClient chatClient = client;
var metadata = Meai.ChatClientExtensions.GetService<Meai.ChatClientMetadata>(chatClient);
Chat Client Get Service Returns Null For Unknown Key
using var client = CreateTestClient();
Meai.IChatClient chatClient = client;
var result = Meai.ChatClientExtensions.GetService<Meai.ChatClientMetadata>(chatClient, serviceKey: "unknown");
Chat Client Get Service Returns Self
using var client = CreateTestClient();
Meai.IChatClient chatClient = client;
var self = Meai.ChatClientExtensions.GetService<TogetherClient>(chatClient);
Chat Client Reasoning Non Streaming
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var response = await chatClient.GetResponseAsync(
[new Meai.ChatMessage(Meai.ChatRole.User, "What is 25 * 37? Think step by step.")],
new Meai.ChatOptions
{
ModelId = "deepseek-ai/DeepSeek-R1",
});
var reasoning = response.Messages
.SelectMany(m => m.Contents)
.OfType<Meai.TextReasoningContent>()
.ToList();
var text = response.Messages
.SelectMany(m => m.Contents)
.OfType<Meai.TextContent>()
.ToList();
// DeepSeek-R1 should produce reasoning content
Chat Client Reasoning Streaming
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var updates = chatClient.GetStreamingResponseAsync(
[new Meai.ChatMessage(Meai.ChatRole.User, "What is 25 * 37? Think step by step.")],
new Meai.ChatOptions
{
ModelId = "deepseek-ai/DeepSeek-R1",
});
var reasoningDeltas = new List<string>();
var textDeltas = new List<string>();
await foreach (var update in updates)
{
foreach (var content in update.Contents)
{
if (content is Meai.TextReasoningContent rc && !string.IsNullOrEmpty(rc.Text))
{
reasoningDeltas.Add(rc.Text);
}
else if (content is Meai.TextContent tc && !string.IsNullOrEmpty(tc.Text))
{
textDeltas.Add(tc.Text);
}
}
}
Chat Client Tool Calling Multi Turn
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var getWeatherTool = AIFunctionFactory.Create(
(string location) => $"The weather in {location} is sunny, 72°F",
"GetWeather",
"Gets the current weather for a location");
var messages = new List<Meai.ChatMessage>
{
new(Meai.ChatRole.User, "What's the weather in Seattle?"),
};
var options = new Meai.ChatOptions
{
ModelId = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
Tools = [getWeatherTool],
};
// First turn: model should call the tool
var response = await chatClient.GetResponseAsync(messages, options);
var functionCall = response.Messages
.SelectMany(m => m.Contents)
.OfType<FunctionCallContent>()
.FirstOrDefault();
// Add assistant response with tool call and tool result
messages.AddRange(response.Messages);
var toolResult = await getWeatherTool.InvokeAsync(
functionCall!.Arguments is { } args ? new AIFunctionArguments(args) : null);
messages.Add(new Meai.ChatMessage(Meai.ChatRole.Tool,
[
new FunctionResultContent(functionCall.CallId, toolResult),
]));
// Second turn: model should respond with the weather info
var finalResponse = await chatClient.GetResponseAsync(messages, options);
Chat Client Tool Calling Single Turn
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var getWeatherTool = AIFunctionFactory.Create(
(string location) => $"The weather in {location} is sunny, 72°F",
"GetWeather",
"Gets the current weather for a location");
var response = await chatClient.GetResponseAsync(
[new Meai.ChatMessage(Meai.ChatRole.User, "What's the weather in Seattle?")],
new Meai.ChatOptions
{
ModelId = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
Tools = [getWeatherTool],
});
var functionCall = response.Messages
.SelectMany(m => m.Contents)
.OfType<FunctionCallContent>()
.FirstOrDefault();
Chat Client Tool Calling Streaming
using var client = new TogetherClient(apiKey);
Meai.IChatClient chatClient = client;
var getWeatherTool = AIFunctionFactory.Create(
(string location) => $"The weather in {location} is sunny, 72°F",
"GetWeather",
"Gets the current weather for a location");
var updates = chatClient.GetStreamingResponseAsync(
[new Meai.ChatMessage(Meai.ChatRole.User, "What's the weather in Seattle?")],
new Meai.ChatOptions
{
ModelId = "meta-llama/Llama-3.3-70B-Instruct-Turbo",
Tools = [getWeatherTool],
});
var functionCalls = new List<FunctionCallContent>();
await foreach (var update in updates)
{
functionCalls.AddRange(update.Contents.OfType<FunctionCallContent>());
}
Embedding Generator Batch Texts
using var client = new TogetherClient(apiKey);
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;
var embeddings = await generator.GenerateAsync(
["Hello", "World", "Test"],
new Meai.EmbeddingGenerationOptions
{
ModelId = "BAAI/bge-base-en-v1.5",
});
foreach (var embedding in embeddings)
{
}
Embedding Generator Get Service Returns Metadata
using var client = CreateTestClient();
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;
var metadata = Meai.EmbeddingGeneratorExtensions.GetService<Meai.EmbeddingGeneratorMetadata>(generator);
Embedding Generator Get Service Returns Null For Unknown Key
using var client = CreateTestClient();
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;
var result = Meai.EmbeddingGeneratorExtensions.GetService<Meai.EmbeddingGeneratorMetadata>(generator, serviceKey: "unknown");
Embedding Generator Get Service Returns Self
using var client = CreateTestClient();
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;
var self = Meai.EmbeddingGeneratorExtensions.GetService<TogetherClient>(generator);
Embedding Generator Single Text
using var client = new TogetherClient(apiKey);
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;
var embeddings = await generator.GenerateAsync(
["Hello, world!"],
new Meai.EmbeddingGenerationOptions
{
ModelId = "BAAI/bge-base-en-v1.5",
});
Test
using var client = new TogetherClient(apiKey);
Ecosystem maintenance
This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.
Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.
Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.
Support
Priority place for bugs: https://github.com/tryAGI/Together/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Together/discussions
Discord: https://discord.gg/Ca2xhfBf3v
Acknowledgments
This project is supported by JetBrains through the Open Source Support Program.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.9.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Together:
| Package | Downloads |
|---|---|
|
LangChain.Providers.Together
Together.ai Chat model provider. |
|
|
HPD-Agent.Providers.Together
Together AI provider for HPD-Agent |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.2-dev.30 | 0 | 9/27/2026 |
| 0.9.2-dev.29 | 24 | 9/27/2026 |
| 0.9.2-dev.28 | 33 | 9/25/2026 |
| 0.9.2-dev.27 | 50 | 9/23/2026 |
| 0.9.2-dev.26 | 41 | 9/22/2026 |
| 0.9.2-dev.25 | 48 | 9/22/2026 |
| 0.9.2-dev.24 | 62 | 9/21/2026 |
| 0.9.2-dev.23 | 65 | 9/16/2026 |
| 0.9.2-dev.22 | 54 | 9/15/2026 |
| 0.9.2-dev.21 | 59 | 9/13/2026 |
| 0.9.2-dev.20 | 66 | 9/10/2026 |
| 0.9.2-dev.19 | 74 | 9/9/2026 |
| 0.9.2-dev.18 | 70 | 9/9/2026 |
| 0.9.2-dev.17 | 69 | 9/4/2026 |
| 0.9.2-dev.16 | 72 | 9/2/2026 |
| 0.9.2-dev.15 | 69 | 9/2/2026 |
| 0.9.2-dev.14 | 70 | 9/2/2026 |
| 0.9.2-dev.13 | 91 | 8/31/2026 |
| 0.9.2-dev.8 | 95 | 6/16/2026 |
| 0.9.1 | 964 | 4/30/2026 |