Repository navigation
v1.2.0
Added
AIModel.Capabilitiesis nowEModelCapability?(nullable). Three states:nullmeans the provider did not report capabilities (unknown);EModelCapability.Nonemeans the provider reported having none; any other value means the provider reported exactly those flags. A newProtocolParsingHelpers.ParseCapabilitieshelper reads capabilities from a model JSON element using a configurable dotted path and format (arrayorflags-string)- Optional decision-model capability via
IDecisionProvider(SupportsDecisions,DecideAsync): a provider answers typed questions about application state with probabilities rather than chat prose. SupportsChoice,Noul(yes/no), andScorequestion kinds with typed answers (ChoiceAnswer,NoulAnswer,ScoreAnswer), a newEProviderProtocol.Decisionwire protocol (JSON value"decision"), anEModelCapability.Decisionflag for call-free discovery,DecisionProviderOptions(configurablealpha/decisionsendpoint and optional decisions base-URL override), and dedicated error codes (ai/chat-not-supported,ai/decision-not-supported). A decision provider rejectsChatAsync; 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
AdditionalQueryParameteronEndpointDefinition: 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
endpointsblock onProviderDefinitionfor multi-protocol providers: each entry (keyschat,models,messages,embeddings,decisions, matched case-insensitively) carries a relativepath, an optionalbaseUrloverride used only when the surface sits on a different root than the definition's common base, and an optionalprotocoloverride with nullable-aware JSON conversion. Endpoint paths, andbaseUrloverrides fordecisionsandembeddings, fold into the named options at registration time with a documented precedence (defaults, flat field,endpointsentry, consumerConfigure), and malformed entries (unknown operation key, absolute path, non-HTTPS override, an entry that changes nothing, an unservabledecisionsoverride, or a KeyQuerychatpath without a{model}placeholder) fail registration fast. AnOpenAICompatible/HybridGatewayprovider declaring adecisionsentry withprotocol: "decision"registers the combinedOpenAICompatibleDecisionProvider— one provider id serving chat, streaming, model discovery, embeddings, and decisions — and the model-override decorator chain stays capability-transparent for it
Fixed
AIModel.Capabilitiesis now nullable (EModelCapability?) so "not reported" (null) is distinguished from "reported as having none" (None). Previously every discovered model carriedNone, which the type could not distinguish from an explicit negative — a consumer checkingHasFlag(ToolCalling)sawfalsefor every model without knowing whether the provider had spoken. TheModelOverrideMergermerge 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:
EModelCapabilityis described as what a model may be asked to do, distinct fromAIModel.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 —Nonemeans nothing was said, not that the model cannot do it — and that consumers declare the flags they rely on throughModelOverride.Capabilities, replacing a publishedHasFlag(EModelCapability.ToolCalling)example that returnedfalsefor every discovered model without any warning.Decisionis 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 rawUriFormatExceptionfrom request construction, upholding the contract that every provider failure surfaces as anAiExceptionacross chat, model discovery, streaming, and embeddings; well-formed absolute URLs are unaffected - Model discovery now honors a provider's
capabilitiesPath/capabilitiesFormatprotocol configuration: the Catalog, KeyQuery, Messages API, and OpenAI-compatible discovery mappers read each model's reported capabilities intoAIModel.Capabilities— an explicitly empty reported array yieldsEModelCapability.None, while an unconfigured or absent path leaves itnull(unreported). Previously theProtocolParsingHelpers.ParseCapabilitieshelper existed but was never invoked by discovery, so models arrived withCapabilities = nullregardless of configuration
Full Changelog: v1.1.0...v1.2.0