import "@arcgis/ai-components/components/arcgis-assistant-help-agent";- Inheritance:
- ArcgisAssistantHelpAgent→
PublicLitElement
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The Help Agent provides contextual assistance and guidance to the end user within an agentic web mapping application. It can provide answers to questions about the web map provided to the referenceElement property and answer questions about other agents included as subcomponents to the arcgis-assistant component.
This is an unrendered component that must be added as a child of the arcgis-assistant component in
either HTML or JavaScript.
<arcgis-map id="my-map"></arcgis-map><arcgis-assistant reference-element="my-map"> <arcgis-assistant-help-agent></arcgis-assistant-help-agent></arcgis-assistant>const assistant = document.querySelector("arcgis-assistant");const helpAgent = document.createElement("arcgis-assistant-help-agent");assistant.appendChild(helpAgent);Once added to the assistant, the agent is loaded and ready to receive user messages related to help and guidance.
Example questions
The following are example questions a user can ask within the bounds of the help agent:
- "What kind of questions can I ask?"
- "What layers are in this map?"
- "What kind of data can I ask questions about?"
The following are examples of the types of questions that fall outside the bounds of the help agent and should therefore be avoided:
- "Search the Esri documentation for ways that I can query my data."
- "Log a bug related to map navigation to the Esri support team."
- "How do I bake a cake?"
- "How does map navigation work in ArcGIS?"
Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the out-of-the-box agents.
Properties
| Property | Attribute | Type |
|---|---|---|
reference-element |
referenceElement
The reference element to the map that provides context for the help agent. Currently,
this is only scoped to arcgis-map elements. This shows the help agent which map for which to
provide assistance. This allows users to ask questions about the specific map provided to the agent.
Setting this property is not necessary if you set the reference element on the parent
arcgis-assistant component.
- Attribute
- reference-element
Example
<arcgis-map id="my-map"></arcgis-map><arcgis-assistant> <arcgis-assistant-help-agent reference-element="my-map"></arcgis-assistant-help-agent></arcgis-assistant>Methods
| Method | Signature |
|---|---|
componentOnReady inherited | componentOnReady(): Promise<this> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
Example
const arcgisAssistantHelpAgent = document.querySelector("arcgis-assistant-help-agent");document.body.append(arcgisAssistantHelpAgent);await arcgisAssistantHelpAgent.componentOnReady();console.log("arcgis-assistant-help-agent is ready to go!");