Denomica.OpenAI.Extensions 1.0.0-beta.5

This is a prerelease version of Denomica.OpenAI.Extensions.
dotnet add package Denomica.OpenAI.Extensions --version 1.0.0-beta.5
                    
NuGet\Install-Package Denomica.OpenAI.Extensions -Version 1.0.0-beta.5
                    
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="Denomica.OpenAI.Extensions" Version="1.0.0-beta.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Denomica.OpenAI.Extensions" Version="1.0.0-beta.5" />
                    
Directory.Packages.props
<PackageReference Include="Denomica.OpenAI.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Denomica.OpenAI.Extensions --version 1.0.0-beta.5
                    
#r "nuget: Denomica.OpenAI.Extensions, 1.0.0-beta.5"
                    
#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.
#:package Denomica.OpenAI.Extensions@1.0.0-beta.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Denomica.OpenAI.Extensions&version=1.0.0-beta.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Denomica.OpenAI.Extensions&version=1.0.0-beta.5&prerelease
                    
Install as a Cake Tool

Denomica.OpenAI.Extensions

Denomica.OpenAI.Extensions is a library that provides extension methods for working with types in Azure.AI.OpenAI.

The library originally started with providing functionality for chunking up text into smaller pieces, which is useful for generating embeddings with the OpenAI API. But it will evolve over time to include additional features and utilities for working with OpenAI's API in Azure AI Foundry.

Getting Started

The following sample code illustrates how to quickly get started with the library.

using Denomica.OpenAI.Extensions.Chat;
using Denomica.OpenAI.Extensions.Embeddings;
using Denomica.OpenAI.Extensions.Text;
using Microsoft.Extensions.DependencyInjection;
using OpenAI.Chat;

var provider = new ServiceCollection()
    .AddOpenAIExtensions()
    .WithChunkingService<LineChunkingService>()
    .WithChatModel((opt, sp) =>
    {
        // Add your chat model configuration here.
    })
    .WithEmbeddingModel((opt, sp) =>
    {
        // Add your embedding model configuration here.
    })
    .Services
    .BuildServiceProvider();

var chatProvider = provider.GetRequiredService<ChatProvider>();
var chatResult = await chatProvider.Client.CompleteChatAsync(
    new UserChatMessage("Hi! Can I call you Kevin?")
);
var chatContent = chatResult.GetContent().ToList();

var embeddingProvider = provider.GetRequiredService<EmbeddingProvider>();
var embedding = await embeddingProvider.GenerateEmbeddingAsync("Hello World!");

Version Highlights

The main hihglights in the published versions are outlined below.

v1.0.0-beta.5

  • Refactored the embedding aggregation logic into a service to enable you to customize aggregation logic.
  • Implemented a WeightedAverageEmbeddingAggregator service that aggregates embeddings using a weighted average approach based on the number of tokens consumed by each chunk.
  • The WeightedAverageEmbeddingAggregator is the default aggregator used by the EmbeddingProvider if no other aggregator is configured.

v1.0.0-beta.4

  • Changed service registration so that models registered without a key also registers associated services without a key instead of registering them with the model deployment name as key.
  • Changed EmbeddingResponse.Embedding to EmbeddingResponse.Vector.

v1.0.0-beta.3

  • Added DeploymentName property to the EmbeddingProvider and ChatProvider classes, which returns the name of the model deployment used by the provider.

v1.0.0-beta.2

  • Fixed a typo in the readme file.

v1.0.0-beta.1

The initial version of the library includes the following features.

  • A text chunking service that chunks text into smaller pieces.
  • An EmbeddingProvider service class for working with embeddings.
  • The EmbeddingProvider service uses a configured text chunking service to break up text into smaller chunks.
  • Combines embeddings generated from the text chunks into a single embedding using a weighted average approach where the total number of tokens consumed by each chunk is used as the weight.
  • A ChatProvider service class for working with chat completions.
  • Dependency injection support for easy configuration of both embedding models and chat completion models.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.0.0-beta.5 95 8/16/2025
1.0.0-beta.4 42 8/16/2025
1.0.0-beta.3 45 8/16/2025
1.0.0-beta.2 44 8/16/2025
1.0.0-beta.1 46 8/16/2025