@arcgis/ai-components 5.2.0-next.102 → 5.2.0-next.104
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/agent-utils/LLMAgent.js +40 -40
- package/dist/agent-utils/middlewares/trace.js +5 -5
- package/dist/cdn/{FXP5UIQU.js → 2NDBI2VA.js} +1 -1
- package/dist/cdn/{LAYVGCPL.js → 4RDNI22D.js} +3 -3
- package/dist/cdn/{Z5HWPSZN.js → 6FCU2KJP.js} +1 -1
- package/dist/cdn/{ICQCK5D3.js → 7BJ4JKLG.js} +1 -1
- package/dist/cdn/{TEPP7YPR.js → 7HS5KX3J.js} +1 -1
- package/dist/cdn/{G7OMHU2B.js → 7UUYJTKT.js} +1 -1
- package/dist/cdn/{B2JDVLA6.js → 7VYYQ7BT.js} +1 -1
- package/dist/cdn/{JCOA24UH.js → BXQ4I5HB.js} +1 -1
- package/dist/cdn/{IJVMUS2L.js → C7LGDNB3.js} +1 -1
- package/dist/cdn/{TCH5I5LS.js → CGJINV7H.js} +1 -1
- package/dist/cdn/{RVSTAUQS.js → D2SS763Z.js} +1 -1
- package/dist/cdn/{OX64WOEL.js → G6CR7JVM.js} +1 -1
- package/dist/cdn/{MY47B3CE.js → GCVB5VG4.js} +1 -1
- package/dist/cdn/{5XZLS7UO.js → GL7BPKBN.js} +1 -1
- package/dist/cdn/{D5UFYQHN.js → HKOGIZDQ.js} +2 -2
- package/dist/cdn/{BE7BRJZD.js → NYJYRCGA.js} +1 -1
- package/dist/cdn/SWH6ZHD4.js +18 -0
- package/dist/cdn/{TMVF2W5N.js → W4JQDITQ.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/arcgisKnowledgeGraph.js +1 -1
- package/dist/chunks/dataExplorationGraph.js +30 -30
- package/dist/chunks/generateLayerDescriptions.js +15 -15
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/UHNVDALX.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import f from"./SZ2QSSB3.js";import e from"./
|
|
2
|
+
import f from"./SZ2QSSB3.js";import e from"./2NDBI2VA.js";import d from"./KITIP6J2.js";import{a as M}from"./Z5W4V7RC.js";import{a as u}from"./FDOMMK2M.js";import c from"./C4JT4S5E.js";import{a as F}from"./Y7XD7ZRD.js";import{a as C}from"./VLLZ2FFU.js";import b from"./5ZFUGNRN.js";import{a as L}from"./LLUGJKAQ.js";import{a as _}from"./WKTQVBFJ.js";import{a as I}from"./K2R6XVK3.js";import a from"./HKOGIZDQ.js";import{a as x}from"./ONQ6JSBJ.js";import{a as g}from"./7VAQUCBU.js";import{Ya as E,a as w,b as k}from"./EWLXNGKH.js";import{a as y}from"./VXFQANGJ.js";export default $arcgis.t(([,,,,,,{o:$,p:N},R,b,A,{a:Z,b:v,c:S,d:q,e:V},j])=>{var T=[b,F,C,R,L,_,I,A,M];async function B(e,t){let a=await S("navigation_tool_prompt"),{mapView:n}=x(t,["mapView"]),m=n.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],s=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,G)=>`${G+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
|
|
3
3
|
`):"",c=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",r=e.intent==="goToBookmark"&&m.length?`Available bookmarks:
|
|
4
4
|
${m.map(p=>`- ${p}`).join(`
|
|
5
5
|
`)}`:"",i=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../UZLQALHY.js";var e,a,i,c,u,s,w,l,f,m,p,y;async function r(n,t){if(t in n)return n[t];if("default"in n){let o=await n.default;return typeof o=="object"&&o!==null&&t in o?o[t]:o}throw new Error(`Unable to resolve ${String(t)} from module.`)}function W(n,t){let o={};for(let[b,k]of Object.entries(t))o[b]=h(n,k);return o}function d(n,t){return n.object(W(n,t))}function h(n,t){let o=g(n,t);return t.required===!0?o:o.optional()}function g(n,t){let o=T(n,t);return t.description!==void 0&&(o=o.describe(t.description)),o}function S(n,t){switch(t){case"string":return n.string();case"number":return n.number();case"boolean":return n.boolean()}}function A(n){return n==="string"||n==="number"||n==="boolean"}function T(n,t){switch(t.type){case"string":{if(t.enum!=null){if(t.enum.length===0)throw new Error("String schema field enum must include at least one value.");return n.enum(t.enum)}return n.string()}case"number":return n.number();case"boolean":return n.boolean();case"array":{if(t.itemType==null)throw new Error("Array schema field requires an itemType definition.");return n.array(A(t.itemType)?S(n,t.itemType):g(n,t.itemType))}case"object":{if(t.fields==null)throw new Error("Object schema field requires a fields definition.");return d(n,t.fields)}}}async function L(n){p??=import("../APFZY4PI.js");let t=await p;return d(t.z,n)}async function j(n,t){y??=import("../
|
|
2
|
+
import"../UZLQALHY.js";var e,a,i,c,u,s,w,l,f,m,p,y;async function r(n,t){if(t in n)return n[t];if("default"in n){let o=await n.default;return typeof o=="object"&&o!==null&&t in o?o[t]:o}throw new Error(`Unable to resolve ${String(t)} from module.`)}function W(n,t){let o={};for(let[b,k]of Object.entries(t))o[b]=h(n,k);return o}function d(n,t){return n.object(W(n,t))}function h(n,t){let o=g(n,t);return t.required===!0?o:o.optional()}function g(n,t){let o=T(n,t);return t.description!==void 0&&(o=o.describe(t.description)),o}function S(n,t){switch(t){case"string":return n.string();case"number":return n.number();case"boolean":return n.boolean()}}function A(n){return n==="string"||n==="number"||n==="boolean"}function T(n,t){switch(t.type){case"string":{if(t.enum!=null){if(t.enum.length===0)throw new Error("String schema field enum must include at least one value.");return n.enum(t.enum)}return n.string()}case"number":return n.number();case"boolean":return n.boolean();case"array":{if(t.itemType==null)throw new Error("Array schema field requires an itemType definition.");return n.array(A(t.itemType)?S(n,t.itemType):g(n,t.itemType))}case"object":{if(t.fields==null)throw new Error("Object schema field requires a fields definition.");return d(n,t.fields)}}}async function L(n){p??=import("../APFZY4PI.js");let t=await p;return d(t.z,n)}async function j(n,t){y??=import("../CGJINV7H.js");let o=await y;return await(await r(o,"sendUXSuggestion"))(n,t)}async function q(n){e??=import("../FUF3NAU7.js");let t=await e,o=await r(t,"FunctionAgent");return new o(n)}async function E(n){a??=import("../J6SZIQJA.js");let t=await a,o=await r(t,"FunctionTool");return new o(n)}async function F(n){i??=import("../7VYYQ7BT.js");let t=await i,o=await r(t,"LLMAgent");return new o(n)}async function v(n){c??=import("../HAEFC2SJ.js");let t=await c,o=await r(t,"WorkflowAgent");return new o(n)}async function U(n){u??=import("../NZSOJ726.js");let t=await u,o=await r(t,"ConditionalWorkflow");return new o(n)}async function M(n){s??=import("../OE3GW5LE.js");let t=await s,o=await r(t,"LoopWorkflow");return new o(n)}async function P(n){w??=import("../WGO5SER7.js");let t=await w,o=await r(t,"ParallelWorkflow");return new o(n)}async function R(n){l??=import("../FG647IP6.js");let t=await l,o=await r(t,"RouterWorkflow");return new o(n)}async function X(n){f??=import("../ZDV4K4WG.js");let t=await f,o=await r(t,"SequentialWorkflow");return new o(n)}async function x(n){m??=import("../HDACNIZF.js");let t=await m,o=await r(t,"SwitchWorkflow");return new o(n)}export{U as createConditionalWorkflow,q as createFunctionAgent,E as createFunctionTool,F as createLLMAgent,M as createLoopWorkflow,P as createParallelWorkflow,R as createRouterWorkflow,L as createSchema,X as createSequentialWorkflow,x as createSwitchWorkflow,v as createWorkflowAgent,j as sendUXSuggestion};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as o}from"../../7VAQUCBU.js";import{a as l,b as c}from"../../HHFNQR6Z.js";import"../../VOKXKU7M.js";import"../../EWLXNGKH.js";import{W as s,ea as i}from"../../AI6DYOKR.js";import"../../MWYBF3F3.js";import"../../UZLQALHY.js";var
|
|
2
|
+
import{a as o}from"../../7VAQUCBU.js";import{a as l,b as c}from"../../HHFNQR6Z.js";import"../../VOKXKU7M.js";import"../../EWLXNGKH.js";import{W as s,ea as i}from"../../AI6DYOKR.js";import"../../MWYBF3F3.js";import"../../UZLQALHY.js";var g="agent-trace",u="tool-trace";function y(){return l(g,{wrapModelCall:async(t,e)=>{let a=await e(t),r=t.runtime,m=d(a);return await Promise.all(m.map(async n=>await o({text:`LLM requested tool call "${n.name}" with arguments: ${JSON.stringify(n.args,null,2)}`},r))),a}})}function M(){return c(u,{wrapToolCall:async(t,e)=>{let a=await e(t),r=t.config;return await o({text:`Finished executing tool: ${s.isInstance(a)?a.text:typeof a=="string"?a:t.tool.name}`},r),a}})}function d(t){return!i.isInstance(t)||!Array.isArray(t.tool_calls)?[]:t.tool_calls.filter(e=>typeof e?.name=="string")}export{y as createAgentTraceMiddleware,M as createToolTraceMiddleware};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{p as s,y as e}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var a=s(e,{"arcgis-assistant":[()=>import("./
|
|
2
|
+
import{p as s,y as e}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var a=s(e,{"arcgis-assistant":[()=>import("./GCVB5VG4.js"),"_messages:,allowedAgentIds:,alwaysUseAgentId,assistantAvatarEnabled,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,runtimeEventsEnabled,streamingDisabled,suggestedPrompts:,userAvatarEnabled,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt,unregister"],"arcgis-assistant-agent":[()=>import("./NYJYRCGA.js"),"agent:,context:,itemId,workflow:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./D2SS763Z.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./7HS5KX3J.js"),"referenceElement;;getContext"],"arcgis-assistant-knowledge-agent":[()=>import("./6FCU2KJP.js"),"context:,referenceElement,serviceUrl;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./GL7BPKBN.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./7BJ4JKLG.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./6ECRQVHY.js"),"interrupt:,loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./2O4DON37.js"),"_messages:,awaitingResponse,disabled,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./F5NIRETW.js"),"_messages:,message,options:,type"],"arcgis-assistant-interrupt-preview":[()=>import("./UDRKUVZP.js"),"interrupts:"],"arcgis-assistant-message":[()=>import("./EYOWRGDP.js"),"_messages:,assistantAvatarEnabled,copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./5HBAJ57P.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./MXTXJKFE.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./6P44KOKX.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./O4NVW75A.js"),"_messages:,assistantAvatarEnabled,interrupts:,loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./6YYPVU7H.js"),"log:,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./WSWB3B7B.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./C4FEETBZ.js"),"content,parts:"],"arcgis-assistant-speech-input":[()=>import("./5MK44FNO.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./SXM4NUT5.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./HHUQXL3R.js"),"content,message:,user,userAvatarEnabled"]});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,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,p,j,i=(a.importMap??={}).imports??={})=>{"agent-utils/index,agent-utils/middlewares/middleware,agent-utils/middlewares/humanInTheLoop,agent-utils/middlewares/trace".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));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,"@arcgis/ai-components/",".js")
|
|
@@ -37,7 +37,7 @@ async function D(e, t) {
|
|
|
37
37
|
inputVariables: n,
|
|
38
38
|
tools: w,
|
|
39
39
|
config: t
|
|
40
|
-
}), l = (r.tool_calls?.length ?? 0) > 0, a = typeof r.text == "string" ? r.text.trim() : "", i = a.length > 0, d = r.
|
|
40
|
+
}), l = (r.tool_calls?.length ?? 0) > 0, a = typeof r.text == "string" ? r.text.trim() : "", i = a.length > 0, d = r.text;
|
|
41
41
|
return !l && (s === "map" || s === "knowledgeGraph") ? {
|
|
42
42
|
...e,
|
|
43
43
|
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, r],
|
|
@@ -33,41 +33,41 @@ const I = async (t, e) => (await s({ text: "Exiting Data Exploration agent" }, e
|
|
|
33
33
|
assignedTask: t.agentExecutionContext.assignedTask,
|
|
34
34
|
userRequest: t.agentExecutionContext.userRequest,
|
|
35
35
|
priorSteps: t.agentExecutionContext.priorSteps
|
|
36
|
-
},
|
|
36
|
+
}, n = await M({
|
|
37
37
|
promptText: l,
|
|
38
38
|
modelTier: "default",
|
|
39
39
|
config: e,
|
|
40
40
|
messages: t.dataExplorationMessages,
|
|
41
41
|
inputVariables: o,
|
|
42
42
|
tools: w
|
|
43
|
-
}),
|
|
44
|
-
if (!((
|
|
43
|
+
}), i = [...t.dataExplorationMessages, n];
|
|
44
|
+
if (!((n.tool_calls?.length ?? 0) > 0))
|
|
45
45
|
return await s({ text: "LLM determined no filter changes needed" }, e), {
|
|
46
46
|
...t,
|
|
47
|
-
dataExplorationMessages:
|
|
47
|
+
dataExplorationMessages: i
|
|
48
48
|
// Don't overwrite outputMessage if query already set it
|
|
49
49
|
};
|
|
50
|
-
const u =
|
|
51
|
-
return await L(
|
|
50
|
+
const u = i, p = n.text;
|
|
51
|
+
return await L(n, e), { ...t, dataExplorationMessages: u, outputMessage: p };
|
|
52
52
|
}, Q = async (t, e) => {
|
|
53
53
|
await s({ text: "Requesting LLM for layer query results" }, e);
|
|
54
54
|
const l = await x("data_explore_query_prompt");
|
|
55
55
|
if (!e?.configurable)
|
|
56
56
|
throw new Error("config.configurable is required for layer query tools");
|
|
57
|
-
const { userTimezone: d, userTimezoneOffset: r } = q(), o = t.agentExecutionContext.sharedState,
|
|
57
|
+
const { userTimezone: d, userTimezoneOffset: r } = q(), o = t.agentExecutionContext.sharedState, n = o.lastNavigatedFeatures?.value, i = o.lastResolvedLocation?.value;
|
|
58
58
|
let c = "none";
|
|
59
|
-
if (
|
|
59
|
+
if (n != null)
|
|
60
60
|
try {
|
|
61
|
-
c = JSON.stringify(
|
|
61
|
+
c = JSON.stringify(n);
|
|
62
62
|
} catch {
|
|
63
63
|
c = "none";
|
|
64
64
|
}
|
|
65
65
|
let u = "none";
|
|
66
|
-
if (
|
|
66
|
+
if (i != null)
|
|
67
67
|
try {
|
|
68
68
|
u = JSON.stringify({
|
|
69
|
-
address:
|
|
70
|
-
location:
|
|
69
|
+
address: i.address,
|
|
70
|
+
location: i.location
|
|
71
71
|
});
|
|
72
72
|
} catch {
|
|
73
73
|
u = "none";
|
|
@@ -88,7 +88,7 @@ const I = async (t, e) => (await s({ text: "Exiting Data Exploration agent" }, e
|
|
|
88
88
|
messages: t.dataExplorationMessages,
|
|
89
89
|
inputVariables: p,
|
|
90
90
|
tools: C
|
|
91
|
-
}), f = (g.tool_calls?.length ?? 0) > 0, h = g.
|
|
91
|
+
}), f = (g.tool_calls?.length ?? 0) > 0, h = g.text;
|
|
92
92
|
return await L(g, e), {
|
|
93
93
|
...t,
|
|
94
94
|
dataExplorationMessages: [...t.dataExplorationMessages, g],
|
|
@@ -112,15 +112,15 @@ const I = async (t, e) => (await s({ text: "Exiting Data Exploration agent" }, e
|
|
|
112
112
|
config: e,
|
|
113
113
|
messages: t.dataExplorationMessages,
|
|
114
114
|
inputVariables: d
|
|
115
|
-
}), o = typeof r == "string" ? r : r.content,
|
|
115
|
+
}), o = typeof r == "string" ? r : r.content, n = new _(o);
|
|
116
116
|
await s({ text: `Received response from LLM: ${o}` }, e);
|
|
117
|
-
const
|
|
117
|
+
const i = o;
|
|
118
118
|
return {
|
|
119
119
|
...t,
|
|
120
|
-
outputMessage:
|
|
120
|
+
outputMessage: i,
|
|
121
121
|
status: "success",
|
|
122
|
-
summary:
|
|
123
|
-
dataExplorationMessages: [...t.dataExplorationMessages,
|
|
122
|
+
summary: i ? v(i) : "Summary generated.",
|
|
123
|
+
dataExplorationMessages: [...t.dataExplorationMessages, n]
|
|
124
124
|
};
|
|
125
125
|
} catch (a) {
|
|
126
126
|
throw await s({ text: "Error during filter LLM request" }, e), new Error(`Error during filter LLM request: ${a instanceof Error ? a.message : String(a)}`);
|
|
@@ -150,13 +150,13 @@ function P(t, e) {
|
|
|
150
150
|
const j = async (t, e) => {
|
|
151
151
|
try {
|
|
152
152
|
await s({ text: "Preparing field information for vector search results" }, e);
|
|
153
|
-
const a = m(e, "layersAndFieldsRegistry"), { mapView: l } = D(e, ["mapView"]), { assignedTask: d, userRequest: r } = t.agentExecutionContext, o = P(d, r), { layerFieldInfo:
|
|
153
|
+
const a = m(e, "layersAndFieldsRegistry"), { mapView: l } = D(e, ["mapView"]), { assignedTask: d, userRequest: r } = t.agentExecutionContext, o = P(d, r), { layerFieldInfo: n, didFetchStatistics: i, fieldStatisticsFetchStatus: c } = await $(
|
|
154
154
|
t.vectorSearchFieldResults,
|
|
155
155
|
a,
|
|
156
156
|
l,
|
|
157
157
|
o
|
|
158
158
|
);
|
|
159
|
-
|
|
159
|
+
i ? await s({ text: "Statistics fetched" }, e) : await s({ text: "Statistics skipped" }, e);
|
|
160
160
|
for (const u of c)
|
|
161
161
|
await s(
|
|
162
162
|
{
|
|
@@ -164,7 +164,7 @@ const j = async (t, e) => {
|
|
|
164
164
|
},
|
|
165
165
|
e
|
|
166
166
|
);
|
|
167
|
-
return await s({ text: "Field information prepared" }, e), { ...t, layerFieldInfo:
|
|
167
|
+
return await s({ text: "Field information prepared" }, e), { ...t, layerFieldInfo: n };
|
|
168
168
|
} catch (a) {
|
|
169
169
|
throw await s({ text: "Error during fetching statistics" }, e), new Error(`Error during fetching statistics: ${a instanceof Error ? a.message : String(a)}`);
|
|
170
170
|
}
|
|
@@ -177,16 +177,16 @@ const j = async (t, e) => {
|
|
|
177
177
|
minScore: S,
|
|
178
178
|
topResults: G,
|
|
179
179
|
embeddingCache: d
|
|
180
|
-
}), o = r.map(({ layerId:
|
|
180
|
+
}), o = r.map(({ layerId: i, results: c }) => {
|
|
181
181
|
const u = c.map((p) => ` - ${p.name} (${p.score.toFixed(2)})`).join(`
|
|
182
182
|
`);
|
|
183
|
-
return `${l.get(
|
|
183
|
+
return `${l.get(i)?.layerItem.name ?? i}:
|
|
184
184
|
${u}`;
|
|
185
185
|
}).join(`
|
|
186
186
|
`);
|
|
187
|
-
let
|
|
188
|
-
return r.length > 0 ?
|
|
189
|
-
${o}` :
|
|
187
|
+
let n;
|
|
188
|
+
return r.length > 0 ? n = `Vector search completed. Matching layers and fields with scores:
|
|
189
|
+
${o}` : n = `No vector search results found for score over ${S}.`, await s({ text: n }, e), {
|
|
190
190
|
...t,
|
|
191
191
|
vectorSearchFieldResults: r
|
|
192
192
|
};
|
|
@@ -206,11 +206,11 @@ ${o}` : i = `No vector search results found for score over ${S}.`, await s({ tex
|
|
|
206
206
|
text: t.agentExecutionContext.assignedTask,
|
|
207
207
|
minScore: H,
|
|
208
208
|
embeddingCache: d
|
|
209
|
-
}), o = r.map((c) => c.id),
|
|
209
|
+
}), o = r.map((c) => c.id), n = r.map(({ id: c, score: u }) => `${l.get(c)?.layerItem.name ?? c} (${u.toFixed(2)})`).join(`
|
|
210
210
|
`);
|
|
211
|
-
let
|
|
212
|
-
return o.length > 0 ?
|
|
213
|
-
${
|
|
211
|
+
let i;
|
|
212
|
+
return o.length > 0 ? i = `Vector search completed. Matching layers with scores:
|
|
213
|
+
${n}` : i = "Vector search completed. No matching layers found.", await s({ text: i }, e), {
|
|
214
214
|
...t,
|
|
215
215
|
vectorSearchLayerIds: o
|
|
216
216
|
};
|
|
@@ -124,6 +124,9 @@ const se = () => {
|
|
|
124
124
|
return new Y({
|
|
125
125
|
modelName: n,
|
|
126
126
|
apiKey: "dummy-key",
|
|
127
|
+
useResponsesApi: !0,
|
|
128
|
+
// Prevent follow-up Responses API calls from replaying encrypted reasoning items the ArcGIS proxy cannot verify.
|
|
129
|
+
zdrEnabled: !0,
|
|
127
130
|
configuration: {
|
|
128
131
|
baseURL: i,
|
|
129
132
|
fetch: await _({ config: o })
|
|
@@ -147,7 +150,7 @@ const se = () => {
|
|
|
147
150
|
description: r.string().min(1)
|
|
148
151
|
});
|
|
149
152
|
r.array(fe);
|
|
150
|
-
const
|
|
153
|
+
const C = (e) => JSON.stringify(e, null, 2), he = (e) => {
|
|
151
154
|
const t = e.map((n) => n.id), o = r.enum(t);
|
|
152
155
|
return r.object({
|
|
153
156
|
intent: o.nullable(),
|
|
@@ -176,11 +179,11 @@ const A = (e) => JSON.stringify(e, null, 2), he = (e) => {
|
|
|
176
179
|
currentIntent: "none",
|
|
177
180
|
finalOutputMessage: "No agents registered; skipping intent detection."
|
|
178
181
|
};
|
|
179
|
-
const a = await E("intent_prompt"), c =
|
|
182
|
+
const a = await E("intent_prompt"), c = C(s), l = he(s), p = {
|
|
180
183
|
registeredAgents: c,
|
|
181
|
-
priorSteps:
|
|
184
|
+
priorSteps: C(e.agentExecutionContext.priorSteps),
|
|
182
185
|
userRequest: e.agentExecutionContext.userRequest
|
|
183
|
-
}, b = await q.fromTemplate(a).format(p),
|
|
186
|
+
}, b = await q.fromTemplate(a).format(p), A = G({
|
|
184
187
|
model: await w({
|
|
185
188
|
modelTier: "fast",
|
|
186
189
|
config: t
|
|
@@ -205,7 +208,7 @@ const A = (e) => JSON.stringify(e, null, 2), he = (e) => {
|
|
|
205
208
|
Q({ runLimit: 2 })
|
|
206
209
|
]
|
|
207
210
|
}), { structuredResponse: v } = await le({
|
|
208
|
-
agent:
|
|
211
|
+
agent: A,
|
|
209
212
|
messages: e.agentExecutionContext.messages,
|
|
210
213
|
config: t
|
|
211
214
|
}), u = l.parse(
|
|
@@ -321,11 +324,8 @@ Description: {description}`, Ke = r.object({
|
|
|
321
324
|
messages: n,
|
|
322
325
|
config: s
|
|
323
326
|
})).invoke(i ?? {}, s);
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
const l = c.content;
|
|
327
|
-
return typeof l == "string" ? l : JSON.stringify(l);
|
|
328
|
-
}, O = async (e) => {
|
|
327
|
+
return typeof c == "string" ? c : c.text;
|
|
328
|
+
}, $ = async (e) => {
|
|
329
329
|
const { promptText: t, modelTier: o = "default", messages: n, inputVariables: i, schema: s, config: a } = e, c = R(t, n ?? []), p = (await w({ modelTier: o, config: a })).withStructuredOutput(s);
|
|
330
330
|
return await c.pipe(p).invoke(i ?? {}, a);
|
|
331
331
|
}, He = async (e) => {
|
|
@@ -338,8 +338,8 @@ Description: {description}`, Ke = r.object({
|
|
|
338
338
|
alias: m.string()
|
|
339
339
|
}), Ie = m.object({
|
|
340
340
|
fields: m.array(Se)
|
|
341
|
-
}),
|
|
342
|
-
const o =
|
|
341
|
+
}), O = (e, t) => e.getFieldAlias(t) ?? void 0, I = (e, t) => O(e, t.name) ?? t.alias ?? "", ke = (e, t) => {
|
|
342
|
+
const o = O(e, t.name);
|
|
343
343
|
return !!(o && o !== (t.alias ?? ""));
|
|
344
344
|
};
|
|
345
345
|
function D(e, t) {
|
|
@@ -371,7 +371,7 @@ const We = async (e) => {
|
|
|
371
371
|
existingLayerTitle: e.title,
|
|
372
372
|
existingLayerDescription: e.portalItem?.description,
|
|
373
373
|
fieldInformation: n
|
|
374
|
-
}, s = await
|
|
374
|
+
}, s = await $({
|
|
375
375
|
promptText: o,
|
|
376
376
|
schema: Ie,
|
|
377
377
|
inputVariables: i
|
|
@@ -389,7 +389,7 @@ const We = async (e) => {
|
|
|
389
389
|
existingLayerSnippet: e.portalItem?.snippet,
|
|
390
390
|
layerGeometryType: e.geometryType
|
|
391
391
|
};
|
|
392
|
-
return { ...await
|
|
392
|
+
return { ...await $({
|
|
393
393
|
promptText: n,
|
|
394
394
|
schema: Ee,
|
|
395
395
|
inputVariables: s
|
|
@@ -406,7 +406,7 @@ export {
|
|
|
406
406
|
xe as f,
|
|
407
407
|
We as g,
|
|
408
408
|
He as h,
|
|
409
|
-
|
|
409
|
+
$ as i,
|
|
410
410
|
ie as j,
|
|
411
411
|
ae as k,
|
|
412
412
|
ve as l,
|
|
@@ -107,7 +107,7 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
|
|
|
107
107
|
export abstract class ArcgisAssistantKnowledgeAgent extends LitElement {
|
|
108
108
|
/**
|
|
109
109
|
* Optional context for the knowledge agent. If the agent does not have a view or kg service url provided via reference element or serviceUrl property
|
|
110
|
-
* a knowledge graph can be provided directly via context to enable Knowledge Service related
|
|
110
|
+
* a knowledge graph can be provided directly via context to enable Knowledge Service related capabilities.
|
|
111
111
|
*
|
|
112
112
|
* Depending on the context provided, different capabilities will be available.
|
|
113
113
|
*/
|