TRS.AI.MistralAI
0.0.1
dotnet add package TRS.AI.MistralAI --version 0.0.1
NuGet\Install-Package TRS.AI.MistralAI -Version 0.0.1
<PackageReference Include="TRS.AI.MistralAI" Version="0.0.1" />
paket add TRS.AI.MistralAI --version 0.0.1
#r "nuget: TRS.AI.MistralAI, 0.0.1"
// Install TRS.AI.MistralAI as a Cake Addin #addin nuget:?package=TRS.AI.MistralAI&version=0.0.1 // Install TRS.AI.MistralAI as a Cake Tool #tool nuget:?package=TRS.AI.MistralAI&version=0.0.1
Dotnet SDK for MistralAI
Install-Package TRS.AI.MistralAI
Dotnet SDK for Mistral AI
Unofficial.
MistralAI doesn't have any official .Net SDK.
Features
For changelogs please go to end of the document.
Sample Usages
Your API Key comes from here --> https://mistral.ai/
Without using dependency injection:
var aiService = new MistralAIService(new MistralAIOptions()
{
ApiKey = Environment.GetEnvironmentVariable("MISTRAL_API_KEY")
});
Using dependency injection:
secrets.json:
"MistralAIServiceOptions": {
//"ApiKey":"Your api key goes here"
}
(How to use user secret ?
Right click your project name in "solution explorer" then click "Manage User Secret", it is a good way to keep your api keys)
Program.cs
serviceCollection.AddMistralAIService();
OR
Use it like below but do NOT put your API key directly to your source code.
Program.cs
serviceCollection.AddMistralAIService(settings => { settings.ApiKey = Environment.GetEnvironmentVariable("MISTRAL_API_KEY"); });
After injecting your service you will be able to get it from service provider
var aiService = serviceProvider.GetRequiredService<IMistralAIService>();
You can set default model(optional):
aiService.SetDefaultModelId(Models.Mistral_Medium);
Notes
Changelog
0.0.1
- Implementation of completion API
- Implementation of embeddings API
- Implementation of models API
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
-
net7.0
- Microsoft.Extensions.Http (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
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.0.1 | 163 | 1/28/2024 |