Coven.Agents.OpenAI 2.0.1

dotnet add package Coven.Agents.OpenAI --version 2.0.1
                    
NuGet\Install-Package Coven.Agents.OpenAI -Version 2.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="Coven.Agents.OpenAI" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Coven.Agents.OpenAI" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Coven.Agents.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 Coven.Agents.OpenAI --version 2.0.1
                    
#r "nuget: Coven.Agents.OpenAI, 2.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.
#:package Coven.Agents.OpenAI@2.0.1
                    
#: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=Coven.Agents.OpenAI&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Coven.Agents.OpenAI&version=2.0.1
                    
Install as a Cake Tool

Coven.Agents.OpenAI

OpenAI agent integration (official .NET SDK). Registers journals, gateway/session, transmuters, and optional streaming/windowing.

What’s Inside

  • Config: OpenAIClientConfig (API key, model, optional org/project; reasoning options).
  • Registration: AddOpenAIAgents(config, registration => ...).
  • Gateways: request vs streaming connections.
  • Journals: IScrivener<AgentEntry>, IScrivener<OpenAIEntry>.
  • Transmuters: OpenAITransmuter (OpenAI↔Agent), OpenAIEntryToResponseItemTransmuter (templating), OpenAIResponseOptionsTransmuter.
  • Windowing: default policies for response chunks and thought chunks when streaming is enabled.
  • Daemons: OpenAIAgentDaemon and windowing daemons (when streaming).

Quick Start

using Coven.Agents.OpenAI;

OpenAIClientConfig cfg = new()
{
    ApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!,
    Model  = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-5-2025-08-07",
};

services.AddOpenAIAgents(cfg, registration =>
{
    registration.EnableStreaming(); // optional, enables windowing daemons
});

Override Policies (Streaming)

using Coven.Core.Streaming;
using Coven.Agents;

// Response chunks: paragraphs OR soft cap
services.AddScoped<IWindowPolicy<AgentAfferentChunk>>(_ =>
    new CompositeWindowPolicy<AgentAfferentChunk>(
        new AgentParagraphWindowPolicy(),
        new AgentMaxLengthWindowPolicy(4096)));

// Thought chunks: summary marker OR soft cap
services.AddScoped<IWindowPolicy<AgentAfferentThoughtChunk>>(_ =>
    new CompositeWindowPolicy<AgentAfferentThoughtChunk>(
        new AgentThoughtSummaryMarkerWindowPolicy(),
        new AgentThoughtMaxLengthWindowPolicy(4096)));

Templating (Optional)

Provide an ITransmuter<OpenAIEntry, ResponseItem?> to inject context (usernames, system preamble, etc.). See sample DiscordOpenAITemplatingTransmuter in src/samples/01.DiscordAgent.

Requirements

  • Valid OpenAI API key and model name for your account.
  • Network egress to OpenAI endpoints.

See Also

  • Branch: Coven.Agents.
  • Architecture: Abstractions and Branches; Windowing and Shattering.
Product Compatible and additional computed target framework versions.
.NET 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
2.0.1 344 11/11/2025
2.0.0 320 11/11/2025