From af8bb924dffd1eabd40dcc9ace36dc43fb43690b Mon Sep 17 00:00:00 2001 From: synw Date: Thu, 29 Feb 2024 20:20:33 +0100 Subject: [PATCH] Update doc site --- .../{404-DB4RCoYk.js => 404-CIDC4a3t.js} | 2 +- docsite/dist/assets/AgentBaseText-CKc0rlXU.js | 1 - ...ue_vue_type_style_index_0_lang-BZstlpzB.js | 7 -- ...ue_vue_type_style_index_0_lang-ZpFNV89y.js | 1 + ...Icon-BQcGCiSa.js => RobotIcon-BcM7qFfK.js} | 2 +- docsite/dist/assets/_...all_-A115OCNp.js | 1 + docsite/dist/assets/_...all_-BnoIKx1K.js | 1 - docsite/dist/assets/agent-BFtiMqbc.js | 1 - docsite/dist/assets/agent-g-a1HYAK.js | 1 + ...{agent4-BJpk0o6T.js => agent4-DI-4r85N.js} | 2 +- docsite/dist/assets/basic_agent-CE2BXJjK.js | 19 ----- docsite/dist/assets/basic_agent-o7xRzjte.js | 19 +++++ ...{basics-u_Zfw9v1.js => basics-B1Q_zC_x.js} | 2 +- docsite/dist/assets/basics-BVs7cz0C.js | 44 ---------- docsite/dist/assets/basics-MeJxDHM2.js | 44 ++++++++++ docsite/dist/assets/components-1x60JWfr.js | 3 + docsite/dist/assets/confirm-CGf_9-bJ.js | 45 +++++++++++ docsite/dist/assets/confirm-Sv0BfT0R.js | 42 ---------- .../dist/assets/dynamic_component-C4exe7QW.js | 24 ------ ...hots-DSv0PT7s.js => few_shots-CBQKk4cO.js} | 2 +- docsite/dist/assets/grammars-BooBsAXp.js | 27 +++++++ docsite/dist/assets/grammars-CmNuBFfJ.js | 27 ------- ...istory-6JL786za.js => history-bdsNvjaz.js} | 2 +- docsite/dist/assets/index-BRk7anpM.js | 68 ++++++++++++++++ docsite/dist/assets/index-CboZIT6v.js | 68 ---------------- .../{index-BZxdWYOY.js => index-iXfWNpia.js} | 2 +- ...{index-Ca35mPyh.css => index-kQO-B8fS.css} | 2 +- .../assets/{lm-BizhkHiD.js => lm-mqbLQnkx.js} | 2 +- ...l1bvQw.js => multiple_experts-BkrluoTF.js} | 2 +- docsite/dist/assets/talk-B_hGtsV0.js | 49 ++++++++++++ docsite/dist/assets/talk-DpM7kKfs.js | 49 ------------ ...m-D2yOeTtn.js => textarea.esm-Bm0AQBLZ.js} | 2 +- docsite/dist/assets/utils-DZ37F4NF.js | 1 + docsite/dist/doc/nav.json | 2 +- ...dynamic_component.cmp => 2.components.cmp} | 0 docsite/dist/index.html | 4 +- docsite/package.json | 2 +- docsite/public/doc/nav.json | 2 +- ...dynamic_component.cmp => 2.components.cmp} | 0 docsite/src/agent/AgentJoeV3.vue | 33 ++------ docsite/src/agent/agent.ts | 2 +- .../the_body/interactions/components.vue | 46 +++++++++++ .../pages/the_body/interactions/confirm.vue | 9 +++ .../interactions/dynamic_component.vue | 80 ------------------- .../src/pages/the_body/interactions/talk.vue | 4 +- docsite/src/pages/the_brain/basics.vue | 29 ++++--- docsite/src/pages/the_brain/grammars.vue | 17 ++-- docsite/src/pages/the_brain/utils.ts | 15 ++++ 48 files changed, 381 insertions(+), 428 deletions(-) rename docsite/dist/assets/{404-DB4RCoYk.js => 404-CIDC4a3t.js} (79%) delete mode 100644 docsite/dist/assets/AgentBaseText-CKc0rlXU.js delete mode 100644 docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-BZstlpzB.js create mode 100644 docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-ZpFNV89y.js rename docsite/dist/assets/{RobotIcon-BQcGCiSa.js => RobotIcon-BcM7qFfK.js} (95%) create mode 100644 docsite/dist/assets/_...all_-A115OCNp.js delete mode 100644 docsite/dist/assets/_...all_-BnoIKx1K.js delete mode 100644 docsite/dist/assets/agent-BFtiMqbc.js create mode 100644 docsite/dist/assets/agent-g-a1HYAK.js rename docsite/dist/assets/{agent4-BJpk0o6T.js => agent4-DI-4r85N.js} (62%) delete mode 100644 docsite/dist/assets/basic_agent-CE2BXJjK.js create mode 100644 docsite/dist/assets/basic_agent-o7xRzjte.js rename docsite/dist/assets/{basics-u_Zfw9v1.js => basics-B1Q_zC_x.js} (96%) delete mode 100644 docsite/dist/assets/basics-BVs7cz0C.js create mode 100644 docsite/dist/assets/basics-MeJxDHM2.js create mode 100644 docsite/dist/assets/components-1x60JWfr.js create mode 100644 docsite/dist/assets/confirm-CGf_9-bJ.js delete mode 100644 docsite/dist/assets/confirm-Sv0BfT0R.js delete mode 100644 docsite/dist/assets/dynamic_component-C4exe7QW.js rename docsite/dist/assets/{few_shots-DSv0PT7s.js => few_shots-CBQKk4cO.js} (92%) create mode 100644 docsite/dist/assets/grammars-BooBsAXp.js delete mode 100644 docsite/dist/assets/grammars-CmNuBFfJ.js rename docsite/dist/assets/{history-6JL786za.js => history-bdsNvjaz.js} (94%) create mode 100644 docsite/dist/assets/index-BRk7anpM.js delete mode 100644 docsite/dist/assets/index-CboZIT6v.js rename docsite/dist/assets/{index-BZxdWYOY.js => index-iXfWNpia.js} (55%) rename docsite/dist/assets/{index-Ca35mPyh.css => index-kQO-B8fS.css} (92%) rename docsite/dist/assets/{lm-BizhkHiD.js => lm-mqbLQnkx.js} (99%) rename docsite/dist/assets/{multiple_experts-B2l1bvQw.js => multiple_experts-BkrluoTF.js} (97%) create mode 100644 docsite/dist/assets/talk-B_hGtsV0.js delete mode 100644 docsite/dist/assets/talk-DpM7kKfs.js rename docsite/dist/assets/{textarea.esm-D2yOeTtn.js => textarea.esm-Bm0AQBLZ.js} (99%) create mode 100644 docsite/dist/assets/utils-DZ37F4NF.js rename docsite/dist/doc/the_body/interactions/{2.dynamic_component.cmp => 2.components.cmp} (100%) rename docsite/public/doc/the_body/interactions/{2.dynamic_component.cmp => 2.components.cmp} (100%) create mode 100644 docsite/src/pages/the_body/interactions/components.vue delete mode 100644 docsite/src/pages/the_body/interactions/dynamic_component.vue create mode 100644 docsite/src/pages/the_brain/utils.ts diff --git a/docsite/dist/assets/404-DB4RCoYk.js b/docsite/dist/assets/404-CIDC4a3t.js similarity index 79% rename from docsite/dist/assets/404-DB4RCoYk.js rename to docsite/dist/assets/404-CIDC4a3t.js index 10454a0..93a6abc 100644 --- a/docsite/dist/assets/404-DB4RCoYk.js +++ b/docsite/dist/assets/404-CIDC4a3t.js @@ -1 +1 @@ -import{_ as e}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c as o,o as t,a as s}from"./index-CboZIT6v.js";const c={},a={class:"flex justify-around h-full w-full"},n=s("div",{class:"text-3xl"},"Page not found",-1),_=[n];function r(f,l){return t(),o("div",a,_)}const u=e(c,[["render",r]]);export{u as default}; +import{_ as e}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c as o,o as t,a as s}from"./index-BRk7anpM.js";const c={},a={class:"flex justify-around h-full w-full"},n=s("div",{class:"text-3xl"},"Page not found",-1),_=[n];function r(f,l){return t(),o("div",a,_)}const u=e(c,[["render",r]]);export{u as default}; diff --git a/docsite/dist/assets/AgentBaseText-CKc0rlXU.js b/docsite/dist/assets/AgentBaseText-CKc0rlXU.js deleted file mode 100644 index a968481..0000000 --- a/docsite/dist/assets/AgentBaseText-CKc0rlXU.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./agent-BFtiMqbc.js";import{d as t,o as n,c as o,u as r}from"./index-CboZIT6v.js";import"./lm-BizhkHiD.js";import"./index-BZxdWYOY.js";const a=["innerHTML"],f=t({__name:"AgentBaseText",setup(s){return(c,i)=>(n(),o("div",{innerHTML:r(e).text},null,8,a))}});export{f as default}; diff --git a/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-BZstlpzB.js b/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-BZstlpzB.js deleted file mode 100644 index fca31ef..0000000 --- a/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-BZstlpzB.js +++ /dev/null @@ -1,7 +0,0 @@ -import{d as v,h as b,j as k,o as t,c as r,u as s,F as x,k as h,l as C,f as u,e as T,n as I,m as _,_ as p}from"./index-CboZIT6v.js";import{j as o,a as f}from"./agent-BFtiMqbc.js";import{R}from"./RobotIcon-BQcGCiSa.js";const V={class:"fixed bottom-12 right-8 flex flex-row items-end z-50"},A={key:0,class:"bubble bubble-bottom-left mr-5 txt-light"},D=v({__name:"AgentJoeV3",setup(E){let a=_(()=>p(()=>import("./AgentBaseText-CKc0rlXU.js"),__vite__mapDeps([0,1,2,3,4,5])));const g=b(()=>{let e="txt-lighter";return o.value.isRunningJob?e="txt-semilight":o.value.isRunningTask?e="txt-success":o.value.isInteracting&&(e="txt-light"),e}),d=f.state.listen((e,n,i)=>{var l,c;if(i=="component"&&(console.log("** component:",n.component,e.component),e.component!="")){let m=e.component;e.component.endsWith(".vue")||(m=e.component+".vue"),a=_(()=>p(()=>import(`./widgets/${m}`),__vite__mapDeps([])))}i=="runningTask"&&console.log("** runningTask:",(l=n.runningTask)==null?void 0:l.name,"=>",(c=e.runningTask)==null?void 0:c.name)});return k(()=>{d()}),(e,n)=>(t(),r("div",V,[s(o).isVisible?(t(),r(x,{key:0},[s(o).isInteracting===!0?(t(),r("div",A,[(t(),h(C(s(a))))])):u("",!0),T(R,{class:I(["text-5xl cursor-pointer",g.value]),onClick:n[0]||(n[0]=i=>s(f).toggleInteract())},null,8,["class"])],64)):u("",!0)]))}});export{D as _}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/AgentBaseText-CKc0rlXU.js","assets/agent-BFtiMqbc.js","assets/lm-BizhkHiD.js","assets/index-CboZIT6v.js","assets/index-Ca35mPyh.css","assets/index-BZxdWYOY.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} diff --git a/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-ZpFNV89y.js b/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-ZpFNV89y.js new file mode 100644 index 0000000..b6a88a1 --- /dev/null +++ b/docsite/dist/assets/AgentJoeV3.vue_vue_type_style_index_0_lang-ZpFNV89y.js @@ -0,0 +1 @@ +import{j as e,a as u}from"./agent-g-a1HYAK.js";import{R as d}from"./RobotIcon-BcM7qFfK.js";import{d as m,o as n,c as i,u as s,a as c,h as g,F as p,l as f,f as l,e as b,n as v}from"./index-BRk7anpM.js";const k=["innerHTML"],h=m({__name:"AgentBaseText",setup(_){return(r,t)=>(n(),i("div",{innerHTML:s(e).text},null,8,k))}}),C={class:"flex flex-col"},$=["innerHTML"],A={class:"flex flex-row mt-3 space-x-2 text-sm"},T=m({__name:"AgentConfirm",setup(_){function r(){u.interactions.get().decline()}function t(){u.interactions.get().confirm()}return(a,o)=>(n(),i("div",C,[c("div",{innerHTML:s(e).text},null,8,$),c("div",A,[c("button",{class:"btn warning",onClick:o[0]||(o[0]=x=>r())},"No"),c("button",{class:"btn success",onClick:o[1]||(o[1]=x=>t())},"Yes")])]))}}),B={class:"fixed bottom-12 right-8 flex flex-row items-end z-50"},V={key:0,class:"bubble bubble-bottom-left mr-5 txt-light"},L=m({__name:"AgentJoeV3",setup(_){const r=g(()=>{let t="txt-lighter";return e.value.isRunningJob?t="txt-semilight":e.value.isRunningTask?t="txt-success":e.value.isInteracting&&(t="txt-light"),t});return(t,a)=>(n(),i("div",B,[s(e).isVisible?(n(),i(p,{key:0},[s(e).isInteracting===!0?(n(),i("div",V,[s(e).component=="AgentBaseText"?(n(),f(h,{key:0})):s(e).component=="AgentConfirm"?(n(),f(T,{key:1})):l("",!0)])):l("",!0),b(d,{class:v(["text-5xl cursor-pointer",r.value]),onClick:a[0]||(a[0]=o=>s(u).toggleInteract())},null,8,["class"])],64)):l("",!0)]))}});export{L as _}; diff --git a/docsite/dist/assets/RobotIcon-BQcGCiSa.js b/docsite/dist/assets/RobotIcon-BcM7qFfK.js similarity index 95% rename from docsite/dist/assets/RobotIcon-BQcGCiSa.js rename to docsite/dist/assets/RobotIcon-BcM7qFfK.js index 3b5becb..0ae496a 100644 --- a/docsite/dist/assets/RobotIcon-BQcGCiSa.js +++ b/docsite/dist/assets/RobotIcon-BcM7qFfK.js @@ -1 +1 @@ -import{_ as c}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o,c as e,a as t}from"./index-CboZIT6v.js";const s={},r={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512"},n=t("path",{fill:"currentColor",d:"M512 310.829v-73.154c-3.616-38.626-31.154-38.29-73.143-36.576v146.306c67.411 7.006 70.837-19.505 73.143-36.576M73.143 347.405V201.1C31.153 199.386 3.616 199.05 0 237.676v73.154c2.306 17.07 5.732 43.582 73.143 36.576m-54.857 91.442h475.428V512H18.286zM328.32 73.08c-11.526-94.655-130.877-100.188-144.64 0zM21.482 32.86c9.852-18.592 36.27-19.676 47.438-1.947c9.628 15.282 1.753 34.795-14.068 40.43l.005 111.467H36.571V71.394C21.558 66.182 13.321 48.26 21.482 32.86m325.947 195.67c0 21.04-22.93 34.26-41.174 23.74c-18.245-10.519-18.245-36.96 0-47.48s41.174 2.7 41.174 23.74m-169.174 23.74c18.244 10.52 41.174-2.7 41.174-23.74s-22.93-34.26-41.174-23.74c-18.245 10.52-18.245 36.961 0 47.48m242.316-87.749V420.56H91.43V164.522c0-40.399 32.75-73.153 73.142-73.153H347.43c40.393 0 73.142 32.754 73.142 73.153M169.091 268.1c30.408 17.532 68.623-4.502 68.623-39.568c0-35.065-38.215-57.1-68.623-39.567s-30.407 61.602 0 79.135m178.338 61.018H164.57v36.577h182.86zm18.285-100.586c0-35.065-38.215-57.1-68.623-39.567s-30.407 61.602 0 79.135c30.408 17.532 68.623-4.502 68.623-39.568"},null,-1),m=[n];function _(a,h){return o(),e("svg",r,m)}const d=c(s,[["render",_]]);export{d as R}; +import{_ as c}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o,c as e,a as t}from"./index-BRk7anpM.js";const s={},r={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512"},n=t("path",{fill:"currentColor",d:"M512 310.829v-73.154c-3.616-38.626-31.154-38.29-73.143-36.576v146.306c67.411 7.006 70.837-19.505 73.143-36.576M73.143 347.405V201.1C31.153 199.386 3.616 199.05 0 237.676v73.154c2.306 17.07 5.732 43.582 73.143 36.576m-54.857 91.442h475.428V512H18.286zM328.32 73.08c-11.526-94.655-130.877-100.188-144.64 0zM21.482 32.86c9.852-18.592 36.27-19.676 47.438-1.947c9.628 15.282 1.753 34.795-14.068 40.43l.005 111.467H36.571V71.394C21.558 66.182 13.321 48.26 21.482 32.86m325.947 195.67c0 21.04-22.93 34.26-41.174 23.74c-18.245-10.519-18.245-36.96 0-47.48s41.174 2.7 41.174 23.74m-169.174 23.74c18.244 10.52 41.174-2.7 41.174-23.74s-22.93-34.26-41.174-23.74c-18.245 10.52-18.245 36.961 0 47.48m242.316-87.749V420.56H91.43V164.522c0-40.399 32.75-73.153 73.142-73.153H347.43c40.393 0 73.142 32.754 73.142 73.153M169.091 268.1c30.408 17.532 68.623-4.502 68.623-39.568c0-35.065-38.215-57.1-68.623-39.567s-30.407 61.602 0 79.135m178.338 61.018H164.57v36.577h182.86zm18.285-100.586c0-35.065-38.215-57.1-68.623-39.567s-30.407 61.602 0 79.135c30.408 17.532 68.623-4.502 68.623-39.568"},null,-1),m=[n];function _(a,h){return o(),e("svg",r,m)}const d=c(s,[["render",_]]);export{d as R}; diff --git a/docsite/dist/assets/_...all_-A115OCNp.js b/docsite/dist/assets/_...all_-A115OCNp.js new file mode 100644 index 0000000..024584a --- /dev/null +++ b/docsite/dist/assets/_...all_-A115OCNp.js @@ -0,0 +1 @@ +import{d as n,o as s,l,u as e,H as o,C as t,D as r,_ as u}from"./index-BRk7anpM.js";const h=n({__name:"[...all]",setup(p){return(a,i)=>(s(),l(e(u),{hljs:e(o),nav:e(t),url:a.$route.path,"on-open":a.$router.push,"base-title":e(r)},null,8,["hljs","nav","url","on-open","base-title"]))}});export{h as default}; diff --git a/docsite/dist/assets/_...all_-BnoIKx1K.js b/docsite/dist/assets/_...all_-BnoIKx1K.js deleted file mode 100644 index 21a2cf8..0000000 --- a/docsite/dist/assets/_...all_-BnoIKx1K.js +++ /dev/null @@ -1 +0,0 @@ -import{d as n,o as s,k as o,u as e,H as t,G as l,I as r,J as u}from"./index-CboZIT6v.js";const _=n({__name:"[...all]",setup(p){return(a,i)=>(s(),o(e(u),{hljs:e(t),nav:e(l),url:a.$route.path,"on-open":a.$router.push,"base-title":e(r)},null,8,["hljs","nav","url","on-open","base-title"]))}});export{_ as default}; diff --git a/docsite/dist/assets/agent-BFtiMqbc.js b/docsite/dist/assets/agent-BFtiMqbc.js deleted file mode 100644 index 807b04f..0000000 --- a/docsite/dist/assets/agent-BFtiMqbc.js +++ /dev/null @@ -1 +0,0 @@ -import{u as s,a as o,b as n}from"./lm-BizhkHiD.js";import{u as a}from"./index-BZxdWYOY.js";const r=s({name:"default",localLm:"koboldcpp",templateName:"mistral"}),t=o([r]),m=n({name:"Joe",modules:[t]}),u=a(m.state),e=t.brain,b=a(e.state),l=a(e.stream);export{m as a,l as b,e as c,b as d,u as j}; diff --git a/docsite/dist/assets/agent-g-a1HYAK.js b/docsite/dist/assets/agent-g-a1HYAK.js new file mode 100644 index 0000000..d1a7fbc --- /dev/null +++ b/docsite/dist/assets/agent-g-a1HYAK.js @@ -0,0 +1 @@ +import{u as s,a as o,b as n}from"./lm-mqbLQnkx.js";import{u as a}from"./index-iXfWNpia.js";const r=s({name:"default",localLm:"koboldcpp",templateName:"zephyr"}),e=o([r]),m=n({name:"Joe",modules:[e]}),p=a(m.state),t=e.brain,u=a(t.state),b=a(t.stream);export{m as a,b,t as c,u as d,p as j}; diff --git a/docsite/dist/assets/agent4-BJpk0o6T.js b/docsite/dist/assets/agent4-DI-4r85N.js similarity index 62% rename from docsite/dist/assets/agent4-BJpk0o6T.js rename to docsite/dist/assets/agent4-DI-4r85N.js index a7370cf..26d1331 100644 --- a/docsite/dist/assets/agent4-BJpk0o6T.js +++ b/docsite/dist/assets/agent4-DI-4r85N.js @@ -1 +1 @@ -import{u as e,a,b as o}from"./lm-BizhkHiD.js";const t=e({name:"default",localLm:"koboldcpp",templateName:"alpaca"}),s=a([t]),n=o({name:"Joe",modules:[s]});export{n as j}; +import{u as e,a,b as o}from"./lm-mqbLQnkx.js";const t=e({name:"default",localLm:"koboldcpp",templateName:"alpaca"}),s=a([t]),n=o({name:"Joe",modules:[s]});export{n as j}; diff --git a/docsite/dist/assets/basic_agent-CE2BXJjK.js b/docsite/dist/assets/basic_agent-CE2BXJjK.js deleted file mode 100644 index 959d519..0000000 --- a/docsite/dist/assets/basic_agent-CE2BXJjK.js +++ /dev/null @@ -1,19 +0,0 @@ -import{d,o as l,c as h,u as t,k as p,f as g,a as e,e as s,H as a,M as i,g as o,t as b,z as _}from"./index-CboZIT6v.js";import{j as r,a as c}from"./agent-BFtiMqbc.js";import{R as v}from"./RobotIcon-BQcGCiSa.js";import"./lm-BizhkHiD.js";import"./index-BZxdWYOY.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const f={class:"fixed bottom-12 right-8 z-50"},j=d({__name:"AgentJoe",setup(m){return(u,n)=>(l(),h("div",f,[t(r).isVisible?(l(),p(v,{key:0,class:"text-5xl cursor-pointer"})):g("",!0)]))}}),x=_('

Basic Agent

The body of Agent Smith can interact with the user. Note: we use Vuejs and Tailwindcss for the UI code examples.

Note: the interactivity bindings are managed with Nanostores. Install the integration for your framework, here we will use @nanostores/vue for the examples below.

',1),S={class:"flex flex-col space-y-5 mt-5"},k=e("p",null,[o("Let's create a basic agent named Joe in a "),e("kbd",null,"agent/agent.ts"),o(" file:")],-1),w=e("div",null,[o("The "),e("kbd",null,"joeState"),o(" variable will be used to manage the UI interactivity. Now give let's our agent a body in a "),e("kbd",null,"agent/AgentJoe.vue"),o(" file. In the script part:")],-1),V=e("div",null,"In the template part:",-1),y=e("div",{class:"prose"},[e("h2",null,"Interactions"),e("h3",null,"Show / hide")],-1),N={class:"mt-3"},I=e("div",{class:"pt-5"},[e("a",{href:"javascript:openLink('/the_body/interactions/talk')"},"Next: the talk interaction")],-1),J=`import { useAgentSmith } from "@agent-smith/body"; -import { useStore } from '@nanostores/vue' - -const joe = useAgentSmith({ name: "Joe" }); -const joeState = useStore(joe.state); - -export { joe, joeState }`,A=`import { joe } from "./agent"; -import RobotIcon from "../widgets/RobotIcon.vue";`,T=``,B=` -
- Joe is visible: {{ joeState.isVisible }} -
`,U=d({__name:"basic_agent",setup(m){return(u,n)=>(l(),h("div",null,[x,e("div",S,[k,s(t(i),{hljs:t(a),code:J,lang:"ts"},null,8,["hljs"]),w,e("div",null,[s(t(i),{hljs:t(a),code:A,lang:"ts"},null,8,["hljs"])]),V,e("div",null,[s(t(i),{hljs:t(a),code:T,lang:"html"},null,8,["hljs"])]),y,e("div",null,[e("button",{class:"btn light",onClick:n[0]||(n[0]=R=>{t(r).isVisible?t(c).hide():t(c).show()})},"Toggle Joe"),e("div",N,[o("Joe is visible: "),e("code",null,b(t(r).isVisible),1)])]),e("div",null,[s(t(i),{hljs:t(a),code:B,lang:"html"},null,8,["hljs"])])]),s(j),I]))}});export{U as default}; diff --git a/docsite/dist/assets/basic_agent-o7xRzjte.js b/docsite/dist/assets/basic_agent-o7xRzjte.js new file mode 100644 index 0000000..cdfce06 --- /dev/null +++ b/docsite/dist/assets/basic_agent-o7xRzjte.js @@ -0,0 +1,19 @@ +import{d,o as l,c as h,u as t,l as p,f as g,a as e,e as s,H as a,M as i,g as o,t as b,v}from"./index-BRk7anpM.js";import{j as r,a as c}from"./agent-g-a1HYAK.js";import{R as _}from"./RobotIcon-BcM7qFfK.js";import"./lm-mqbLQnkx.js";import"./index-iXfWNpia.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const f={class:"fixed bottom-12 right-8 z-50"},j=d({__name:"AgentJoe",setup(m){return(u,n)=>(l(),h("div",f,[t(r).isVisible?(l(),p(_,{key:0,class:"text-5xl cursor-pointer"})):g("",!0)]))}}),x=v('

Basic Agent

The body of Agent Smith can interact with the user. Note: we use Vuejs and Tailwindcss for the UI code examples.

Note: the interactivity bindings are managed with Nanostores. Install the integration for your framework, here we will use @nanostores/vue for the examples below.

',1),S={class:"flex flex-col space-y-5 mt-5"},w=e("p",null,[o("Let's create a basic agent named Joe in a "),e("kbd",null,"agent/agent.ts"),o(" file:")],-1),k=e("div",null,[o("The "),e("kbd",null,"joeState"),o(" variable will be used to manage the UI interactivity. Now give let's our agent a body in a "),e("kbd",null,"agent/AgentJoe.vue"),o(" file. In the script part:")],-1),V=e("div",null,"In the template part:",-1),y=e("div",{class:"prose"},[e("h2",null,"Interactions"),e("h3",null,"Show / hide")],-1),N={class:"mt-3"},I=e("div",{class:"pt-5"},[e("a",{href:"javascript:openLink('/the_body/interactions/talk')"},"Next: the talk interaction")],-1),J=`import { useAgentSmith } from "@agent-smith/body"; +import { useStore } from '@nanostores/vue' + +const joe = useAgentSmith({ name: "Joe" }); +const joeState = useStore(joe.state); + +export { joe, joeState }`,A=`import { joe } from "./agent"; +import RobotIcon from "../widgets/RobotIcon.vue";`,T=``,B=` +
+ Joe is visible: {{ joeState.isVisible }} +
`,U=d({__name:"basic_agent",setup(m){return(u,n)=>(l(),h("div",null,[x,e("div",S,[w,s(t(i),{hljs:t(a),code:J,lang:"ts"},null,8,["hljs"]),k,e("div",null,[s(t(i),{hljs:t(a),code:A,lang:"ts"},null,8,["hljs"])]),V,e("div",null,[s(t(i),{hljs:t(a),code:T,lang:"html"},null,8,["hljs"])]),y,e("div",null,[e("button",{class:"btn light",onClick:n[0]||(n[0]=R=>{t(r).isVisible?t(c).hide():t(c).show()})},"Toggle Joe"),e("div",N,[o("Joe is visible: "),e("code",null,b(t(r).isVisible),1)])]),e("div",null,[s(t(i),{hljs:t(a),code:B,lang:"html"},null,8,["hljs"])])]),s(j),I]))}});export{U as default}; diff --git a/docsite/dist/assets/basics-u_Zfw9v1.js b/docsite/dist/assets/basics-B1Q_zC_x.js similarity index 96% rename from docsite/dist/assets/basics-u_Zfw9v1.js rename to docsite/dist/assets/basics-B1Q_zC_x.js index 6a85768..02ee306 100644 --- a/docsite/dist/assets/basics-u_Zfw9v1.js +++ b/docsite/dist/assets/basics-B1Q_zC_x.js @@ -1,4 +1,4 @@ -import{d as g,r as x,o,c as a,a as e,e as i,u as t,H as r,M as d,t as p,f as m,g as u}from"./index-CboZIT6v.js";import{u as f,a as b,b as j}from"./lm-BizhkHiD.js";const y=f({name:"default",localLm:"koboldcpp",templateName:"chatml"}),k=b([y]),n=j({name:"Joe",modules:[k]}),S=e("div",{class:"prosed"},[e("h1",null,"Templates")],-1),A={class:"flex flex-col space-y-5 mt-5"},T=e("div",null,[u("The templates are managed with the "),e("a",{href:"https://github.com/synw/modprompt"},"Modprompt"),u(" library. Create an expert with a ChatMl template:")],-1),L=e("div",null,"Let's see what the template looks like:",-1),M={key:0,class:"txt-light"},C=e("div",{class:"prose"},[e("h2",null,"System")],-1),N=e("div",null,"Let's add a system message:",-1),B=e("div",null,"The template:",-1),w={key:1,class:"txt-light"},P=e("div",{class:"prose"},[e("h2",null,"Prompt")],-1),E=e("div",null,"To modify the prompt:",-1),V=e("div",null,"The template:",-1),J={key:2,class:"txt-light"},$=e("div",null,"To render the template with a prompt:",-1),H=e("div",null,"The template:",-1),I={key:3,class:"txt-light"},Y=e("div",{class:"pt-5"},[e("a",{href:"javascript:openLink('/the_brain/templates/history')"},"Next: history")],-1),D=`import { useAgentSmith } from "@agent-smith/body"; +import{d as g,r as x,o,c as a,a as e,e as i,u as t,H as r,M as d,t as p,f as m,g as u}from"./index-BRk7anpM.js";import{u as f,a as b,b as j}from"./lm-mqbLQnkx.js";const y=f({name:"default",localLm:"koboldcpp",templateName:"chatml"}),k=b([y]),n=j({name:"Joe",modules:[k]}),S=e("div",{class:"prosed"},[e("h1",null,"Templates")],-1),A={class:"flex flex-col space-y-5 mt-5"},T=e("div",null,[u("The templates are managed with the "),e("a",{href:"https://github.com/synw/modprompt"},"Modprompt"),u(" library. Create an expert with a ChatMl template:")],-1),L=e("div",null,"Let's see what the template looks like:",-1),M={key:0,class:"txt-light"},C=e("div",{class:"prose"},[e("h2",null,"System")],-1),N=e("div",null,"Let's add a system message:",-1),B=e("div",null,"The template:",-1),w={key:1,class:"txt-light"},P=e("div",{class:"prose"},[e("h2",null,"Prompt")],-1),E=e("div",null,"To modify the prompt:",-1),V=e("div",null,"The template:",-1),J={key:2,class:"txt-light"},$=e("div",null,"To render the template with a prompt:",-1),H=e("div",null,"The template:",-1),I={key:3,class:"txt-light"},Y=e("div",{class:"pt-5"},[e("a",{href:"javascript:openLink('/the_brain/templates/history')"},"Next: history")],-1),D=`import { useAgentSmith } from "@agent-smith/body"; import { useLmExpert, useAgentBrain } from "@agent-smith/brain"; const expert = useLmExpert({ diff --git a/docsite/dist/assets/basics-BVs7cz0C.js b/docsite/dist/assets/basics-BVs7cz0C.js deleted file mode 100644 index c42ae32..0000000 --- a/docsite/dist/assets/basics-BVs7cz0C.js +++ /dev/null @@ -1,44 +0,0 @@ -import{s as b}from"./textarea.esm-D2yOeTtn.js";import{d as x,r as m,o as p,c as v,a as e,e as l,u as t,H as n,M as o,g as s,n as j,t as _,f}from"./index-CboZIT6v.js";import{c as r,d as u,b as g}from"./agent-BFtiMqbc.js";import"./lm-BizhkHiD.js";import"./index-BZxdWYOY.js";const k=e("div",{class:"prosed"},[e("h1",null,"The brain: basics")],-1),w={class:"flex flex-col space-y-5 mt-5"},S=e("div",null,"The brain module manages connections to inference servers. It is usable independently of the body. In this example we are going to use a local Koboldcpp server. Start a local server with Mistral Instruct 7B to run the interactive examples on this page. ",-1),q=e("div",null,"First let's declare our brain module with one expert:",-1),T=e("div",null,[s("Note the "),e("kbd",null,"template"),s(" parameter. If you use another model change it accordingly. The templates are managed with the "),e("a",{href:"https://github.com/synw/modprompt"},"Modprompt"),s(" library that covers the most common formats. ")],-1),C=e("div",null,"Let's ping our server to check if it's up:",-1),M=e("div",null,"The template part:",-1),V=e("div",null,"Now let's use the brain module and make a simple query:",-1),L=e("br",null,null,-1),N=["disabled"],O=["innerHTML"],I=e("div",null,[s("Here the "),e("kbd",null,"q1"),s(" variable is just a text ref. ")],-1),A=e("div",{class:"prosed"},[e("h2",null,"Inference parameters")],-1),B=e("div",null,[s(" The prompt above uses default server inference parameters. It is possible to configure the inference parameters for each prompt. Agent Smith uses the "),e("a",{href:"https://github.com/synw/locallm"},"LocalLm"),s(" library. See all the available inference params in the "),e("a",{href:"https://synw.github.io/locallm/types/interfaces/InferenceParams.html"},"api doc"),s(". Example with a few params: ")],-1),H=["disabled"],J={key:1},Q={class:"font-light"},W=e("div",{class:"prosed"},[e("h2",null,"Observability")],-1),E=e("div",null,"The template used and the exact final prompt sent to the language model can be inspected. The template in json:",-1),P=e("div",null,[s("We use the brain current expert "),e("kbd",null,"ex"),s("'s template object. Code:")],-1),R=e("div",null,"The template in plain text:",-1),$=e("div",null,"Code:",-1),U=e("div",null,"The final prompt",-1),z=e("div",null,"Code:",-1),D=e("div",null,[s("Check the "),e("a",{href:"https://github.com/synw/modprompt"},"Modprompt"),s(" library for more details.")],-1),F=e("div",{class:"pt-5"},[e("a",{href:"javascript:openLink('/the_brain/options')"},"Next: options")],-1),K=`import { useStore } from '@nanostores/vue'; -import { useLmExpert, useAgentBrain } from "@agent-smith/brain"; - -const expert = useLmExpert({ - name: "default", - localLm: "koboldcpp", - templateName: "mistral", -}); -// map the brain to the body (optional) -const joe = useAgentSmith({ - name: "Joe", - jobs: jobs, - modules: [brainModule], -}); - -const brainModule = useAgentBrain([expert]); -const brain = brainModule.brain; -// this one is to get reactive variables in the ui template -const brainState = useStore(brain.state);`,G=`
- -
-
Server is up: - - {{ brainState.isOn }} - -
`,X=`
- Query:
-