Mapache.PromptEvalDotNet
0.0.2
dotnet add package Mapache.PromptEvalDotNet --version 0.0.2
NuGet\Install-Package Mapache.PromptEvalDotNet -Version 0.0.2
<PackageReference Include="Mapache.PromptEvalDotNet" Version="0.0.2" />
paket add Mapache.PromptEvalDotNet --version 0.0.2
#r "nuget: Mapache.PromptEvalDotNet, 0.0.2"
// Install Mapache.PromptEvalDotNet as a Cake Addin #addin nuget:?package=Mapache.PromptEvalDotNet&version=0.0.2 // Install Mapache.PromptEvalDotNet as a Cake Tool #tool nuget:?package=Mapache.PromptEvalDotNet&version=0.0.2
Mapache.PromptEvalDotNet NuGet Package
This NuGet package, Mapache.PromptEvalDotNet
, empowers your .NET projects with a robust and versatile library for evaluating, testing, and validating applications and systems using Large Language Models (LLMs). Seamlessly integrate AI/ML evaluations into your projects to assess performance, accuracy, and robustness with ease.
Installation
Install the Mapache.PromptEvalDotNet
NuGet package via the NuGet Package Manager or the .NET CLI:
dotnet add package Mapache.PromptEvalDotNet
Usage
Sample Code
// Sample code for using Mapache.PromptEvalDotNet
var kernelBuilder = Kernel.CreateBuilder();
kernelBuilder.AddAzureOpenAIChatCompletion(config["AZURE_OPENAI_MODEL"]!, config["AZURE_OPENAI_ENDPOINT"]!, config["AZURE_OPENAI_KEY"]!);
var evalFactory = new Mapache.PromptEvalDotNet.EvaluatorFactory("MyProjectEvals", builder.Build());
var coherence = await evalFactory.Coherence("blog-posts").GetScore(prompt, answer);
Explanation
Kernel Setup: Begin by setting up the kernel using
Kernel.CreateBuilder()
.Integration with Azure OpenAI Chat Completion: Use
kernelBuilder.AddAzureOpenAIChatCompletion
to integrate with Azure OpenAI Chat Completion, providing the necessary configuration parameters.Evaluator Factory Initialization: Create an instance of
Mapache.PromptEvalDotNet.EvaluatorFactory
by providing a unique project name and the built kernel.Evaluate Coherence: Utilize the
evalFactory.Coherence
method to evaluate coherence for a specific context, such as "blog-posts."Get Score: Obtain the coherence score by calling
GetScore
with the prompt and answer.
Contributing
See the project repo for more information.
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. |
-
net8.0
- Microsoft.SemanticKernel (>= 1.0.1)
- OpenTelemetry.Exporter.Console (>= 1.7.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.0)
- xunit.assert (>= 2.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.