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                
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="TRS.AI.MistralAI" Version="0.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TRS.AI.MistralAI --version 0.0.1                
#r "nuget: TRS.AI.MistralAI, 0.0.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.
// 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 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. 
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.0.1 165 1/28/2024