Skip to content

Mistral

Rasmus Wulff Jensen edited this page Dec 26, 2025 · 3 revisions

NuGet README

Features

  • AgentFactory (MistralAgentFactory)
  • AIToolsFactory integration (tools in MistralAgentOptions.Tools)
  • EmbeddingFactory (MistralEmbeddingFactory)

Package

dotnet add package AgentFrameworkToolkit.Mistral

Quick start

MistralAgentFactory agentFactory = new("<apiKey>");
MistralAgent agent = agentFactory.CreateAgent("mistral-small-latest");

AgentRunResponse response = await agent.RunAsync("Hello World");
Console.WriteLine(response);

Embeddings

MistralEmbeddingFactory embeddingFactory = new("<apiKey>");
IEmbeddingGenerator<string, Embedding<float>> generator = embeddingFactory.GetEmbeddingGenerator();
Embedding<float> embedding = await generator.GenerateAsync(
    "Hello",
    options: new EmbeddingGenerationOptions { ModelId = ModelDefinitions.MistralEmbed });

Connection options

  • ApiKey (required)
  • NetworkTimeout (optional)

Dependency injection

builder.Services.AddMistralAgentFactory("<apiKey>");
builder.Services.AddMistralAgentFactory(new MistralConnection
{
    ApiKey = "<apiKey>",
    NetworkTimeout = TimeSpan.FromMinutes(5)
});

Notes

Clone this wiki locally