import type { Interrupt, AssistantMessage, ChatMessage, ChatMessageBase, UserMessage } from "@arcgis/ai-components/components/arcgis-assistant/types.js";Type definitions
Interrupt
An interrupt is a UI mechanism used by an agent to prompt the user for additional input or clarification.
type
- Type
- "boolean-choice" | "multi-select" | "single-select" | "text-input"
The type of interrupt, which determines how the assistant will prompt the user for input. The available types are:
boolean-choice: Presents the user with a yes/no question.multi-select: Allows the user to select multiple options from a list using a checkbox interface.single-select: Allows the user to select a single option from a list using a radio button interface.text-input: Prompts the user to enter free-form text input.
The assistant will use the specified type to determine how to display the prompt and collect the user's response.
For example, a boolean-choice interrupt might be used to confirm an action, while a text-input
interrupt could be used to ask for more details about a request.
message
The message to display to the user when prompting for input. This should provide clear instructions or questions related to the interrupt, guiding the user on what information is needed or what action they should take in response to the prompt.
For example, if the interrupt type is boolean-choice, the message might be "Do you want to proceed with this
action?" If the type is text-input, the message could be "Please provide more details about your request."
options
The options to present to the user for selection when the interrupt type is multi-select or single-select.
This should be an array of strings representing the available choices. For boolean-choice,
the options are implicitly "Yes" and "No" and do not need to be provided.
For text-input, options are not applicable and should be omitted.
For example, if the interrupt type is multi-select, the options might be ["Option 1", "Option 2", "Option 3"].
If the type is single-select, the options could be ["Choice A", "Choice B", "Choice C"].
AssistantMessage
A chat message sent by the assistant.
- Supertypes
- ChatMessageBase
log
Log messages related to the assistant's processing of the user's request. This can include information about the agents or tools it invoked, the parameters generated by the LLM, and any relevant details about how it arrived at its response. Log messages are primarily intended for debugging and transparency purposes, allowing developers and users to understand the assistant's behavior and decision-making process.
ChatMessage
A chat message from the user or the assistant. Messages include all relevant information such as content, logs, errors, and feedback.
- Type
- AssistantMessage | UserMessage
ChatMessageBase
The base interface for chat messages exchanged between the user and the assistant.
id
- Type
- string
The unique identifier for the message. This is used to associate messages with interrupts and feedback. If not provided, a unique ID will be generated automatically.
UserMessage
A chat message sent by the user.
- Supertypes
- ChatMessageBase
content
- Type
- string
The content of the user's message. This is the text input provided by the user in the chat interface. This content is sent to the assistant and its agents for processing and generating responses.