▾
import { createAgentRuntimeState } from "@arcgis/ai-components/orchestrator/state/runtime.js";Creates custom agent graph state.
Functions
createAgentRuntimeState
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Creates the standard state definition for a graph-based custom agent registered with the assistant. It includes fields for execution context, output, summary, status, shared-state updates, and shared-resource additions, so add only the fields specific to your agent. The function returns definitions, not initialized values.
- Signature
-
createAgentRuntimeState <TState extends Record<string, unknown> = Record<string, unknown>>(): AgentBaseState<TState>
- Returns
- AgentBaseState
Type definitions
AgentBaseState
Standard state fields provided by createAgentRuntimeState for a graph-based custom agent.
agentExecutionContext
- Type
- BaseChannel<AgentExecutionContext<SharedState
>, unknown, unknown>
Context available to graph nodes during a run, including the request, assigned task, message history, prior steps, and shared state and resources.
status
- Type
- BaseChannel<AgentStatus | undefined, unknown, unknown>
Execution status returned by the graph: success, failed, or unknown. Missing or invalid values are treated
as unknown by the assistant.
sharedStatePatch
- Type
- BaseChannel<SharedStatePatch
| undefined, unknown, unknown>
Partial shared-state update returned by the graph. The assistant applies valid entries and records the agent and update time.
sharedResourceAdditions
- Type
- BaseChannel<readonly SharedResourceInput[] | undefined, unknown, unknown>
Resources returned by the graph for sharing with subsequent agents. The assistant validates additions and assigns each resource its identity and creation metadata.