Skip to content

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 03 Oct 23:38
· 3 commits to master since this release
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