ESM
import { sendTraceMessage, sendUXSuggestion } from "@arcgis/ai-components/orchestrator/signals.js";

Functions

sendTraceMessage

Function

Sends a progress or diagnostic message from agent execution to the assistant log. Use it to describe actions taken or report execution status. The assistant displays the message when its logEnabled property is enabled.

Signature
sendTraceMessage (data: TraceEventData, config?: RunnableConfig): Promise<void>

Parameters

ParameterTypeDescriptionRequired
data

Trace event data to display in the chat log, including the message, agent, and tool if applicable.

config
RunnableConfig

Optional runnable configuration as defined in LangChain, which can include additional context or variables to associate with the trace message.

Returns
Promise<void>

A promise that resolves once the event has been dispatched.

sendUXSuggestion

Function

Sends a structured UI suggestion from agent execution to the assistant component. Use it to suggest follow-up prompts or slot custom content, such as a web component, to complement an agent's response. The assistant renders the built-in text and suggested-prompts types; custom block types need application-provided rendering.

See also
Signature
sendUXSuggestion (suggestion: UXSuggestion, config?: RunnableConfig): Promise<void>

Parameters

ParameterTypeDescriptionRequired
suggestion

The UX suggestion payload.

config
RunnableConfig

Runnable LangChain config to pass through to the dispatcher.

Returns
Promise<void>

A promise that resolves once the suggestion has been dispatched.

Type definitions

TraceEventData

Type definition

Data for a progress or diagnostic message emitted during agent execution.

text

Property
Type
string

Text supplied by the agent or tool for the trace message, typically a progress update or diagnostic detail.

agentName

Property
Type
string | undefined

Optional name of the agent associated with this trace message.

toolName

Property
Type
string | undefined

Optional name of the tool associated with this trace message.

UXSuggestion

Type definition

A structured response block emitted by an agent that provides a suggestion to render a component in the assistant component. The application developer has the option to render the suggested content by listening to the assistant's arcgisSlottableRequest event.

type

Property
Type
string

The suggested UI type, which determines how the application can interpret and render the data. This type can help establish a contract between the application and agents on how to render custom content in agent responses.

data

Property
Type
Record<string, unknown> | undefined

Additional data that indicates what to render in the custom content. For example, if the suggested component to render is arcgis-directions, the data may be an object that includes the starting and ending points for the directions.