AgentSdkSessionProvider class final
Anthropic, reached indirectly through whichever transport was selected.
- Inheritance
-
- Object
- LlmProvider
- AgentSdkSessionProvider
Constructors
- AgentSdkSessionProvider({required AgentSdkTransportSelector selector, String? systemPrompt, String? model, bool agentToolsEnabled()?, Duration stallGap = defaultAiStallTimeout, required AgentSdkSessionManager sessions, required String toolServerName})
-
const
Properties
- agentToolsEnabled → bool Function()?
-
The agent-tools switch, read live — null for a build
that has no such setting, which is the switch on.
final
- capabilities → LlmCapabilities
-
The active transport's capabilities, or LlmCapabilities.none when
there is none — so a UI that reads capabilities before checking
availability still gets a correct "nothing is offered" answer.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The provider's name; a run's report names the transport that served it.
no setteroverride
- isAvailable → bool
-
The availability gate, delegated to the selector. Free to read; see
AgentSdkTransportSelector.
no setteroverride
- model → String?
-
An optional model override; null means the transport's default.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selector → AgentSdkTransportSelector
-
Owns the availability verdict and the active transport.
final
- sessions → AgentSdkSessionManager
-
The sessions every run is served from: the agent run in
chat, the actions indefault, each in its own isolate.final - stallGap → Duration
-
The liveness bound: the longest silence a completion may
contain before it is abandoned as
LlmErrorKind.timeout.
final
- systemPrompt → String?
-
An optional system prompt sent with every completion. Feature-supplied
configuration, never document-derived.
final
- toolServerName → String
-
The in-process MCP server a request's tools are declared on; the model
sees each tool as
mcp__<toolServerName>__<tool>.final - trails → LlmTrails
-
The sessions' consolidated trails, for the trail view.
no setteroverride
-
The selector's retained explanation, so a disabled affordance can say why.
no setteroverride
Methods
-
complete(
LlmRequest request) → Future< LlmCallReport> -
The report of
request's run. Throws an LlmTransportException when the run failed, carrying the provider's sentence.inherited -
embed(
String text) → Future< List< double> > -
Anthropic exposes no embeddings API, so this provider never supports
embedding and semantic search degrades to lexical for as long as
no transport embeds. Throwing UnsupportedError is the port's contract for a
capability the provider does not have.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
LlmRequest request) → Stream< LlmEvent> -
The run: served from the request's session, where the
transport's events are bounded by stallGap (see boundedAiRun) and
streamed back here. Throws LlmSessionBusyException when that
session already has a run. Cancelling the stream cancels the run.
complete is derived from this.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited