Cisharpai.Rag.OpenAi 0.4.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cisharpai.Rag.OpenAi --version 0.4.0
                    
NuGet\Install-Package Cisharpai.Rag.OpenAi -Version 0.4.0
                    
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="Cisharpai.Rag.OpenAi" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cisharpai.Rag.OpenAi" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Cisharpai.Rag.OpenAi" />
                    
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 Cisharpai.Rag.OpenAi --version 0.4.0
                    
#r "nuget: Cisharpai.Rag.OpenAi, 0.4.0"
                    
#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 Cisharpai.Rag.OpenAi@0.4.0
                    
#: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=Cisharpai.Rag.OpenAi&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Cisharpai.Rag.OpenAi&version=0.4.0
                    
Install as a Cake Tool

Cisharpai.Rag.OpenAi

Bridge package that adds OpenAI hosted retrieval (file_search via the Responses API) to Cisharpai. Install this alongside Cisharpai.OpenAi, not instead of it.

using Cisharpai.OpenAi;
using Cisharpai.Rag;
using Cisharpai.Rag.OpenAi;

// Register both the OpenAI chat client and hosted retrieval:
services.AddOpenAiClient(opt =>
{
    opt.ApiKey = "sk-...";
    opt.DefaultModel = "gpt-4o";
});

services.AddOpenAiHostedRetrieval(opt =>
{
    opt.ApiKey = "sk-...";
    opt.DefaultModel = "gpt-4o";
});

Once registered, discover the feature through the standard Features.Get<T>() pattern and obtain an IRetriever bound to a specific vector store:

var feature = chatClient.Features.Get<IHostedRetrievalFeature>()!;
IRetriever retriever = feature.ForStore("vs_my_store");

IReadOnlyList<ScoredChunk> results = await retriever.RetrieveAsync("search query", topK: 5);

Each ForStore call returns an independent, thread-safe IRetriever. Consumers that need only retrieval depend on IRetriever directly and can swap implementations (hosted, BM25, hybrid) by changing a DI registration.

This package references both Cisharpai.OpenAi and Cisharpai.Rag, keeping the OpenAI provider package free of any RAG dependency for users who do not need retrieval.

See the RAG usage guide for vector store management, file upload, and configuration details.

Product 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.  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 is compatible.  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. 
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.5.0-alpha.16.404 51 9/27/2026
0.5.0-alpha.12.396 52 9/22/2026
0.5.0-alpha.8.391 56 9/21/2026
0.5.0-alpha.4.386 48 9/21/2026
0.4.0 100 9/20/2026
0.4.0-PullRequest81.41.376 59 9/16/2026
0.4.0-PullRequest81.36.378 55 9/16/2026
0.4.0-PullRequest81.36.377 49 9/16/2026
0.4.0-alpha.35.380 56 9/16/2026
0.4.0-alpha.34.368 59 9/15/2026