StreamCacheRouting class final
Per-call prompt-cache routing overrides, consulted by the provider
stream functions built with providerStreamFunction.
The StreamFunction contract has no options slot, so per-call routing
(pi's sessionId/cacheRetention stream options) travels in a zone:
runWith installs values for every provider call started inside its
body — including async work such as fallback-chain attempts, which run
in the zone they were created in. Adapters read current when a call
starts; a null field keeps the call's own defaults.
Used by compaction summarization, which forces cacheRetention: 'none'
plus a fresh routing session id so summaries never pollute the session's
prompt-cache accounting (pi's callCompleteSimple).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
Static Methods
-
runWith<
T> (T body(), {String? sessionId, String? cacheRetention}) → T -
Runs
bodywithsessionId/cacheRetentionoverriding the cache routing of provider calls started inside it. An override is explicit: code that binds default routing values (the model-roles resolver) yields to an active override instead of replacing it.