Skip to content

Releases

v1.3.2

Choose a tag to compare

@github-actions github-actions released this 18 Oct 20:52
1b8fd78

Fixed

  • OpenAI-compatible chat requests no longer send an unset max_tokens, response_format, or tools as null; the keys are now omitted. Hosts that dereference a present response_format (LM Studio) refused every chat, streaming, and read-out decision request with HTTP 400 Cannot read properties of null (reading 'type'). Set values are sent unchanged

Full Changelog: v1.3.1...v1.3.2

v1.3.1

Choose a tag to compare

@github-actions github-actions released this 18 Oct 19:28
b3a98ba

Fixed

  • An HTTP error whose body is a flat { "error": "text" } value or a bare JSON string no longer crashes with InvalidOperationException while the failure report is built; it now surfaces as the usual AiException with its status classification, and the provider's text is appended to the message. Any other body that is not an object, or whose error is neither an object nor a string, yields the plain status line. Bodies that were reported correctly before are unchanged

Full Changelog: v1.3.0...v1.3.1

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 14:13
07e5a4e

Added

  • Decisions are now a capability of every provider, not a separate provider family: any chat-capable provider that declares no native decisions surface answers IDecisionProvider.DecideAsync through a read-out over its own chat surface — one chat turn per question, the option tokens' logprobs read from the response, with distinct token variants of one option combined and a repeated token counted once, then renormalised with softmax. IDecisionProvider.DecisionSource and the new EDecisionSource enum report the mechanism (Readout or Native), and the model-override decorators forward it, so is IDecisionProvider and DecisionSource stay accurate after decoration; decorator selection also keeps is IEmbeddingProvider honest in both directions — an embedding-capable provider keeps that capability after decoration, and a provider without an embeddings surface is never wrapped in a decorator that claims one
  • ChatCompletionRequest.Logprobs / TopLogprobs and ChatCompletionResponse.Logprobs expose token log probabilities, with the new ChatContentLogprobs, ChatTokenLogprob, and ChatTopLogprob models. Mapped on the OpenAICompatible/HybridGateway and KeyQuery wires; a protocol whose API carries no logprob field leaves the block null rather than inventing a distribution
  • Read-out configuration on AIProviderOptions: DecisionReadoutEnabled (default true; false restores the ai/decision-not-supported refusal), DecisionReadoutPromptTemplate (placeholders {state}, {instructions}, {options}), DecisionReadoutOptionTokenStyle (uppercaseLetter, lowercaseLetter, levelIndex), DecisionReadoutTopLogprobs (default 20, also the read-out's option ceiling), DecisionReadoutBoolTokens (default yes,no), DecisionReadoutTemperature (default 0), and DecisionsMaxOptions (a declared Choice-option ceiling for both transports). Each is also seedable from a definition's protocolConfiguration, and both ceilings refuse with ai/configuration-error before any request leaves the process
  • Two error codes for a read-out that cannot produce a distribution: ai/decision-readout-unavailable (the chat response carried no logprobs block) and ai/decision-readout-unreadable (none of the declared option tokens appeared among the reported alternatives)
  • EProviderProtocol.DecisionReadout (JSON "decisionReadout") as an endpoints["decisions"] override that explicitly declares the read-out on a chat-capable root; a DecisionReadout entry on a root with no chat surface is rejected at registration
  • AIProviderServiceCollectionExtensions.SeedFromDefinition(AIProviderOptions, ProviderDefinition) is now public, so a provider registered through AddProvider<TProvider> gets the same definition seeding as a built-in protocol — base URL, endpoint paths, requiresApiKey, the read-out members, and protocolConfiguration. A Native-id provider is skipped by the automatic registration loop, so its own factory is the only place the definition can be applied

Changed

  • Decision support is a default capability of AIProviderBase: SupportsDecisions and DecideAsync are virtual members whose default body is the chat read-out, while DecisionProvider and OpenAICompatibleDecisionProvider override them and report EDecisionSource.Native. A consumer that read is IDecisionProvider as "this is a decision model" now gets true for every chat-capable provider — check DecisionSource or SupportsDecisions instead. Only a Decision-rooted provider still refuses ChatAsync with ai/chat-not-supported, and a chat-capable provider no longer refuses decisions for lack of a decisions declaration
  • A loopback base URL may now use plain http: request pre-flight and endpoints validation accept http://localhost, http://127.0.0.1, and http://[::1], while routable hosts still require HTTPS
  • API-key requirements resolve in three layers: AIProviderOptions.RequiresApiKey, then ProviderDefinition.RequiresApiKey (new JSON field requiresApiKey), then a value derived from the configured address — a loopback host requires none. IAIProvider.RequiresApiKey exposes the effective value without a cast, and the per-call check re-derives it from an overridden address

Full Changelog: v1.2.0...v1.3.0

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 03 Oct 23:38
0165d73

Added

  • AIModel.Capabilities is now EModelCapability? (nullable). Three states: null means the provider did not report capabilities (unknown); EModelCapability.None means the provider reported having none; any other value means the provider reported exactly those flags. A new ProtocolParsingHelpers.ParseCapabilities helper reads capabilities from a model JSON element using a configurable dotted path and format (array or flags-string)
  • Optional decision-model capability via IDecisionProvider (SupportsDecisions, DecideAsync): a provider answers typed questions about application state with probabilities rather than chat prose. Supports Choice, Noul (yes/no), and Score question kinds with typed answers (ChoiceAnswer, NoulAnswer, ScoreAnswer), a new EProviderProtocol.Decision wire protocol (JSON value "decision"), an EModelCapability.Decision flag for call-free discovery, DecisionProviderOptions (configurable alpha/decisions endpoint and optional decisions base-URL override), and dedicated error codes (ai/chat-not-supported, ai/decision-not-supported). A decision provider rejects ChatAsync; per-request credentials, retry, and error classification behave as they do for chat
  • UsageInfo.Cost (USD, nullable) reports a per-call cost when the provider returns one; existing protocols leave it unset
  • Optional AdditionalQueryParameter on EndpointDefinition: an opaque query parameter (e.g. output_modalities=all) that a provider's models-endpoint entry can declare so model discovery returns the provider's full catalog instead of a default-filtered subset. The seeding step appends ?{value} to the models-endpoint path; providers that declare nothing keep byte-identical URLs. Validation rejects values starting with ? or containing an unencoded # or space
  • Optional per-operation endpoints block on ProviderDefinition for multi-protocol providers: each entry (keys chat, models, messages, embeddings, decisions, matched case-insensitively) carries a relative path, an optional baseUrl override used only when the surface sits on a different root than the definition's common base, and an optional protocol override with nullable-aware JSON conversion. Endpoint paths, and baseUrl overrides for decisions and embeddings, fold into the named options at registration time with a documented precedence (defaults, flat field, endpoints entry, consumer Configure), and malformed entries (unknown operation key, absolute path, non-HTTPS override, an entry that changes nothing, an unservable decisions override, or a KeyQuery chat path without a {model} placeholder) fail registration fast. An OpenAICompatible/HybridGateway provider declaring a decisions entry with protocol: "decision" registers the combined OpenAICompatibleDecisionProvider — one provider id serving chat, streaming, model discovery, embeddings, and decisions — and the model-override decorator chain stays capability-transparent for it

Fixed

  • AIModel.Capabilities is now nullable (EModelCapability?) so "not reported" (null) is distinguished from "reported as having none" (None). Previously every discovered model carried None, which the type could not distinguish from an explicit negative — a consumer checking HasFlag(ToolCalling) saw false for every model without knowing whether the provider had spoken. The ModelOverrideMerger merge rule (override ?? target) carries the three states through transparently. Documentation and IntelliSense now describe the three states explicitly
  • Documentation and IntelliSense no longer conflate capabilities with modalities: EModelCapability is described as what a model may be asked to do, distinct from AIModel.Modality (which data types flow in and out), with the rule that a modality never implies a capability. Both now state that model discovery reports no capability flags — None means nothing was said, not that the model cannot do it — and that consumers declare the flags they rely on through ModelOverride.Capabilities, replacing a published HasFlag(EModelCapability.ToolCalling) example that returned false for every discovered model without any warning. Decision is now listed with the other capability members
  • A call whose effective base URL is not a valid absolute URL — a typo, or a per-request/options override that omits the scheme — now fails with AiException (ai/invalid-request) before the request is sent instead of leaking a raw UriFormatException from request construction, upholding the contract that every provider failure surfaces as an AiException across chat, model discovery, streaming, and embeddings; well-formed absolute URLs are unaffected
  • Model discovery now honors a provider's capabilitiesPath/capabilitiesFormat protocol configuration: the Catalog, KeyQuery, Messages API, and OpenAI-compatible discovery mappers read each model's reported capabilities into AIModel.Capabilities — an explicitly empty reported array yields EModelCapability.None, while an unconfigured or absent path leaves it null (unreported). Previously the ProtocolParsingHelpers.ParseCapabilities helper existed but was never invoked by discovery, so models arrived with Capabilities = null regardless of configuration

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 00:30
cdd9724

Added

  • Optional embeddings capability via IEmbeddingProvider with OpenAI-compatible /embeddings wire mapping, separate DefaultEmbeddingModel configuration, and dedicated error codes (ai/embedding-failed, ai/embedding-model-not-configured)
  • Per-request (runtime) credential and model resolution: the RequestCredentials record (key-masked ToString) and the ICredentialResolver hook let a consumer supply an API key, base URL, and model per call — across chat, streaming, model discovery, and embeddings — without rebuilding the DI graph or leaving the singleton provider behind. Resolution priority is GetProvider overrides > ICredentialResolver > configured options
  • IAIProviderFactory.GetProvider(providerId, RequestCredentials overrides) returns a transient provider bound to the supplied overrides; the shared singleton resolved by GetProvider(providerId) is never mutated. A provider id that has model-override entries is decorated, and the decorator exposes no embeddings through either overload
  • AddAiProviders(b => b.UseCredentialResolver(resolver)) registers a consumer-supplied ICredentialResolver (the library ships no default implementation)

Changed

  • AIProviderOptions.DefaultModel is now applied at runtime as the fallback model when a request carries no model and no per-call override supplies one; it was previously inert. An empty effective chat model now throws AiException with ai/invalid-request
  • Provider configuration is validated against the effective values (per-call override combined with configured options) before the model is resolved, so a provider configured with an empty API key or base URL completes a call once an override supplies the missing value, still fails when nothing does, and keeps reporting the actionable configuration error when the request also carries no model
  • IAIProviderFactory gains the GetProvider(providerId, RequestCredentials) member — a breaking change for consumers who implement IAIProviderFactory themselves, who must now also implement the new overload

Full Changelog: v1.0.0...v1.1.0

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 25 Sep 21:50

Added

  • Unified IAIProvider interface (ChatAsync) with optional capabilities: IStreamingChatProvider (StreamAsync) and IModelDiscoveryProvider (GetModelsAsync)
  • IAIProviderFactory abstraction for multi-provider scenarios
  • 35+ provider definitions via embedded JSON catalog (ProviderCatalog), served by four protocol implementations
  • OpenAI-compatible wire protocol (OpenAICompatibleWireProtocol, OpenAICompatibleProvider)
  • Messages API wire protocol (MessagesApiProtocol, MessagesApiProvider)
  • Key-query protocol for Google-style APIs (KeyQueryProvider)
  • Model catalog protocol for GitHub Models-style APIs (ModelCatalogProvider)
  • Hybrid gateway protocol (OpenAICompatibleProvider with HybridGatewayProviderOptions)
  • Streaming via IAsyncEnumerable<StreamingChatChunk> with tool-call deltas (StreamingToolCallDelta)
  • Tool / function calling support
  • Structured output via ResponseFormat with JSON schema
  • Structured error handling via AiException with centralized AiErrorCodes, including status-aware messages for common HTTP error codes
  • Single AddAiProviders() DI extension registering every catalog provider with named options per provider ID
  • Named provider options bindable from appsettings.json via Microsoft.Extensions.Options
  • Developer manual published as a documentation site via MkDocs Material and GitHub Pages