Repository navigation
Release v7.74.0
Summary
Cratis.AI no longer appends metering readings to your application's event log. Each decision-engine call and each provider usage refresh used to append an event. In a busy application that was thousands of events a day that were not domain facts. Usage is now reported as OpenTelemetry metrics instead.
Changed
- A decision call no longer appends
DecisionUsageRecorded, and a provider usage refresh no longer appendsAIProviderUsageSnapshotRecorded. Decision usage is reported on theCratis.AI.Decisionsmeter: the counterscratis.ai.decision.input_tokens,cratis.ai.decision.output_tokens,cratis.ai.decision.calls,cratis.ai.decision.decisionsandcratis.ai.decision.choices, taggeddecision.engine,modelandtopic. Provider usage is reported on theCratis.AI.Providers.UsageReportingmeter as the gaugecratis.ai.provider.consumed_tokens, taggedproviderandavailability. Add both meters to your OpenTelemetry setup to collect them. (#651) AllAIProviderUsageSnapshotskeeps its name and result shape. It is now served from the in-process usage cache and only returns the providers configured in the current namespace. After a restart it is empty until each provider's usage is refreshed again.DecisionUsageForLastThirtyDaysno longer receives new data, because nothing appendsDecisionUsageRecordedany more.- The constructors of
ProviderUsageLevelsandDecisionUsageRecorderno longer takeICommandPipeline, andIRecentUsageSnapshotshas a newObserve()member. This only matters if you construct these types or implement the interface yourself. - Cratis.AI now depends on Cratis.Fundamentals 7.25.1 (was 7.19.4).
Deprecated
RecordDecisionUsage,DecisionUsageRecorded,DecisionUsageByDay,RecordAIProviderUsageSnapshotandAIProviderUsageSnapshotRecordedare obsolete. They remain so existing event stores still replay, and are removed in the next major release (part of #767).