Skip to content

v2.0.0

Choose a tag to compare

@devlooped-bot devlooped-bot released this 11 Mar 14:45
· 49 commits to main since this release

v2 is a significant release with breaking changes across the entire library. The changes focus on
improved extensibility for chat client creation, namespace reorganization of provider-specific
types, and removal of components that are no longer needed.

Breaking Changes

ExtendedChatOptions removed

ExtendedChatOptions (and its ReasoningEffort/Verbosity properties) has been removed from
Devlooped.Extensions.AI. Provider-specific options now live in their own namespaces.

Before:

using Devlooped.Extensions.AI;

options.ReasoningEffort = ReasoningEffort.High;
options.Verbosity = Verbosity.Medium;

After (OpenAI-specific):

using Devlooped.Extensions.AI.OpenAI;

options.Verbosity = Verbosity.Medium;
// using built-in MS.E.AI API for reasoning effort:
options.Reasoning = new ReasoningOptions { Effort = ReasoningEffort.High };

Verbosity moved to Devlooped.Extensions.AI.OpenAI, ReasoningEffort removed

Both types have been moved out of the root namespace and into Devlooped.Extensions.AI.OpenAI.
ReasoningEffort has been removed entirely. Verbosity is now an OpenAI-specific concept
surfaced via OpenAIChatOptions.

The official MS.E.AI API now exposes Reasoning options out of the box at the ChatOptions level.

ChatExtensions no longer exposes ReasoningEffort/Verbosity extension properties

Only Verbosity is now an extension property on ChatOptions exposed by OpenAIExtensions in
Devlooped.Extensions.AI.OpenAI.

OpenAIChatClient, AzureOpenAIChatClient, and AzureInferenceChatClient removed

The three concrete chat client wrapper classes in Devlooped.Extensions.AI.OpenAI have been
removed from the public API surface. Client creation is now handled by the new factory/provider
model (see below).

WebSearchTool moved to Devlooped.Extensions.AI.OpenAI

WebSearchTool has moved from Devlooped.Extensions.AI to Devlooped.Extensions.AI.OpenAI
and its constructor parameter is now optional (string? country = null). The City, Region,
TimeZone, and a new AllowedDomains property are now first-class properties on the type
instead of extension properties. OpenAIWebSearchToolExtensions has been removed.

Before:

using Devlooped.Extensions.AI;
using Devlooped.Extensions.AI.OpenAI;

var tool = new WebSearchTool("US");
tool.City = "Seattle";
tool.Region = "WA";

After:

using Devlooped.Extensions.AI.OpenAI;

var tool = new WebSearchTool("US")
{
    City = "Seattle",
    Region = "WA",
    AllowedDomains = ["example.com"]
};

JsonConsoleOptions, JsonConsoleLoggingExtensions, and related types removed

JsonConsoleOptions and the UseJsonConsoleLogging extensions (both for ChatClientBuilder and
ClientPipelineOptions) have been removed from the library into their own separate package
(Devlooped.Extensions.AI.Console).

ConfigurableChatClient.Options property removed; constructor changed

The object? Options property has been removed from ConfigurableChatClient. The constructor
now accepts an explicit configure callback parameter rather than deriving configuration from
the Options property.

AddChatClients gains a useDefaultProviders parameter

The AddChatClients extension methods on IServiceCollection and IHostApplicationBuilder now
have an additional bool useDefaultProviders = true parameter. This is a source-compatible
addition but callers passing arguments by position should verify their call sites.


New Features

Factory/Provider model for chat client creation (IChatClientFactory, IChatClientProvider, ChatClientFactory)

v2 introduces a first-class extensibility model for how IChatClient instances are resolved
from configuration. The three key types are:

  • IChatClientProvider — implement this to support a new AI provider. Exposes ProviderName,
    BaseUri, HostSuffix, and a Create(IConfigurationSection) method.
  • IChatClientFactory — takes a collection of IChatClientProvider instances and resolves
    the right one for a given configuration section.
  • ChatClientFactory — the default implementation. Override ResolveProvider or
    MatchesBaseUri to customise resolution logic. Use ChatClientFactory.CreateDefault() to
    get a factory pre-loaded with the built-in providers.

ChatClientFactoryExtensions — DI registration helpers

New extension methods on IServiceCollection and IHostApplicationBuilder for registering the
factory and providers:

// Register the factory (and built-in providers) in the DI container
builder.AddChatClientFactory();

// Register a custom provider by name (and optional base URI / host suffix)
services.AddChatClientProvider("myprovider", new Uri("https://api.myprovider.com"),
    section => new MyProviderChatClient(section["apiKey"]!, section["model"]!));

// Register a typed provider
services.AddChatClientProvider<MyTypedProvider>();

Chat static factory for ChatMessage

A new Chat class provides concise static factory methods for constructing ChatMessage objects:

using static Devlooped.Extensions.AI.Chat;

var messages = new[]
{
    System("You are a helpful assistant."),
    User("What is the weather in Seattle?"),
    Assistant("It is currently 58°F and cloudy."),
    Developer("Internal note: user is in PST."),
};

OpenAIChatOptions

A new OpenAIChatOptions class in Devlooped.Extensions.AI.OpenAI groups OpenAI-specific chat
options (currently Verbosity) in a single place, consistent with how options are structured
for other providers.

WebSearchTool.AllowedDomains

The moved WebSearchTool now exposes an AllowedDomains property (string[]?) for restricting
search results to specific domains.

What's Changed

✨ Implemented enhancements

  • Update with latest reasoning features from GPT 5.2 by @kzu in #199
  • Make it possible to construct the raw completion request from gRPC by @kzu in #201
  • Add helper factory methods to Chat by @kzu in #204
  • Refactor: introduce provider/factory model for chat clients by @kzu in #210
  • Internalize IChatClient implementations and auto-configure RawRepresentationFactory by @Copilot in #214
  • Refactor WebSearchTool and move to OpenAI namespace by @kzu in #215
  • Refactor: update to new OpenAI SDK & provider model by @kzu in #228
  • Add Developer factory to Chat by @kzu in #229

🔨 Other

  • Run AI tests in CI too by @kzu in #198
  • Remove unused upstream file by @kzu in #200
  • Replace Extensions.Grok project with xAI nuget package by @Copilot in #212
  • Remove Agents folder which is now in another repo by @kzu in #216
  • Extract console logging into Devlooped.Extensions.AI.Console (JSON only) by @Copilot in #224

Full Changelog: v1.0.0...v2.0.0

Sponsors

The following sponsors made this release possible: @clarius, @MFB-Technologies-Inc, @sandrock, @drivenet, @Keflon, @tbolon, @kfrancis, @unoplatform, @rbnswartz, @jfoshee, @Mrxx99, @eajhnsn1, @Jonathan-Hickey, @KenBonny, @SimonCropp, @agileworks-eu, @arsdragonfly, @vezel-dev, @ChilliCream, @4OTC, @DominicSchell, @adalon, @Eule02, @torutek, @mccaffers, @SeikaLogiciel, @wizardness.

Thanks 💜