@arcgis/ai-components 5.1.0-next.109 → 5.1.0-next.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{SXMUM7V7.js → 5GV3OWI2.js} +1 -1
- package/dist/cdn/{ZSABO6TZ.js → 5H7BG46R.js} +17 -17
- package/dist/cdn/{HLQO5XOD.js → BOP6HXCW.js} +1 -1
- package/dist/cdn/{5Q2LHUKO.js → CZFAQXRE.js} +1 -1
- package/dist/cdn/{QJGILG6H.js → ITH2G6QR.js} +1 -1
- package/dist/cdn/JKAITV5Q.js +31 -0
- package/dist/cdn/{3BATZ34V.js → M5ZB2XU3.js} +1 -1
- package/dist/cdn/{F5JLKZGF.js → Q27QDQVP.js} +1 -1
- package/dist/cdn/{PIZXBPBY.js → T6OKBDDT.js} +43 -43
- package/dist/cdn/{QL7OYRRH.js → YQXI4KVT.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +62 -19
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +7 -7
- package/dist/cdn/4QVKWA2Z.js +0 -24
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./T6OKBDDT.js";import a from"./RYEH3CUI.js";import"./HFNOF6ZK.js";import{c as o,d as n}from"./EJWQC2SL.js";import"./47QQSSPB.js";import"./YGW7TUNX.js";import{v as i,y as s}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{fetchKnowledgeGraph:h},,{e:a}])=>{var r=class extends i{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#r;#e;get serviceUrl(){return this.#r}set serviceUrl(e){this.#r=e}async getContext(){let e=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...e,view:this.#t};if(this.#e)try{let t=await this.#e;return{...e,knowledgeGraph:t}}catch(t){console.error("Failed to load knowledge graph via service URL:",t)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(e){e.has("serviceUrl")&&this.serviceUrl?this.#e=h(this.serviceUrl):this.#e=void 0}load(){this.#t=n(this)??void 0,o(this)}};s("arcgis-assistant-knowledge-agent",r);return r},"rest/knowledgeGraphService",a,b)
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{p as s,x as e}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";var a=s(e,{"arcgis-assistant":[()=>import("./R5PFKR6I.js"),"_messages:,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./RACFQ7G7.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./
|
|
2
|
+
import{p as s,x as e}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";var a=s(e,{"arcgis-assistant":[()=>import("./R5PFKR6I.js"),"_messages:,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./RACFQ7G7.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./CZFAQXRE.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./Q27QDQVP.js"),"referenceElement;;getContext"],"arcgis-assistant-knowledge-agent":[()=>import("./YQXI4KVT.js"),"context:,referenceElement,serviceUrl;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./ITH2G6QR.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./5GV3OWI2.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./2TKDD7IY.js"),"loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./KDUG6AWZ.js"),"_messages:,awaitingResponse,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./GHPDN2L7.js"),"_messages:,message,options:,type"],"arcgis-assistant-message":[()=>import("./MM4TFFXX.js"),"copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./ASFDOICU.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./6QA7CIBO.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./QEYLJYK7.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./PYVVZRRJ.js"),"loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./BOP6HXCW.js"),"log:,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./4SZDSAFW.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./M5ZB2XU3.js"),"content"],"arcgis-assistant-speech-input":[()=>import("./RBLFCUDD.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./ZTRICLZY.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./SRNPZKME.js"),"content,message:,user"]});a({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-knowledge-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-message-block,arcgis-assistant-message-feedback,arcgis-assistant-message-footer,arcgis-assistant-message-loading,arcgis-assistant-message-log,arcgis-assistant-message-read-aloud,arcgis-assistant-message-text,arcgis-assistant-speech-input,arcgis-assistant-suggested-prompts,arcgis-assistant-user-message){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e)
|
|
@@ -5,13 +5,24 @@ import type { ArcgisLinkChart as ArcgisLinkChart } from "@arcgis/map-components/
|
|
|
5
5
|
import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/arcgis-map";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* The Knowledge Agent enables the end user to
|
|
9
|
-
*
|
|
8
|
+
* The Knowledge Agent enables the end user to explore knowledge graph data in a [link chart](https://developers.arcgis.com/javascript/latest/references/core/WebLinkChart/), a
|
|
9
|
+
* [knowledge graph service](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/), or a [knowledge graph layer](https://developers.arcgis.com/javascript/latest/references/core/layers/KnowledgeGraphLayer/) in a map via natural language queries. It also provides additional capabilities when used with a knowledge graph layer or link chart. See the list of capabilities below for more details.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The knowledge agent is designed to answer questions about data in the knowledge graph provided by the knowledge graph layer on map,
|
|
12
|
+
* a link chart or a knowledge graph service url, and does not have access to external data sources or the user's location.
|
|
13
|
+
*
|
|
14
|
+
* It cannot create visualizations in the form of charts, layer renderers, new maps, or other visual outputs.
|
|
15
|
+
* When provided a link chart as context, it can create new link charts based on queries generated from user prompts.
|
|
12
16
|
*
|
|
13
|
-
*
|
|
17
|
+
* This agent can add to the knowledge graph data on a map or link chart if a user prompt generates a query that returns entities
|
|
18
|
+
* or relationships from the graph and asks for the returned results to be added to the view.
|
|
19
|
+
* It can also change the layout of a link chart or toggle visibility of non-spatial data on a link chart.
|
|
20
|
+
* However, it cannot change the symbology of
|
|
21
|
+
* features or create new layers or export results of a query to a file or external source.
|
|
22
|
+
*
|
|
23
|
+
* This is an unrendered component that must be added as a child of the `arcgis-assistant` component in either HTML or JavaScript.
|
|
14
24
|
*
|
|
25
|
+
* Link Chart context example:
|
|
15
26
|
* ```html
|
|
16
27
|
* <arcgis-link-chart id="my-link-chart"></arcgis-link-chart>
|
|
17
28
|
* <arcgis-assistant>
|
|
@@ -19,36 +30,68 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
|
|
|
19
30
|
* </arcgis-assistant>
|
|
20
31
|
* ```
|
|
21
32
|
*
|
|
22
|
-
*
|
|
33
|
+
* Map context example:
|
|
34
|
+
* Note: the map must contain one knowledge graph layer.
|
|
35
|
+
* ```html
|
|
36
|
+
* <arcgis-map id="my-map"></arcgis-map>
|
|
37
|
+
* <arcgis-assistant>
|
|
38
|
+
* <arcgis-assistant-knowledge-agent reference-element="my-map"></arcgis-assistant-knowledge-agent>
|
|
39
|
+
* </arcgis-assistant>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Knowledge Graph Service context example:
|
|
43
|
+
* ```html
|
|
44
|
+
* <arcgis-assistant>
|
|
45
|
+
* <arcgis-assistant-knowledge-agent
|
|
46
|
+
* service-url="https://example.com/server/rest/services/Hosted/myKnowledgeGraph/KnowledgeGraphServer"
|
|
47
|
+
* >
|
|
48
|
+
* </arcgis-assistant-knowledge-agent>
|
|
49
|
+
* </arcgis-assistant>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Once added to the assistant, the agent is loaded and ready to receive user messages directed to their knowledge graph related layers or data.
|
|
23
53
|
*
|
|
24
|
-
* ###
|
|
54
|
+
* ### Capabilities
|
|
25
55
|
*
|
|
26
56
|
* The knowledge agent provides the following capabilities related to a knowledge graph or associated knowledge graph layer or link chart layer:
|
|
27
57
|
*
|
|
28
|
-
* - **Query
|
|
29
|
-
*
|
|
58
|
+
* - **Query** - Ask about the entities and relationships in my graph. This includes questions about connections between entities and
|
|
59
|
+
* patterns in the graph, as well as questions about the structure of the graph such as the types of entities and relationships and the
|
|
60
|
+
* number of each type.
|
|
61
|
+
* Returns the results of the query in text form, and can optionally add returned
|
|
62
|
+
* entities or relationships to the map or link chart view if the user prompt requests it.
|
|
63
|
+
* - **Search** - Search for specific entities or relationships in the knowledge graph, or the closest matches based on their properties.
|
|
64
|
+
* Returns the results of the search in text form, and can optionally add returned entities or relationships to the map or link chart
|
|
65
|
+
* view if the user prompt requests it.
|
|
66
|
+
* - **Generate Cypher Query** - Generates and returns a cypher query based on a natural language question and the current knowledge
|
|
67
|
+
* graph data model,
|
|
30
68
|
* which can be run against the knowledge graph service.
|
|
31
69
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
70
|
+
* Additional capabilities with a map view with a knowledge graph layer or a link chart view
|
|
71
|
+
*
|
|
72
|
+
* - **Add entities and relationships** - Add entities or relationships the the knowledge graph or link chart layer based on results returned from searches or queries generated from user prompts.
|
|
73
|
+
*
|
|
74
|
+
* Additional capabilities with a link chart view only
|
|
34
75
|
*
|
|
35
|
-
* **
|
|
36
|
-
* - **Change link chart layout** - Swap the layout of the link chart between different modes such as force directed, radial, or hierarchical.
|
|
76
|
+
* - **Change link chart layout** - Change the layout of the link chart between different modes such as force directed, radial, or hierarchical.
|
|
37
77
|
* - **Toggle non-spatial visibility** - Show or hide non-spatial entities and relationships on the link chart.
|
|
38
|
-
* - **Create link chart from query** -
|
|
78
|
+
* - **Create link chart from query** - Recreate the link chart with new entities and relationships based on a query generated from the
|
|
79
|
+
* user prompt.
|
|
39
80
|
*
|
|
40
81
|
*
|
|
41
82
|
* ### Example questions
|
|
42
83
|
*
|
|
43
|
-
* The following are example questions a user can ask within the bounds of the
|
|
84
|
+
* The following are example questions a user can ask within the bounds of the knowledge agent:
|
|
44
85
|
*
|
|
45
86
|
* - "What entities are in this graph, and what is the count of each entity type?"
|
|
46
|
-
* - "
|
|
47
|
-
* - "
|
|
87
|
+
* - "Who are the top 5 entities most connected to Company X?"
|
|
88
|
+
* - "Find all employees with the last name Smith."
|
|
89
|
+
* - "What is the most influential company in this graph?"
|
|
90
|
+
* - "Generate a cypher query to find all employees of Company X that joined the company after 2022 who worked for a competitor before joining Company X."
|
|
48
91
|
* - "Add all connections between Company X and Company Y to the link chart"
|
|
49
|
-
* - "Change the layout to
|
|
50
|
-
* - "
|
|
51
|
-
* - "Create a new link chart
|
|
92
|
+
* - "Change the layout to hierarchical"
|
|
93
|
+
* - "Hide non spatial data on the link chart"
|
|
94
|
+
* - "Create a new link chart with all employees from Company X that joined the company after 2015 and are located in California"
|
|
52
95
|
*
|
|
53
96
|
* > Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the
|
|
54
97
|
* out-of-the-box agents.
|