@arcgis/ai-components 5.1.0-next.99 → 5.1.0
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/README.md +2 -2
- package/dist/agent-utils/BaseAgent.d.ts +90 -0
- package/dist/agent-utils/BaseAgent.js +87 -0
- package/dist/agent-utils/FunctionAgent.d.ts +64 -0
- package/dist/agent-utils/FunctionAgent.js +98 -0
- package/dist/agent-utils/LLMAgent.d.ts +65 -0
- package/dist/agent-utils/LLMAgent.js +140 -0
- package/dist/agent-utils/WorkflowAgent.d.ts +44 -0
- package/dist/agent-utils/WorkflowAgent.js +70 -0
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.d.ts +152 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.js +94 -0
- package/dist/agent-utils/middlewares/middleware.d.ts +25 -0
- package/dist/agent-utils/middlewares/middleware.js +44 -0
- package/dist/agent-utils/middlewares/trace.d.ts +27 -0
- package/dist/agent-utils/middlewares/trace.js +42 -0
- package/dist/agent-utils/middlewares/types.d.ts +123 -0
- package/dist/agent-utils/middlewares/types.js +2 -0
- package/dist/agent-utils/tools/FunctionTool.d.ts +127 -0
- package/dist/agent-utils/tools/FunctionTool.js +80 -0
- package/dist/agent-utils/types.d.ts +181 -0
- package/dist/agent-utils/workflows/BaseWorkflow.d.ts +87 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +72 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.js +61 -0
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +58 -0
- package/dist/agent-utils/workflows/LoopWorkflow.js +56 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +68 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.js +129 -0
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +63 -0
- package/dist/agent-utils/workflows/RouterWorkflow.js +75 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +56 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.js +69 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +74 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.js +84 -0
- package/dist/assets/embeddings.worker-k9_Ou679.js +1 -0
- package/dist/cdn/23JKEYWV.js +2 -0
- package/dist/cdn/2XP5E435.js +2 -0
- package/dist/cdn/3H7F4V6U.js +2 -0
- package/dist/cdn/3J5RM5OR.js +36 -0
- package/dist/cdn/46U2PGRW.js +65 -0
- package/dist/cdn/4ASZF5I2.js +181 -0
- package/dist/cdn/4BA4OUWC.js +134 -0
- package/dist/cdn/4EALV6QJ.js +2 -0
- package/dist/cdn/4Z4AESFZ.js +2 -0
- package/dist/cdn/{5PT7ZFXF.js → 5RQUSM3T.js} +23 -5
- package/dist/cdn/6FEB6XYK.js +2 -0
- package/dist/cdn/7CCULIWM.js +2 -0
- package/dist/cdn/7Q2WROGA.js +2 -0
- package/dist/cdn/7WSTR3WA.js +2 -0
- package/dist/cdn/7ZN4HYX2.js +2 -0
- package/dist/cdn/A6C7XUI4.js +2 -0
- package/dist/cdn/{SFREIREB.js → AJKWCXDA.js} +8 -2
- package/dist/cdn/AXOPGQGZ.js +2 -0
- package/dist/cdn/BAGQCT2N.js +2 -0
- package/dist/cdn/BBB2NVY5.js +3 -0
- package/dist/cdn/BGZV7RUS.js +2 -0
- package/dist/cdn/BUTKUPXN.js +34 -0
- package/dist/cdn/CU2TRUZQ.js +99 -0
- package/dist/cdn/D5PZVUO7.js +2 -0
- package/dist/cdn/DB2C7FK7.js +2 -0
- package/dist/cdn/DHGNGMNJ.js +2 -0
- package/dist/cdn/DKNDDDWM.js +2 -0
- package/dist/cdn/DTRZOJOT.js +2 -0
- package/dist/cdn/ESRKMM6P.js +2 -0
- package/dist/cdn/FDBWYCAB.js +22 -0
- package/dist/cdn/FYNHAVHL.js +2 -0
- package/dist/cdn/H3EEFM4A.js +179 -0
- package/dist/cdn/HIGLOYFN.js +9 -0
- package/dist/cdn/JNDONBTW.js +2 -0
- package/dist/cdn/JOLKZ6S5.js +2 -0
- package/dist/cdn/JQ5VH32K.js +2 -0
- package/dist/cdn/K6BGVUQ7.js +2 -0
- package/dist/cdn/KGYSBUFO.js +9 -0
- package/dist/cdn/L6GVMINQ.js +2 -0
- package/dist/cdn/LTPDBXQ7.js +6 -0
- package/dist/cdn/LUY7QCZ3.js +2 -0
- package/dist/cdn/LXJWWOGK.js +66 -0
- package/dist/cdn/M7C6Y752.js +2 -0
- package/dist/cdn/{3QC3BRZP.js → MEQ67UQH.js} +1 -1
- package/dist/cdn/MJM2MHJW.js +44 -0
- package/dist/cdn/MNCG7Q7C.js +3 -0
- package/dist/cdn/MNHNUIMV.js +2 -0
- package/dist/cdn/N2SKXRLK.js +71 -0
- package/dist/cdn/OBDCCGVH.js +2 -0
- package/dist/cdn/OFH2TDZM.js +2 -0
- package/dist/cdn/OP6ENMCN.js +180 -0
- package/dist/cdn/P5M2HNJ7.js +2 -0
- package/dist/cdn/PFW7KXCP.js +48 -0
- package/dist/cdn/PIUDMACH.js +56 -0
- package/dist/cdn/PKH5BECA.js +2 -0
- package/dist/cdn/PTKZXFXB.js +31 -0
- package/dist/cdn/{O62HTIOD.js → Q33HJXYV.js} +1 -1
- package/dist/cdn/QH6TSBNI.js +2 -0
- package/dist/cdn/QZXQIJSW.js +2 -0
- package/dist/cdn/SHCVYGIH.js +4 -0
- package/dist/cdn/SUFXLHTD.js +2 -0
- package/dist/cdn/{VHOF6SUZ.js → TIXCHLEN.js} +17 -1
- package/dist/cdn/TOYQ22PR.js +2 -0
- package/dist/cdn/UDXMJNRF.js +3 -0
- package/dist/cdn/UE3CP46P.js +2 -0
- package/dist/cdn/VDAF255D.js +22 -0
- package/dist/cdn/VPZHLYPA.js +2 -0
- package/dist/cdn/{7EXACS27.js → VWMJ7HIK.js} +10 -7
- package/dist/cdn/W2CWLWUT.js +14 -0
- package/dist/cdn/W6HO4D6J.js +18 -0
- package/dist/cdn/WNJM5TET.js +2 -0
- package/dist/cdn/XKIAXVPE.js +2 -0
- package/dist/cdn/XMJF5F4M.js +2 -0
- package/dist/cdn/Y5GGIKKC.js +2 -0
- package/dist/cdn/YURWID37.js +2 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/BaseWorkflow.js +107 -0
- package/dist/chunks/adapter.js +3130 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +229 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +25 -0
- package/dist/chunks/arcgis_knowledge_current_map_context.js +37 -0
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +101 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +137 -0
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +34 -0
- package/dist/chunks/converterUtils.js +39 -32
- package/dist/chunks/dataExplorationGraph.js +324 -0
- package/dist/chunks/data_explore_filter_prompt.js +125 -0
- package/dist/chunks/data_explore_query_prompt.js +149 -0
- package/dist/chunks/embeddings.worker.js +25 -0
- package/dist/chunks/field_descriptions_prompt.js +112 -0
- package/dist/chunks/generateLayerDescriptions.js +453 -0
- package/dist/chunks/graph.js +86 -0
- package/dist/chunks/helpGraph.js +127 -0
- package/dist/chunks/help_prompt.js +74 -0
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +139 -0
- package/dist/chunks/layerStylingGraph.js +193 -0
- package/dist/chunks/layer_descriptions_prompt.js +59 -0
- package/dist/chunks/layer_styling_prompt.js +72 -0
- package/dist/chunks/navigationGraph.js +271 -0
- package/dist/chunks/navigation_intent_prompt.js +52 -0
- package/dist/chunks/navigation_tool_prompt.js +39 -0
- package/dist/chunks/orchestrator.js +569 -0
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +71 -0
- package/dist/chunks/summarize_query_response_prompt.js +80 -0
- package/dist/chunks/toolCallResponse.js +32 -0
- package/dist/chunks/utils.js +46 -28
- package/dist/chunks/utils2.js +41 -6
- package/dist/chunks/utils3.js +16 -0
- package/dist/components/arcgis-assistant/customElement.d.ts +82 -8
- package/dist/components/arcgis-assistant/customElement.js +393 -152
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +15 -2
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +6 -2
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +30 -8
- package/dist/components/arcgis-assistant-help-agent/customElement.js +33 -8
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +5 -5
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +158 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +74 -0
- package/dist/components/arcgis-assistant-knowledge-agent/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-knowledge-agent/index.js +1 -0
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -6
- package/dist/components/arcgis-assistant-message/customElement.d.ts +23 -0
- package/dist/components/arcgis-assistant-message/customElement.js +28 -26
- package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +2 -2
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +23 -27
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +5 -1
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +31 -7
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
- 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/dist/index.d.ts +8 -0
- package/dist/loader.js +8 -6
- package/dist/types/lumina.d.ts +16 -5
- package/dist/types/preact.d.ts +18 -5
- package/dist/types/react.d.ts +20 -5
- package/dist/types/stencil.d.ts +16 -5
- package/dist/utils/index.d.ts +246 -9
- package/dist/utils/index.js +113 -10
- package/package.json +28 -12
- package/dist/cdn/2YEKZADB.js +0 -2
- package/dist/cdn/457RLS3H.js +0 -2
- package/dist/cdn/4QVKWA2Z.js +0 -24
- package/dist/cdn/54ATSQPS.js +0 -72
- package/dist/cdn/5JBT3YNY.js +0 -2
- package/dist/cdn/5L7OZ37N.js +0 -2
- package/dist/cdn/6ALN3KMA.js +0 -269
- package/dist/cdn/ARCP5UZY.js +0 -2
- package/dist/cdn/B4DEC7PH.js +0 -2
- package/dist/cdn/D7WNBUVK.js +0 -106
- package/dist/cdn/DSEMD4M2.js +0 -4
- package/dist/cdn/ESTSYVJP.js +0 -54
- package/dist/cdn/EUNEQNYC.js +0 -2
- package/dist/cdn/G4SVCCJH.js +0 -2
- package/dist/cdn/GER6EQYH.js +0 -2
- package/dist/cdn/K6LVZHWM.js +0 -45
- package/dist/cdn/KVH3PDVW.js +0 -2
- package/dist/cdn/LSGRWCAO.js +0 -5
- package/dist/cdn/LXFCO34K.js +0 -2
- package/dist/cdn/PTGKT5P6.js +0 -3
- package/dist/cdn/Q5D5LJS5.js +0 -2
- package/dist/cdn/R5FWFRWW.js +0 -2
- package/dist/cdn/SZBOIYZZ.js +0 -2
- package/dist/cdn/TRDKA5Y6.js +0 -2
- package/dist/cdn/UK6CP7BR.js +0 -2
- package/dist/cdn/WBRZZ4FB.js +0 -2
- package/dist/cdn/WNDUCHXU.js +0 -2
- package/dist/cdn/Y3AUHNRX.js +0 -2
- package/dist/cdn/YGW7TUNX.js +0 -2
- package/dist/cdn/YNJYG2RG.js +0 -2
- package/dist/cdn/YW52XJMM.js +0 -396
- package/dist/cdn/Z3DVGFEE.js +0 -2
- package/dist/cdn/ZLO73NU6.js +0 -2
- package/dist/cdn/ZPNJGIAF.js +0 -2
- /package/dist/cdn/{YVTKUITE.js → 53Z3R4OY.js} +0 -0
- /package/dist/cdn/{CFT5BBC6.js → 77GAVZIK.js} +0 -0
- /package/dist/cdn/{W5CHGOOR.js → G7XK3XOR.js} +0 -0
- /package/dist/cdn/{DMLSCJAM.js → HJGF7W5O.js} +0 -0
- /package/dist/cdn/{JDL3HFFX.js → MQ7QXIOW.js} +0 -0
- /package/dist/cdn/{MZJGADGH.js → NMWLJECU.js} +0 -0
- /package/dist/cdn/{24MYCR6F.js → URYKQKFE.js} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { s as r } from "../../chunks/index.js";
|
|
3
|
+
import { AIMessage as i, ToolMessage as s } from "@langchain/core/messages";
|
|
4
|
+
import { createAgentMiddleware as c, createToolMiddleware as d } from "./middleware.js";
|
|
5
|
+
const g = "agent-trace", f = "tool-trace";
|
|
6
|
+
function p() {
|
|
7
|
+
return c(g, {
|
|
8
|
+
wrapModelCall: async (e, a) => {
|
|
9
|
+
const t = await a(e), o = e.runtime, l = m(t);
|
|
10
|
+
return await Promise.all(
|
|
11
|
+
l.map(
|
|
12
|
+
async (n) => await r(
|
|
13
|
+
{
|
|
14
|
+
text: `LLM requested tool call "${n.name}" with arguments: ${JSON.stringify(n.args, null, 2)}`
|
|
15
|
+
},
|
|
16
|
+
o
|
|
17
|
+
)
|
|
18
|
+
)
|
|
19
|
+
), t;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function T() {
|
|
24
|
+
return d(f, {
|
|
25
|
+
wrapToolCall: async (e, a) => {
|
|
26
|
+
const t = await a(e), o = e.config;
|
|
27
|
+
return await r(
|
|
28
|
+
{
|
|
29
|
+
text: `Finished executing tool: ${s.isInstance(t) ? t.content.toString() : typeof t == "string" ? t : e.tool.name}`
|
|
30
|
+
},
|
|
31
|
+
o
|
|
32
|
+
), t;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function m(e) {
|
|
37
|
+
return !i.isInstance(e) || !Array.isArray(e.tool_calls) ? [] : e.tool_calls.filter((a) => typeof a?.name == "string");
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
p as createAgentTraceMiddleware,
|
|
41
|
+
T as createToolTraceMiddleware
|
|
42
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { FunctionToolMiddlewareHandler } from "../tools/FunctionTool.js";
|
|
2
|
+
import type { AgentData, AgentExecutionConfig, AgentGraphState, EmptyAgentData } from "../types.js";
|
|
3
|
+
import type { AgentMiddleware as LangChainAgentMiddleware } from "langchain";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Handles a middleware request and returns the resulting value.
|
|
7
|
+
*
|
|
8
|
+
* @param request - The request payload for the current middleware stage.
|
|
9
|
+
*/
|
|
10
|
+
export type MiddlewareHandler<TRequest, TResult> = (request: TRequest) => Promise<TResult> | TResult;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Wraps a middleware request and delegates to the next handler.
|
|
14
|
+
*
|
|
15
|
+
* @param request - The request payload for the current middleware stage.
|
|
16
|
+
* @param handler - The next handler in the middleware chain.
|
|
17
|
+
*/
|
|
18
|
+
export type Middleware<TRequest, TResult> = (request: TRequest, handler: MiddlewareHandler<TRequest, TResult>) => Promise<TResult> | TResult;
|
|
19
|
+
|
|
20
|
+
export interface AgentMiddlewareAgent {
|
|
21
|
+
/**
|
|
22
|
+
* Description of the agent, which can be used to provide context in middleware hooks and interrupts.
|
|
23
|
+
*
|
|
24
|
+
* @since 5.1
|
|
25
|
+
*/
|
|
26
|
+
description?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for the agent, used for registration and invocation purposes.
|
|
29
|
+
*
|
|
30
|
+
* @since 5.1
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Name of the agent, used for display and identification purposes.
|
|
35
|
+
*
|
|
36
|
+
* @since 5.1
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface AgentRunRequest<TCustomState extends AgentData = EmptyAgentData> {
|
|
42
|
+
/**
|
|
43
|
+
* The agent that is being executed. This can be used in middleware hooks to access agent metadata and provide context for interrupts or other middleware behavior.
|
|
44
|
+
*
|
|
45
|
+
* @since 5.1
|
|
46
|
+
*/
|
|
47
|
+
agent: AgentMiddlewareAgent;
|
|
48
|
+
/**
|
|
49
|
+
* The current execution configuration for the agent run, which may include configurable parameters, metadata, and other contextual information. This can be used in middleware
|
|
50
|
+
* hooks to make decisions based on the execution context or to store and retrieve information related to the agent run.
|
|
51
|
+
*
|
|
52
|
+
* @since 5.1
|
|
53
|
+
*/
|
|
54
|
+
config?: AgentExecutionConfig;
|
|
55
|
+
/**
|
|
56
|
+
* The name of the current node being executed in the agent's workflow. This can be used in middleware hooks to provide context or make decisions based on the specific node.
|
|
57
|
+
*
|
|
58
|
+
* @since 5.1
|
|
59
|
+
*/
|
|
60
|
+
nodeName: string;
|
|
61
|
+
/**
|
|
62
|
+
* The current state of the agent's workflow, which may include custom data and intermediate results. This can be used in middleware hooks to access or modify the agent's state during execution.
|
|
63
|
+
*
|
|
64
|
+
* @since 5.1
|
|
65
|
+
*/
|
|
66
|
+
state: Partial<AgentGraphState<TCustomState>>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type AgentMiddlewareHandler<TCustomState extends AgentData = EmptyAgentData> = Middleware<AgentRunRequest<TCustomState>, AgentGraphState<TCustomState>>;
|
|
70
|
+
|
|
71
|
+
export interface AgentMiddleware<TCustomState extends AgentData = EmptyAgentData> {
|
|
72
|
+
name: string;
|
|
73
|
+
handler: AgentMiddlewareHandler<TCustomState>;
|
|
74
|
+
hooks?: AgentMiddlewareHooks<TCustomState>;
|
|
75
|
+
outputKey?: keyof AgentGraphState<TCustomState>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AfterAgentRequest<TCustomState extends AgentData = EmptyAgentData> extends AgentRunRequest<TCustomState> {
|
|
79
|
+
result: AgentGraphState<TCustomState>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface AgentMiddlewareHooks<TCustomState extends AgentData = EmptyAgentData> {
|
|
83
|
+
/**
|
|
84
|
+
* An optional hook that is called after the agent has executed, allowing for modification of the result or additional side effects.
|
|
85
|
+
*
|
|
86
|
+
* @param request - The request payload for the afterAgent hook, including the original request and the result of the agent's execution.
|
|
87
|
+
* @returns A partial update to the agent's state or other modifications to be applied to the final result, or a promise that resolves to such an update.
|
|
88
|
+
* @since 5.1
|
|
89
|
+
*/
|
|
90
|
+
afterAgent?(request: AfterAgentRequest<TCustomState>): Partial<AgentGraphState<TCustomState>> | Promise<Partial<AgentGraphState<TCustomState>> | void> | void;
|
|
91
|
+
readonly afterModel?: ModelLifecycleHook;
|
|
92
|
+
readonly beforeModel?: ModelLifecycleHook;
|
|
93
|
+
/**
|
|
94
|
+
* An optional hook that is called before the agent executes, allowing for modification of the request or additional side effects.
|
|
95
|
+
*
|
|
96
|
+
* @param request - The request payload for the beforeAgent hook, including the original request.
|
|
97
|
+
* @returns A partial update to the agent's state or other modifications to be applied to the request, or a promise that resolves to such an update.
|
|
98
|
+
* @since 5.1
|
|
99
|
+
*/
|
|
100
|
+
beforeAgent?(request: AgentRunRequest<TCustomState>): Partial<AgentGraphState<TCustomState>> | Promise<Partial<AgentGraphState<TCustomState>> | void> | void;
|
|
101
|
+
/**
|
|
102
|
+
* An optional hook that wraps the entire agent execution, allowing for complete control over the execution flow.
|
|
103
|
+
*
|
|
104
|
+
* @since 5.1
|
|
105
|
+
*/
|
|
106
|
+
readonly wrapAgent?: AgentMiddlewareHandler<TCustomState>;
|
|
107
|
+
readonly wrapModelCall?: LangChainMiddlewareHooks["wrapModelCall"];
|
|
108
|
+
readonly wrapToolCall?: LangChainMiddlewareHooks["wrapToolCall"];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @since 5.1 */
|
|
112
|
+
export interface ToolMiddlewareHooks<TInput extends AgentData = AgentData, TOutput = unknown> {
|
|
113
|
+
/**
|
|
114
|
+
* Hook that wraps a tool call, allowing you to intercept and modify the request and response of a tool execution. This can be used for logging, modifying inputs/outputs, or implementing custom behavior around tool calls.
|
|
115
|
+
*
|
|
116
|
+
* @since 5.1
|
|
117
|
+
*/
|
|
118
|
+
readonly wrapToolCall?: FunctionToolMiddlewareHandler<TInput, TOutput>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type LangChainMiddlewareHooks = Pick<LangChainAgentMiddleware, "afterModel" | "beforeModel" | "wrapModelCall" | "wrapToolCall">;
|
|
122
|
+
|
|
123
|
+
export type ModelLifecycleHook = NonNullable<LangChainMiddlewareHooks["beforeModel"]>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import type z from "zod";
|
|
3
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
4
|
+
import type { Middleware } from "../middlewares/types.js";
|
|
5
|
+
import type { AgentData, AgentExecutionConfig } from "../types.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Execute function used by `FunctionTool`.
|
|
9
|
+
*
|
|
10
|
+
* @param input - Structured tool input.
|
|
11
|
+
* @param config - Optional execution configuration.
|
|
12
|
+
*/
|
|
13
|
+
export type FunctionToolExecute<TInput extends object, TOutput> = (input: TInput, config?: AgentExecutionConfig) => Promise<TOutput> | TOutput;
|
|
14
|
+
|
|
15
|
+
export type FunctionToolResult<TOutput = unknown> = TOutput | string;
|
|
16
|
+
|
|
17
|
+
export interface FunctionToolMiddlewareRequest<TInput extends AgentData = AgentData> {
|
|
18
|
+
config?: AgentExecutionConfig;
|
|
19
|
+
input: TInput;
|
|
20
|
+
tool: FunctionToolMiddlewareTool;
|
|
21
|
+
toolCallId?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type FunctionToolMiddlewareHandler<TInput extends AgentData = AgentData, TOutput = unknown> = Middleware<FunctionToolMiddlewareRequest<TInput>, FunctionToolResult<TOutput>>;
|
|
25
|
+
|
|
26
|
+
export interface FunctionToolMiddleware<TInput extends AgentData = AgentData, TOutput = unknown> {
|
|
27
|
+
name: string;
|
|
28
|
+
handler: FunctionToolMiddlewareHandler<TInput, TOutput>;
|
|
29
|
+
outputKey?: keyof TInput;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type ToolResultMode = "continue" | "terminal";
|
|
33
|
+
|
|
34
|
+
export interface FunctionToolLike {
|
|
35
|
+
/**
|
|
36
|
+
* Name of the tool, used for invocation by agents. This should be unique among the tools available to an agent.
|
|
37
|
+
*
|
|
38
|
+
* @since 5.1
|
|
39
|
+
*/
|
|
40
|
+
name?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Result mode determines how the agent should treat the output of this tool. If set to "terminal", the agent will return the tool's output directly as its final response. If set to "continue", the agent will continue processing after invoking the tool, allowing for further reasoning or tool calls.
|
|
43
|
+
*
|
|
44
|
+
* @since 5.1
|
|
45
|
+
*/
|
|
46
|
+
resultMode?: ToolResultMode;
|
|
47
|
+
getTool: () => StructuredToolInterface;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* FunctionTool is a tool implementation that allows users to define custom logic through a provided execute function,
|
|
52
|
+
* along with input/output schemas for validation and optional middleware for extensibility.
|
|
53
|
+
*
|
|
54
|
+
* The FunctionTool is passed to LLMAgents as part of their tools array, and can be invoked by the agent during execution
|
|
55
|
+
* based on the agent's prompt and reasoning process. The resultMode property allows the tool to either return
|
|
56
|
+
* a final response directly or continue the agent's processing after execution, providing flexibility in how the tool's
|
|
57
|
+
* output is used within the agent's workflow.
|
|
58
|
+
*
|
|
59
|
+
* @since 5.1
|
|
60
|
+
*/
|
|
61
|
+
export class FunctionTool<TInput extends AgentData, TOutput = unknown> extends Accessor {
|
|
62
|
+
constructor(properties?: FunctionToolConstructProperties<TInput, TOutput>);
|
|
63
|
+
/**
|
|
64
|
+
* A concise, but clear description of the tool's functionality.
|
|
65
|
+
* This should provide enough information for the agent to understand when and why to use the tool.
|
|
66
|
+
* You can include examples of a user's input that would trigger the tool, the values to extract, and
|
|
67
|
+
* sample output to illustrate its purpose.
|
|
68
|
+
*
|
|
69
|
+
* @required
|
|
70
|
+
*/
|
|
71
|
+
accessor description: string;
|
|
72
|
+
/**
|
|
73
|
+
* The execute function contains the custom logic that will be executed when the tool is invoked
|
|
74
|
+
* by an agent. It receives
|
|
75
|
+
* the input object and an optional execution configuration, and returns either a result directly
|
|
76
|
+
* or a promise that resolves to the result.
|
|
77
|
+
*
|
|
78
|
+
* The result is validated against the output schema, if provided.
|
|
79
|
+
*
|
|
80
|
+
* @required
|
|
81
|
+
* @since 5.1
|
|
82
|
+
*/
|
|
83
|
+
accessor execute: FunctionToolExecute<TInput, TOutput>;
|
|
84
|
+
/**
|
|
85
|
+
* The input schema defines the expected structure of the input object when invoking the tool.
|
|
86
|
+
* This should be a Zod schema object.
|
|
87
|
+
* The agent will validate the input against this schema before execution.
|
|
88
|
+
*/
|
|
89
|
+
accessor inputSchema: z.ZodType<TInput> | undefined;
|
|
90
|
+
/** Middleware that can wrap this tool's execution. */
|
|
91
|
+
accessor middlewares: FunctionToolMiddleware<TInput, TOutput>[];
|
|
92
|
+
/**
|
|
93
|
+
* The name of the tool, which will be used to invoke it. This should be unique among the tools
|
|
94
|
+
* available to an agent. It should also be descriptive of the tool's functionality to make it
|
|
95
|
+
* clear to the agent when to use it.
|
|
96
|
+
*
|
|
97
|
+
* @required
|
|
98
|
+
*/
|
|
99
|
+
accessor name: string;
|
|
100
|
+
/**
|
|
101
|
+
* The output schema defines the expected structure of the result returned by the tool.
|
|
102
|
+
* This should be a Zod schema object.
|
|
103
|
+
* The agent will validate the output against this schema after execution.
|
|
104
|
+
*/
|
|
105
|
+
accessor outputSchema: z.ZodType<TOutput> | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* The result mode determines how the agent should treat the output of this tool.
|
|
108
|
+
* If set to `terminal`, the agent will
|
|
109
|
+
* return the tool's output directly as its final response. If set to `continue`,
|
|
110
|
+
* the agent will continue processing after
|
|
111
|
+
* invoking the tool, allowing for further reasoning or tool calls.
|
|
112
|
+
*
|
|
113
|
+
* @default "continue"
|
|
114
|
+
*/
|
|
115
|
+
accessor resultMode: ToolResultMode;
|
|
116
|
+
/** Builds the LangChain tool adapter used by LLM agents. */
|
|
117
|
+
getTool(): StructuredToolInterface;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface FunctionToolMiddlewareTool {
|
|
121
|
+
description: string;
|
|
122
|
+
name: string;
|
|
123
|
+
resultMode: ToolResultMode;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type FunctionToolConstructProperties<TInput extends AgentData, TOutput> = Partial<Pick<FunctionTool<TInput, TOutput>, "inputSchema" | "middlewares" | "outputSchema" | "resultMode">>
|
|
127
|
+
& Pick<FunctionTool<TInput, TOutput>, "description" | "execute" | "name">;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from "@arcgis/core/core/Accessor.js";
|
|
3
|
+
import { property as a, subclass as p } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
4
|
+
import { tool as d } from "@langchain/core/tools";
|
|
5
|
+
var h = Object.defineProperty, m = Object.getOwnPropertyDescriptor, s = (o, t, n, u) => {
|
|
6
|
+
for (var e = u > 1 ? void 0 : u ? m(t, n) : t, i = o.length - 1, l; i >= 0; i--)
|
|
7
|
+
(l = o[i]) && (e = (u ? l(t, n, e) : l(e)) || e);
|
|
8
|
+
return u && e && h(t, n, e), e;
|
|
9
|
+
};
|
|
10
|
+
let r = class extends c {
|
|
11
|
+
//#region Lifecycle
|
|
12
|
+
constructor(o) {
|
|
13
|
+
super(o), this.resultMode = "continue", this.middlewares = [];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region Public Methods
|
|
17
|
+
/**
|
|
18
|
+
* Builds the LangChain tool adapter used by LLM agents.
|
|
19
|
+
*/
|
|
20
|
+
getTool() {
|
|
21
|
+
return d(this._executeWithMiddlewares.bind(this), {
|
|
22
|
+
name: this.name,
|
|
23
|
+
description: this.description,
|
|
24
|
+
returnDirect: this.resultMode === "terminal",
|
|
25
|
+
schema: this.inputSchema
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region Private Methods
|
|
30
|
+
async _executeWithMiddlewares(o, t) {
|
|
31
|
+
const n = async (e) => {
|
|
32
|
+
const i = await this.execute(e.input, e.config);
|
|
33
|
+
return this._validateOutput(i);
|
|
34
|
+
};
|
|
35
|
+
return await this.middlewares.reduceRight(
|
|
36
|
+
(e, i) => async (l) => await i.handler(l, e),
|
|
37
|
+
n
|
|
38
|
+
)({ config: t, input: o, tool: this, toolCallId: f(t) });
|
|
39
|
+
}
|
|
40
|
+
_validateOutput(o) {
|
|
41
|
+
if (!this.outputSchema)
|
|
42
|
+
return o;
|
|
43
|
+
const t = this.outputSchema.safeParse(o);
|
|
44
|
+
if (!t.success)
|
|
45
|
+
throw new Error(`FunctionTool output schema validation failed: ${t.error.message}`);
|
|
46
|
+
return t.data;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
};
|
|
50
|
+
s([
|
|
51
|
+
a()
|
|
52
|
+
], r.prototype, "name", 2);
|
|
53
|
+
s([
|
|
54
|
+
a()
|
|
55
|
+
], r.prototype, "description", 2);
|
|
56
|
+
s([
|
|
57
|
+
a()
|
|
58
|
+
], r.prototype, "resultMode", 2);
|
|
59
|
+
s([
|
|
60
|
+
a()
|
|
61
|
+
], r.prototype, "inputSchema", 2);
|
|
62
|
+
s([
|
|
63
|
+
a()
|
|
64
|
+
], r.prototype, "outputSchema", 2);
|
|
65
|
+
s([
|
|
66
|
+
a()
|
|
67
|
+
], r.prototype, "middlewares", 2);
|
|
68
|
+
s([
|
|
69
|
+
a()
|
|
70
|
+
], r.prototype, "execute", 2);
|
|
71
|
+
r = s([
|
|
72
|
+
p("FunctionTool")
|
|
73
|
+
], r);
|
|
74
|
+
function f(o) {
|
|
75
|
+
const t = o?.toolCall;
|
|
76
|
+
return typeof t?.id == "string" ? t.id : void 0;
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
r as FunctionTool
|
|
80
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type z from "zod";
|
|
2
|
+
import type { BaseChannel, BinaryOperatorAggregate } from "@langchain/langgraph/channels";
|
|
3
|
+
import type { AnnotationRoot, StateDefinitionInit, StateGraph } from "@langchain/langgraph/web";
|
|
4
|
+
import type { AgentExecutionContext, AgentRegistration, AgentStatus } from "../utils/index.js";
|
|
5
|
+
|
|
6
|
+
export type AgentData = Record<string, unknown>;
|
|
7
|
+
|
|
8
|
+
export type EmptyAgentData = Record<never, never>;
|
|
9
|
+
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type ZodModule = {
|
|
12
|
+
z: typeof z;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type SchemaPrimitiveFieldType = "boolean" | "number" | "string";
|
|
16
|
+
|
|
17
|
+
export type SchemaArrayItemDefinition = SchemaFieldDefinition | SchemaPrimitiveFieldType;
|
|
18
|
+
|
|
19
|
+
export type SchemaFieldDefinition = ({
|
|
20
|
+
type: "array";
|
|
21
|
+
itemType: SchemaArrayItemDefinition;
|
|
22
|
+
} | { type: "boolean" | "number"; } | {
|
|
23
|
+
type: "object";
|
|
24
|
+
fields: SchemaDefinition;
|
|
25
|
+
} | {
|
|
26
|
+
type: "string";
|
|
27
|
+
enum?: readonly string[];
|
|
28
|
+
}) & {
|
|
29
|
+
description?: string;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type SchemaDefinition = Record<string, SchemaFieldDefinition>;
|
|
34
|
+
|
|
35
|
+
export type SchemaDefinitionData<TDefinition extends SchemaDefinition> = {
|
|
36
|
+
[K in keyof TDefinition as TDefinition[K] extends { required: true; } ? K : never]: SchemaFieldData<TDefinition[K]>;
|
|
37
|
+
} &
|
|
38
|
+
{
|
|
39
|
+
[K in keyof TDefinition as TDefinition[K] extends { required: true; } ? never : K]?: SchemaFieldData<TDefinition[K]>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @privateRemark All agents are orchestrator-driven, so these channels exist for every agent graph. */
|
|
43
|
+
export type AgentRuntimeState = {
|
|
44
|
+
agentExecutionContext: AgentExecutionContext;
|
|
45
|
+
/** The outputMessage is a string representing the output of an agent execution. */
|
|
46
|
+
outputMessage: string;
|
|
47
|
+
/** The summary is a string providing a brief overview of the agent execution. */
|
|
48
|
+
summary: string;
|
|
49
|
+
/** The status field represents the current status of the agent execution, which can be used to indicate success, failure, or other relevant states. */
|
|
50
|
+
status?: AgentStatus;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type AgentGraphState<TState extends AgentData = EmptyAgentData> = AgentRuntimeState
|
|
54
|
+
& Omit<TState, keyof AgentRuntimeState>;
|
|
55
|
+
|
|
56
|
+
export interface BaseAgentLike<TCustomState extends AgentData = EmptyAgentData> {
|
|
57
|
+
/**
|
|
58
|
+
* Stable ID derived from the agent name and used for graph node and registration identity.
|
|
59
|
+
*
|
|
60
|
+
* @since 5.1
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
/**
|
|
64
|
+
* Optional schema used to validate and shape agent input state.
|
|
65
|
+
*
|
|
66
|
+
* @since 5.1
|
|
67
|
+
*/
|
|
68
|
+
inputSchema?: ZodObjectSchema<object>;
|
|
69
|
+
/**
|
|
70
|
+
* Human-readable name shown in registration metadata and tooling.
|
|
71
|
+
*
|
|
72
|
+
* @since 5.1
|
|
73
|
+
*/
|
|
74
|
+
name: string;
|
|
75
|
+
/**
|
|
76
|
+
* Optional schema used to validate structured agent output.
|
|
77
|
+
*
|
|
78
|
+
* @since 5.1
|
|
79
|
+
*/
|
|
80
|
+
outputSchema?: ZodObjectSchema<object>;
|
|
81
|
+
/**
|
|
82
|
+
* Registration payload consumed by the orchestrator.
|
|
83
|
+
*
|
|
84
|
+
* @since 5.1
|
|
85
|
+
*/
|
|
86
|
+
registration: AgentRegistration;
|
|
87
|
+
/** Regenerates workspace and graph wiring for this agent. */
|
|
88
|
+
generate: () => void;
|
|
89
|
+
/** Returns all schemas the agent contributes to state/input/output validation. */
|
|
90
|
+
getSchemas: () => ZodObjectSchema<object>[];
|
|
91
|
+
/**
|
|
92
|
+
* Executes the compiled graph for this agent.
|
|
93
|
+
*
|
|
94
|
+
* @param state - Optional partial state used as graph input.
|
|
95
|
+
* @param config - Optional runtime execution configuration.
|
|
96
|
+
* @return The resulting graph state after execution.
|
|
97
|
+
* @since 5.1
|
|
98
|
+
*/
|
|
99
|
+
run(state?: Partial<AgentGraphState<TCustomState>>, config?: AgentExecutionConfig): Promise<AgentGraphState<TCustomState>>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** AgentExecutionConfig defines the shape of the configuration object that can be passed to agent execution methods to influence their behavior at runtime. */
|
|
103
|
+
export interface AgentExecutionConfig {
|
|
104
|
+
/**
|
|
105
|
+
* The configurable field allows passing arbitrary key-value pairs that can be used by agents during execution to modify their behavior or provide additional context.
|
|
106
|
+
* This can include flags, parameters, or any other relevant information that an agent might need to access at runtime.
|
|
107
|
+
*
|
|
108
|
+
* @since 5.1
|
|
109
|
+
*/
|
|
110
|
+
configurable?: Record<string, unknown>;
|
|
111
|
+
metadata?: Record<string, unknown>;
|
|
112
|
+
recursionLimit?: number;
|
|
113
|
+
runName?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The signal property is an optional AbortSignal that can be used to cancel the execution of an agent. Agents should listen for the abort signal and gracefully handle cancellation when it is triggered.
|
|
116
|
+
*
|
|
117
|
+
* @since 5.1
|
|
118
|
+
*/
|
|
119
|
+
signal?: AbortSignal;
|
|
120
|
+
tags?: string[];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type AgentCustomState<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> = Omit<TInput, keyof AgentRuntimeState>
|
|
124
|
+
& Partial<Omit<TOutput, keyof AgentRuntimeState>>;
|
|
125
|
+
|
|
126
|
+
export type AgentNodeState<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> = AgentGraphState<AgentCustomState<TInput, TOutput>>;
|
|
127
|
+
|
|
128
|
+
export type AgentNodeUpdate<TInput extends AgentData, TOutput extends AgentData> = Partial<AgentNodeState<TInput, TOutput>>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* AgentStateAnnotation defines the shape of the agent state used in LangGraph nodes, including both the built-in runtime channels
|
|
132
|
+
* and any custom fields defined by the agent.
|
|
133
|
+
*
|
|
134
|
+
* @since 5.1
|
|
135
|
+
*/
|
|
136
|
+
export type AgentStateAnnotation<TState extends AgentData> = AnnotationRoot<{
|
|
137
|
+
[K in keyof TState]: BinaryOperatorAggregate<TState[K] | undefined, TState[K] | undefined>;
|
|
138
|
+
} & {
|
|
139
|
+
agentExecutionContext: BaseChannel<AgentExecutionContext, unknown, unknown>;
|
|
140
|
+
outputMessage: BaseChannel<string, unknown, unknown>;
|
|
141
|
+
summary: BaseChannel<string, unknown, unknown>;
|
|
142
|
+
status: BaseChannel<AgentStatus | undefined, unknown, unknown>;
|
|
143
|
+
}>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* State update shape produced by graph nodes.
|
|
147
|
+
*
|
|
148
|
+
* @since 5.1
|
|
149
|
+
*/
|
|
150
|
+
export type RunnableUpdate<TState extends AgentData> = Partial<TState> extends object ? Partial<TState> & Record<string, any> : Partial<TState>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Internal type representing the compiled graph used for agent execution.
|
|
154
|
+
*
|
|
155
|
+
* @since 5.1
|
|
156
|
+
*/
|
|
157
|
+
export type TypedStateGraph<TState extends AgentData> = StateGraph<StateDefinitionInit, AgentGraphState<TState>, RunnableUpdate<AgentGraphState<TState>>, string>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The shape of the `createGraph` function used by agents to generate their internal graph representation.
|
|
161
|
+
* This function is responsible for defining the nodes and edges of the graph, as well as any associated state and middleware.
|
|
162
|
+
*
|
|
163
|
+
* @since 5.1
|
|
164
|
+
*/
|
|
165
|
+
export type AgentCreateGraph<TState extends AgentData> = () => TypedStateGraph<TState>;
|
|
166
|
+
|
|
167
|
+
/** ZodObjectSchema is a simplified type representing Zod object schemas used for input and output validation in agents. */
|
|
168
|
+
export type ZodObjectSchema<T extends object = AgentData> = Pick<z.ZodType<T>, "safeParse">
|
|
169
|
+
& z.ZodObject;
|
|
170
|
+
|
|
171
|
+
export type GraphNodes<S extends AgentData> = Record<string, (state: S, config?: AgentExecutionConfig) => Partial<S> | Promise<Partial<S> | S> | S>;
|
|
172
|
+
|
|
173
|
+
export type GraphEdge<S extends AgentData> = {
|
|
174
|
+
from: string;
|
|
175
|
+
decide: (state: S, config?: AgentExecutionConfig) => Promise<string | undefined> | string | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
from: string;
|
|
178
|
+
to: string;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type SchemaFieldData<TField extends SchemaFieldDefinition> = TField extends { type: "string"; } ? TField["enum"] extends readonly (infer TValue extends string)[] ? TValue : string : TField extends { type: "array"; } ? (TField["itemType"] extends "string" ? string : TField["itemType"] extends "number" ? number : TField["itemType"] extends "boolean" ? boolean : TField["itemType"] extends SchemaFieldDefinition ? SchemaFieldData<TField["itemType"]> : never)[] : TField extends { type: "object"; } ? SchemaDefinitionData<TField["fields"]> : TField extends { type: "number"; } ? number : boolean;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import type { AgentCreateGraph, AgentData, AgentGraphState, AgentStateAnnotation, BaseAgentLike, GraphEdge, GraphNodes } from "../types.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Return payload from `BaseWorkflow.generate()`.
|
|
6
|
+
*
|
|
7
|
+
* @since 5.1
|
|
8
|
+
*/
|
|
9
|
+
export type WorkflowGenerateResult<TState extends AgentData = AgentData> = {
|
|
10
|
+
/**
|
|
11
|
+
* Shared workflow state annotation.
|
|
12
|
+
*
|
|
13
|
+
* @since 5.1
|
|
14
|
+
*/
|
|
15
|
+
workspace: AgentStateAnnotation<TState>;
|
|
16
|
+
/**
|
|
17
|
+
* Factory that creates the workflow graph.
|
|
18
|
+
*
|
|
19
|
+
* @since 5.1
|
|
20
|
+
*/
|
|
21
|
+
createGraph: AgentCreateGraph<TState>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* BaseWorkflow is the foundational class for defining workflows. A workflow defines a sequence of
|
|
26
|
+
* agents that work together to accomplish a task. This class provides the structure and common
|
|
27
|
+
* building blocks for constructing a workflow, including generating the shared workspace and
|
|
28
|
+
* creating the graph that defines how agents are connected and executed.
|
|
29
|
+
*
|
|
30
|
+
* Specific workflows extend this base class and implement the abstract methods to define
|
|
31
|
+
* their unique behavior and structure.
|
|
32
|
+
*
|
|
33
|
+
* The following workflow types are supported:
|
|
34
|
+
*
|
|
35
|
+
* - `SequentialWorkflow` - executes agents in a sequence, where the output of one agent can be passed as input to the next.
|
|
36
|
+
* - `ConditionalWorkflow` - allows for branching logic based on conditions evaluated at runtime, enabling different paths of execution depending on user input or LLM output.
|
|
37
|
+
* - `LoopWorkflow` - supports repeating a set of agents until a certain condition is met, useful for iterative processes.
|
|
38
|
+
* - `ParallelWorkflow` - enables concurrent execution of multiple agents, allowing for tasks that can be performed simultaneously.
|
|
39
|
+
* - `RouterWorkflow` - dynamically routes execution to different agents based on the input or state, providing flexibility in handling various scenarios.
|
|
40
|
+
* - `SwitchWorkflow` - similar to RouterWorkflow but designed for cases where there are multiple distinct paths based on discrete values in the input or state.
|
|
41
|
+
*
|
|
42
|
+
* @since 5.1
|
|
43
|
+
*/
|
|
44
|
+
export abstract class BaseWorkflow<TState extends AgentData = AgentData> extends Accessor {
|
|
45
|
+
/**
|
|
46
|
+
* Builds the workflow-specific edges.
|
|
47
|
+
*
|
|
48
|
+
* @param agents
|
|
49
|
+
*/
|
|
50
|
+
protected abstract buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[];
|
|
51
|
+
/**
|
|
52
|
+
* Builds the workflow's graph nodes.
|
|
53
|
+
*
|
|
54
|
+
* Node ids use the agent id plus its position (`agent.id_index`) instead of only the raw
|
|
55
|
+
* agent id. That prevents collisions when the same agent instance is used multiple times.
|
|
56
|
+
*
|
|
57
|
+
* @param agents
|
|
58
|
+
*/
|
|
59
|
+
protected buildNodes(agents: BaseAgentLike<TState>[]): GraphNodes<AgentGraphState<TState>>;
|
|
60
|
+
/**
|
|
61
|
+
* Generates the workflow's graph and shared workspace based on the defined agents and their schemas. This method is
|
|
62
|
+
* called by the WorkflowAgent when it generates its graph, and it orchestrates the creation of the workflow's structure,
|
|
63
|
+
* including validating the agents, deriving shared state from their schemas, and building the nodes and edges of the graph.
|
|
64
|
+
*/
|
|
65
|
+
generate(): WorkflowGenerateResult<TState>;
|
|
66
|
+
/** A list of agents that are part of this workflow. */
|
|
67
|
+
abstract getAgents(): BaseAgentLike<TState>[];
|
|
68
|
+
/**
|
|
69
|
+
* Returns the id of the first node in the workflow graph.
|
|
70
|
+
*
|
|
71
|
+
* @param agents
|
|
72
|
+
*/
|
|
73
|
+
protected abstract getEntryNode(agents: BaseAgentLike<TState>[]): string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Returns whether the agent at this position should expose terminal runtime fields.
|
|
76
|
+
*
|
|
77
|
+
* @param agents
|
|
78
|
+
* @param index
|
|
79
|
+
*/
|
|
80
|
+
protected abstract isTerminalAgent(agents: BaseAgentLike<TState>[], index: number): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Validates the workflow configuration and throws if invalid.
|
|
83
|
+
*
|
|
84
|
+
* @param agents
|
|
85
|
+
*/
|
|
86
|
+
protected validateAgents(agents: BaseAgentLike<TState>[]): void;
|
|
87
|
+
}
|