diff --git a/404.html b/404.html index 2a0509a80..782b4b022 100644 --- a/404.html +++ b/404.html @@ -4,13 +4,13 @@ Page Not Found | Rivet - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/assets/images/assemble-message-node-78f820983d1493836f71bc6947ef703e.png b/assets/images/assemble-message-node-78f820983d1493836f71bc6947ef703e.png new file mode 100644 index 000000000..ab72f7973 Binary files /dev/null and b/assets/images/assemble-message-node-78f820983d1493836f71bc6947ef703e.png differ diff --git a/assets/images/assemble-message-node-example-01-6bf162c8c957f04c0c51d9fb555f62b8.png b/assets/images/assemble-message-node-example-01-6bf162c8c957f04c0c51d9fb555f62b8.png new file mode 100644 index 000000000..72792d39e Binary files /dev/null and b/assets/images/assemble-message-node-example-01-6bf162c8c957f04c0c51d9fb555f62b8.png differ diff --git a/assets/images/destructure-node-33c36852cb296fc1f55aa5d278ecc2c3.png b/assets/images/destructure-node-33c36852cb296fc1f55aa5d278ecc2c3.png new file mode 100644 index 000000000..92b5b0703 Binary files /dev/null and b/assets/images/destructure-node-33c36852cb296fc1f55aa5d278ecc2c3.png differ diff --git a/assets/images/destructure-node-example-01-6b91228c007befc0f174a66706b979ea.png b/assets/images/destructure-node-example-01-6b91228c007befc0f174a66706b979ea.png new file mode 100644 index 000000000..833f4a3fc Binary files /dev/null and b/assets/images/destructure-node-example-01-6b91228c007befc0f174a66706b979ea.png differ diff --git a/assets/images/replace-dataset-node-12711b5e48836b3c6eb3d9b69bebd6b8.png b/assets/images/replace-dataset-node-12711b5e48836b3c6eb3d9b69bebd6b8.png new file mode 100644 index 000000000..469aff4fe Binary files /dev/null and b/assets/images/replace-dataset-node-12711b5e48836b3c6eb3d9b69bebd6b8.png differ diff --git a/assets/images/replace-dataset-node-example-01-a5bd78826f2043806f8b3c7176b81d36.png b/assets/images/replace-dataset-node-example-01-a5bd78826f2043806f8b3c7176b81d36.png new file mode 100644 index 000000000..a3ce83fce Binary files /dev/null and b/assets/images/replace-dataset-node-example-01-a5bd78826f2043806f8b3c7176b81d36.png differ diff --git a/assets/images/url-reference-node-example-01-efa1b1b3ed1fbbc63648e57f00878345.png b/assets/images/url-reference-node-example-01-efa1b1b3ed1fbbc63648e57f00878345.png new file mode 100644 index 000000000..1afbb900e Binary files /dev/null and b/assets/images/url-reference-node-example-01-efa1b1b3ed1fbbc63648e57f00878345.png differ diff --git a/assets/images/url-reference-node-example-02-ae8e7d34db944c246a0c711dd4926b9a.png b/assets/images/url-reference-node-example-02-ae8e7d34db944c246a0c711dd4926b9a.png new file mode 100644 index 000000000..8a6de9f34 Binary files /dev/null and b/assets/images/url-reference-node-example-02-ae8e7d34db944c246a0c711dd4926b9a.png differ diff --git a/assets/images/url-reference-node-fe811cbf87f2f39dd58c15063ca34d70.png b/assets/images/url-reference-node-fe811cbf87f2f39dd58c15063ca34d70.png new file mode 100644 index 000000000..6199cd6d5 Binary files /dev/null and b/assets/images/url-reference-node-fe811cbf87f2f39dd58c15063ca34d70.png differ diff --git a/assets/js/0950711a.7c594bc0.js b/assets/js/0950711a.7c594bc0.js new file mode 100644 index 000000000..8d6eed10c --- /dev/null +++ b/assets/js/0950711a.7c594bc0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3107],{1042:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>h});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},d=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,d=i(e,["components","mdxType","originalType","parentName"]),p=u(a),m=r,h=p["".concat(s,".").concat(m)]||p[m]||c[m]||l;return a?n.createElement(h,o(o({ref:t},d),{},{components:a})):n.createElement(h,o({ref:t},d))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,o=new Array(l);o[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:r,o[1]=i;for(var u=2;u{a.d(t,{Z:()=>o});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:a,className:o}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,o),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>y});var n=a(7396),r=a(3249),l=a(2689),o=a(5986),i=a(6659),s=a(4532),u=a(5821),d=a(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function c(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function m(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:a}=e;const n=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,s._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function f(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=c(e),[o,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[s,u]=h({queryString:a,groupId:n}),[p,f]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,d.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),b=(()=>{const e=s??p;return m({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),f(e)}),[u,f,l]),tabValues:l}}var b=a(3072);const g={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:a,selectedValue:i,selectValue:s,tabValues:u}=e;const d=[],{blockElementScrollPositionUntilNextRender:p}=(0,o.o5)(),c=e=>{const t=e.currentTarget,a=d.indexOf(t),n=u[a].value;n!==i&&(p(t),s(n))},m=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const a=d.indexOf(e.currentTarget)+1;t=d[a]??d[0];break}case"ArrowLeft":{const a=d.indexOf(e.currentTarget)-1;t=d[a]??d[d.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},u.map((e=>{let{value:t,label:a,attributes:o}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>d.push(e),onKeyDown:m,onClick:c},o,{className:(0,l.Z)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":i===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function v(e){const t=f(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",g.tabList)},r.createElement(k,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return r.createElement(v,(0,n.Z)({key:String(t)},e))}},1646:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>u,toc:()=>p});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),o=a(5089);const i={id:"replace-dataset",title:"Replace Dataset Node",sidebar_label:"Replace Dataset"},s=void 0,u={unversionedId:"node-reference/replace-dataset",id:"node-reference/replace-dataset",title:"Replace Dataset Node",description:"Replace Dataset Node Screenshot",source:"@site/docs/node-reference/replace-dataset.mdx",sourceDirName:"node-reference",slug:"/node-reference/replace-dataset",permalink:"/docs/node-reference/replace-dataset",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/replace-dataset.mdx",tags:[],version:"current",frontMatter:{id:"replace-dataset",title:"Replace Dataset Node",sidebar_label:"Replace Dataset"},sidebar:"nodeReference",previous:{title:"Read File",permalink:"/docs/node-reference/read-file"},next:{title:"User Input",permalink:"/docs/node-reference/user-input"}},d={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Replace data in a dataset",id:"example-1-replace-data-in-a-dataset",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:p},m="wrapper";function h(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,n.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Replace Dataset Node Screenshot",src:a(8449).Z,width:"347",height:"154"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Replace Dataset Node is used to either replace all of the data in a dataset in with new data, or to clear the data in a dataset, during graph execution."),(0,r.kt)("p",null,"The node requires a dataset provider to be available in the context when the graph is being run. The dataset provider is responsible for managing the storage and retrieval of datasets. In the Rivet application, the dataset provider is handled for you automatically."),(0,r.kt)("p",null,"For more information on datasets, see the ",(0,r.kt)("a",{parentName:"p",href:"/docs/user-guide/features/data-studio"},"Data Studio")," section of the user guide."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Data"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"object[]")),(0,r.kt)("td",{parentName:"tr",align:null},"The new data of the dataset. If empty, the dataset will be cleared. May be an array of array of strings, or an array of DatasetRow objects with { id, data } properties. If a string","[][]",", IDs will be generated."),(0,r.kt)("td",{parentName:"tr",align:null},"(empty)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into an object array if it is not an object array.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Dataset ID"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The ID of the dataset to replace. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Dataset ID Input")," is enabled."),(0,r.kt)("td",{parentName:"tr",align:null},"(required if if the input toggle for Dataset ID is enabled)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string."))))),(0,r.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Dataset"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"object[]")),(0,r.kt)("td",{parentName:"tr",align:null},"The new data of the dataset. An array of DatasetRow objects with { id, data } properties."),(0,r.kt)("td",{parentName:"tr",align:null},"The output will be an object containing the ID, data, and embedding of the new row."))))),(0,r.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Dataset"),(0,r.kt)("td",{parentName:"tr",align:null},"The ID of the dataset to replace."),(0,r.kt)("td",{parentName:"tr",align:null},"(required)"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,r.kt)("h2",{id:"example-1-replace-data-in-a-dataset"},"Example 1: Replace data in a dataset"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"In the ",(0,r.kt)("a",{parentName:"li",href:"/docs/user-guide/features/data-studio"},"Data Studio"),", create a new dataset with the ID ",(0,r.kt)("inlineCode",{parentName:"li"},"employees")," and add some data to it."),(0,r.kt)("li",{parentName:"ol"},"Create an ",(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")," for the first row, and set the values to ",(0,r.kt)("inlineCode",{parentName:"li"},'["John Doe", "30", "Engineer"]'),"."),(0,r.kt)("li",{parentName:"ol"},"Create another Array Node, disable Flattening on it, and connect the first Array Node to it."),(0,r.kt)("li",{parentName:"ol"},"Create a Replace Dataset Node and set the Dataset to ",(0,r.kt)("inlineCode",{parentName:"li"},"Employees"),"."),(0,r.kt)("li",{parentName:"ol"},"Connect the Array Node to the ",(0,r.kt)("inlineCode",{parentName:"li"},"Data")," input of the Replace Dataset Node."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Dataset")," output of the Replace Dataset Node should contain the new data that replaced the existing data in the ",(0,r.kt)("inlineCode",{parentName:"li"},"employees")," dataset.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Replace Dataset Node Example 1.1",src:a(4228).Z,width:"1259",height:"559"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Replace Dataset Node will error if the dataset provider is not available in the context when the graph is being run."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What is a dataset provider?")),(0,r.kt)("p",null,"A: A dataset provider is an object that is responsible for managing the storage and retrieval of datasets. It is passed to the context when the graph is being run. The dataset provider must implement the ",(0,r.kt)("inlineCode",{parentName:"p"},"DatasetProvider")," interface, which includes methods for getting, putting, and deleting datasets. See the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api-reference"},"API Reference")," for more information."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What happens if the dataset does not exist?")),(0,r.kt)("p",null,"A: If the dataset does not exist, the Replace Dataset Node will error."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/append-to-dataset"},"Append to Dataset Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/load-dataset"},"Load Dataset Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/create-dataset"},"Create Dataset Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/get-all-datasets"},"Get All Datasets Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/knn-dataset"},"KNN Dataset Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/get-dataset-row"},"Get Dataset Row Node"))))}h.isMDXComponent=!0},4228:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/replace-dataset-node-example-01-a5bd78826f2043806f8b3c7176b81d36.png"},8449:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/replace-dataset-node-12711b5e48836b3c6eb3d9b69bebd6b8.png"}}]); \ No newline at end of file diff --git a/assets/js/0f3bdce4.d776e576.js b/assets/js/0f3bdce4.d776e576.js new file mode 100644 index 000000000..3840aec2e --- /dev/null +++ b/assets/js/0f3bdce4.d776e576.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9819],{1042:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>h});var r=a(3249);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var i=r.createContext({}),s=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},c=function(e){var t=s(e.components);return r.createElement(i.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),p=s(a),m=n,h=p["".concat(i,".").concat(m)]||p[m]||d[m]||l;return a?r.createElement(h,o(o({ref:t},c),{},{components:a})):r.createElement(h,o({ref:t},c))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=m;var u={};for(var i in t)hasOwnProperty.call(t,i)&&(u[i]=t[i]);u.originalType=e,u[p]="string"==typeof e?e:n,o[1]=u;for(var s=2;s{a.d(t,{Z:()=>o});var r=a(3249),n=a(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:a,className:o}=e;return r.createElement("div",{role:"tabpanel",className:(0,n.Z)(l.tabItem,o),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>y});var r=a(7396),n=a(3249),l=a(2689),o=a(5986),u=a(6659),i=a(4532),s=a(5821),c=a(3312);function p(e){return function(e){return n.Children.map(e,(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:r,default:n}}=e;return{value:t,label:a,attributes:r,default:n}}))}function d(e){const{values:t,children:a}=e;return(0,n.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function m(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:a}=e;const r=(0,u.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,i._X)(l),(0,n.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function f(e){const{defaultValue:t,queryString:a=!1,groupId:r}=e,l=d(e),[o,u]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=a.find((e=>e.default))??a[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[i,s]=h({queryString:a,groupId:r}),[p,f]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,c.Nk)(a);return[r,(0,n.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:r}),b=(()=>{const e=i??p;return m({value:e,tabValues:l})?e:null})();(0,n.useLayoutEffect)((()=>{b&&u(b)}),[b]);return{selectedValue:o,selectValue:(0,n.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);u(e),s(e),f(e)}),[s,f,l]),tabValues:l}}var b=a(3072);const k={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function N(e){let{className:t,block:a,selectedValue:u,selectValue:i,tabValues:s}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,o.o5)(),d=e=>{const t=e.currentTarget,a=c.indexOf(t),r=s[a].value;r!==u&&(p(t),i(r))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const a=c.indexOf(e.currentTarget)+1;t=c[a]??c[0];break}case"ArrowLeft":{const a=c.indexOf(e.currentTarget)-1;t=c[a]??c[c.length-1];break}}t?.focus()};return n.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},s.map((e=>{let{value:t,label:a,attributes:o}=e;return n.createElement("li",(0,r.Z)({role:"tab",tabIndex:u===t?0:-1,"aria-selected":u===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:d},o,{className:(0,l.Z)("tabs__item",k.tabItem,o?.className,{"tabs__item--active":u===t})}),a??t)})))}function g(e){let{lazy:t,children:a,selectedValue:r}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return n.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function v(e){const t=f(e);return n.createElement("div",{className:(0,l.Z)("tabs-container",k.tabList)},n.createElement(N,(0,r.Z)({},e,t)),n.createElement(g,(0,r.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return n.createElement(v,(0,r.Z)({key:String(t)},e))}},2776:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>u,metadata:()=>s,toc:()=>p});var r=a(7396),n=(a(3249),a(1042)),l=a(2327),o=a(5089);const u={id:"destructure",title:"Destructure Node",sidebar_label:"Destructure"},i=void 0,s={unversionedId:"node-reference/destructure",id:"node-reference/destructure",title:"Destructure Node",description:"Destructure Node Screenshot",source:"@site/docs/node-reference/destructure.mdx",sourceDirName:"node-reference",slug:"/node-reference/destructure",permalink:"/docs/node-reference/destructure",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/destructure.mdx",tags:[],version:"current",frontMatter:{id:"destructure",title:"Destructure Node",sidebar_label:"Destructure"},sidebar:"nodeReference",previous:{title:"RNG",permalink:"/docs/node-reference/RNG"},next:{title:"Extract JSON",permalink:"/docs/node-reference/extract-json"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Extract multiple properties from an object",id:"example-1-extract-multiple-properties-from-an-object",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:p},m="wrapper";function h(e){let{components:t,...u}=e;return(0,n.kt)(m,(0,r.Z)({},d,u,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Destructure Node Screenshot",src:a(1727).Z,width:"600",height:"344"})),(0,n.kt)("h2",{id:"overview"},"Overview"),(0,n.kt)("p",null,"The Destructure Node is used to extract multiple values from an object or array at once. It uses JSONPath notation to navigate through the input value and extract the values at the specified paths. This node is similar to the ",(0,n.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node"),", but it allows you to specify multiple paths and extract multiple values at once, which can be more convenient than using multiple Extract Object Path nodes."),(0,n.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,n.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"inputs"},"Inputs"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Title"),(0,n.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Object"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"object")),(0,n.kt)("td",{parentName:"tr",align:null},"The object to extract values from."),(0,n.kt)("td",{parentName:"tr",align:null},"(required)"),(0,n.kt)("td",{parentName:"tr",align:null}))))),(0,n.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"outputs"},"Outputs"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Title"),(0,n.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"(JSONPath)"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"any")),(0,n.kt)("td",{parentName:"tr",align:null},"The value extracted from the object at the corresponding path."),(0,n.kt)("td",{parentName:"tr",align:null},"If the value is not found, this port is not ran. The number of outputs is dynamic based on the number of paths specified in the settings."))))),(0,n.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,n.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Setting"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,n.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Paths"),(0,n.kt)("td",{parentName:"tr",align:null},"One or more JSONPath expressions. Each expression will correspond to an output port of the node."),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"['$.value']")),(0,n.kt)("td",{parentName:"tr",align:null},"No"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"string[]"))))))),(0,n.kt)("h2",{id:"example-1-extract-multiple-properties-from-an-object"},"Example 1: Extract multiple properties from an object"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},(0,n.kt)("p",{parentName:"li"},"Create an ",(0,n.kt)("a",{parentName:"p",href:"/docs/node-reference/object"},"Object Node")," and set the value to the following:"),(0,n.kt)("pre",{parentName:"li"},(0,n.kt)("code",{parentName:"pre",className:"language-json"},'{\n "name": "John Doe",\n "age": 30,\n "job": "Engineer"\n}\n'))),(0,n.kt)("li",{parentName:"ol"},(0,n.kt)("p",{parentName:"li"},"Create a Destructure Node and set the Paths to ",(0,n.kt)("inlineCode",{parentName:"p"},"$.name"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"$.age"),", and ",(0,n.kt)("inlineCode",{parentName:"p"},"$.job"),".")),(0,n.kt)("li",{parentName:"ol"},(0,n.kt)("p",{parentName:"li"},"Connect the Object Node to the ",(0,n.kt)("inlineCode",{parentName:"p"},"Object")," input of the Destructure Node.")),(0,n.kt)("li",{parentName:"ol"},(0,n.kt)("p",{parentName:"li"},"Run the graph. The Destructure Node should have three outputs: ",(0,n.kt)("inlineCode",{parentName:"p"},"$.name")," with the value ",(0,n.kt)("inlineCode",{parentName:"p"},"John Doe"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"$.age")," with the value ",(0,n.kt)("inlineCode",{parentName:"p"},"30"),", and ",(0,n.kt)("inlineCode",{parentName:"p"},"$.job")," with the value ",(0,n.kt)("inlineCode",{parentName:"p"},"Engineer"),"."))),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Destructure Node Example 1",src:a(3596).Z,width:"1208",height:"600"})),(0,n.kt)("h2",{id:"error-handling"},"Error Handling"),(0,n.kt)("p",null,"If a path is invalid or does not exist in the input object, the corresponding output port will not be run."),(0,n.kt)("h2",{id:"faq"},"FAQ"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: How is the Destructure Node different from the Extract Object Path Node?")),(0,n.kt)("p",null,"A: The Destructure Node is similar to the Extract Object Path Node, but it allows you to specify multiple paths and extract multiple values at once. This can be more convenient than using multiple Extract Object Path nodes to extract multiple paths. The Destructure Node does not allow you specify a path and extract every value at that path, which is possible with the Extract Object Path Node."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: Can I use the Destructure Node to extract array values?")),(0,n.kt)("p",null,"A: Yes, you can use the Destructure Node to extract array values, but only with a known length. You can use paths such as ",(0,n.kt)("inlineCode",{parentName:"p"},"$[0]"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"$[1]"),", etc. to extract values from an array. However, you cannot use paths such as ",(0,n.kt)("inlineCode",{parentName:"p"},"$[*]")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"$[?]")," to extract all values from an array."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if a path does not exist in the input object?")),(0,n.kt)("p",null,"A: If a path does not exist in the input object, the corresponding output port will not be run."),(0,n.kt)("h2",{id:"see-also"},"See Also"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/object"},"Object Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/user-guide/data-types"},"Data Types"))))}h.isMDXComponent=!0},3596:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/destructure-node-example-01-6b91228c007befc0f174a66706b979ea.png"},1727:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/destructure-node-33c36852cb296fc1f55aa5d278ecc2c3.png"}}]); \ No newline at end of file diff --git a/assets/js/12f5fcad.4db20fe9.js b/assets/js/12f5fcad.e5a8bdea.js similarity index 56% rename from assets/js/12f5fcad.4db20fe9.js rename to assets/js/12f5fcad.e5a8bdea.js index 077508741..051d58923 100644 --- a/assets/js/12f5fcad.4db20fe9.js +++ b/assets/js/12f5fcad.e5a8bdea.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6828],{1042:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>h});var a=n(3249);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=a.createContext({}),u=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},m=function(e){var t=u(e.components);return a.createElement(i.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),p=u(n),d=o,h=p["".concat(i,".").concat(d)]||p[d]||c[d]||r;return n?a.createElement(h,l(l({ref:t},m),{},{components:n})):a.createElement(h,l({ref:t},m))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=d;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[p]="string"==typeof e?e:o,l[1]=s;for(var u=2;u{n.d(t,{Z:()=>p});var a=n(3249),o=n(2689),r=n(9423),l=n(1872);const s={admonition:"admonition_ZmbV",admonitionHeading:"admonitionHeading_osZu",admonitionIcon:"admonitionIcon_MdRj",admonitionContent:"admonitionContent_xkkw"};const i={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(l.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(l.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(l.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(l.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(l.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},u={secondary:"note",important:"info",success:"tip",warning:"danger"};function m(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}function p(e){const{children:t,type:n,title:l,icon:p}=m(e),c=function(e){const t=u[e]??e,n=i[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),i.info)}(n),d=l??c.label,{iconComponent:h}=c,f=p??a.createElement(h,null);return a.createElement("div",{className:(0,o.Z)(r.k.common.admonition,r.k.common.admonitionType(e.type),"alert",`alert--${c.infimaClassName}`,s.admonition)},a.createElement("div",{className:s.admonitionHeading},a.createElement("span",{className:s.admonitionIcon},f),d),a.createElement("div",{className:s.admonitionContent},t))}},5089:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(3249),o=n(2689);const r={tabItem:"tabItem_o9Hs"};function l(e){let{children:t,hidden:n,className:l}=e;return a.createElement("div",{role:"tabpanel",className:(0,o.Z)(r.tabItem,l),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>N});var a=n(7396),o=n(3249),r=n(2689),l=n(5986),s=n(6659),i=n(4532),u=n(5821),m=n(3312);function p(e){return function(e){return o.Children.map(e,(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:o}}=e;return{value:t,label:n,attributes:a,default:o}}))}function c(e){const{values:t,children:n}=e;return(0,o.useMemo)((()=>{const e=t??p(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.k6)(),r=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i._X)(r),(0,o.useCallback)((e=>{if(!r)return;const t=new URLSearchParams(a.location.search);t.set(r,e),a.replace({...a.location,search:t.toString()})}),[r,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,r=c(e),[l,s]=(0,o.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:r}))),[i,u]=h({queryString:n,groupId:a}),[p,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,r]=(0,m.Nk)(n);return[a,(0,o.useCallback)((e=>{n&&r.set(e)}),[n,r])]}({groupId:a}),g=(()=>{const e=i??p;return d({value:e,tabValues:r})?e:null})();(0,o.useLayoutEffect)((()=>{g&&s(g)}),[g]);return{selectedValue:l,selectValue:(0,o.useCallback)((e=>{if(!d({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);s(e),u(e),f(e)}),[u,f,r]),tabValues:r}}var g=n(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function v(e){let{className:t,block:n,selectedValue:s,selectValue:i,tabValues:u}=e;const m=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.o5)(),c=e=>{const t=e.currentTarget,n=m.indexOf(t),a=u[n].value;a!==s&&(p(t),i(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=m.indexOf(e.currentTarget)+1;t=m[n]??m[0];break}case"ArrowLeft":{const n=m.indexOf(e.currentTarget)-1;t=m[n]??m[m.length-1];break}}t?.focus()};return o.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:l}=e;return o.createElement("li",(0,a.Z)({role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,key:t,ref:e=>m.push(e),onKeyDown:d,onClick:c},l,{className:(0,r.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":s===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=r.find((e=>e.props.value===a));return e?(0,o.cloneElement)(e,{className:"margin-top--md"}):null}return o.createElement("div",{className:"margin-top--md"},r.map(((e,t)=>(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function y(e){const t=f(e);return o.createElement("div",{className:(0,r.Z)("tabs-container",b.tabList)},o.createElement(v,(0,a.Z)({},e,t)),o.createElement(k,(0,a.Z)({},e,t)))}function N(e){const t=(0,g.Z)();return o.createElement(y,(0,a.Z)({key:String(t)},e))}},6285:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>u,toc:()=>p});var a=n(7396),o=(n(3249),n(1042)),r=n(2327),l=n(5089);n(9119);const s={id:"assemble-prompt",title:"Assemble Prompt Node",sidebar_label:"Assemble Prompt"},i=void 0,u={unversionedId:"node-reference/assemble-prompt",id:"node-reference/assemble-prompt",title:"Assemble Prompt Node",description:"Overview",source:"@site/docs/node-reference/assemble-prompt.mdx",sourceDirName:"node-reference",slug:"/node-reference/assemble-prompt",permalink:"/docs/node-reference/assemble-prompt",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/assemble-prompt.mdx",tags:[],version:"current",frontMatter:{id:"assemble-prompt",title:"Assemble Prompt Node",sidebar_label:"Assemble Prompt"},sidebar:"nodeReference",previous:{title:"To JSON",permalink:"/docs/node-reference/to-json"},next:{title:"Chat",permalink:"/docs/node-reference/chat"}},m={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example: Assembling Multiple Chat Messages",id:"example-assembling-multiple-chat-messages",level:3},{value:"Example: Appending Chat Messages in a Loop",id:"example-appending-chat-messages-in-a-loop",level:3},{value:"Handling Missing Inputs",id:"handling-missing-inputs",level:3},{value:"Error Handling",id:"error-handling",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:p},d="wrapper";function h(e){let{components:t,...s}=e;return(0,o.kt)(d,(0,a.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"A ",(0,o.kt)("a",{parentName:"p",href:"./chat"},"Chat Node")," takes in a single Prompt input which can be a single message, or an array of messages that forms the message chain. The Assemble Prompt Node is used to assemble multiple chat messages into a single prompt. It takes multiple chat messages or strings as inputs and outputs a single prompt containing all the messages."),(0,o.kt)("p",null,"If a string is connected to any of the inputs, it will be converted to a User type chat message with the string as the message."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Assemble Prompt Node Screenshot",src:n(5730).Z,width:"684",height:"636"})),(0,o.kt)(r.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,o.kt)(l.Z,{value:"inputs",mdxType:"TabItem"},(0,o.kt)("h2",{id:"inputs"},"Inputs"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Title"),(0,o.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,o.kt)("th",{parentName:"tr",align:null},"Description"),(0,o.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,o.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},"Message ","[i]"),(0,o.kt)("td",{parentName:"tr",align:null},"chat-message, chat-message[]"),(0,o.kt)("td",{parentName:"tr",align:null},"The ith chat message input to be assembled"),(0,o.kt)("td",{parentName:"tr",align:null},"N/A"),(0,o.kt)("td",{parentName:"tr",align:null},"Dynamic number of inputs based on how many connections there are"))))),(0,o.kt)(l.Z,{value:"outputs",mdxType:"TabItem"},(0,o.kt)("h2",{id:"outputs"},"Outputs"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Title"),(0,o.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,o.kt)("th",{parentName:"tr",align:null},"Description"),(0,o.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},"Prompt"),(0,o.kt)("td",{parentName:"tr",align:null},"chat-message[]"),(0,o.kt)("td",{parentName:"tr",align:null},"The assembled chat messages"),(0,o.kt)("td",{parentName:"tr",align:null},"The output will be a single prompt resulting from assembling all valid chat messages"))))),(0,o.kt)(l.Z,{value:"settings",mdxType:"TabItem"},(0,o.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,o.kt)("p",null,"This node does not have any specific settings."))),(0,o.kt)("h3",{id:"example-assembling-multiple-chat-messages"},"Example: Assembling Multiple Chat Messages"),(0,o.kt)("p",null,"Let's say you have two ",(0,o.kt)("a",{parentName:"p",href:"./prompt"},"Prompt nodes"),': one with the the AI\'s text "How can I assist you today?" and the user\'s response "Hello". If you want to assemble these two messages into a single prompt to feed into a Chat Node, you can do the following:'),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Add an Assemble Prompt Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the first Prompt node (AI's message) to ",(0,o.kt)("inlineCode",{parentName:"li"},"Message 1")," of the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the second Prompt node (user's response) to ",(0,o.kt)("inlineCode",{parentName:"li"},"Message 2")," of the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the Assemble Prompt Node to the ",(0,o.kt)("inlineCode",{parentName:"li"},"Prompt")," input of a Chat Node.")),(0,o.kt)("h3",{id:"example-appending-chat-messages-in-a-loop"},"Example: Appending Chat Messages in a Loop"),(0,o.kt)("p",null,"A common use case for the Assemble Prompt Node is to append chat messages in a loop. This can be achieved by using a Loop Controller Node in conjunction with the Assemble Prompt Node."),(0,o.kt)("p",null,"Here's how you can set this up:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Add a Loop Controller Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Add an Assemble Prompt Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Connect the ",(0,o.kt)("inlineCode",{parentName:"li"},"Output 1")," of the Loop Controller Node to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1")," of the Assemble Prompt Node. This will feed the output of the loop back into the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the ",(0,o.kt)("inlineCode",{parentName:"li"},"Output 1")," of the Assemble Prompt Node to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1")," of the Loop Controller Node. This will effectively create a feedback loop where the Assemble Prompt Node feeds back into itself."),(0,o.kt)("li",{parentName:"ol"},"Connect your first message to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1 Default")," of the Loop Controller Node. This will be the initial message that starts the loop."),(0,o.kt)("li",{parentName:"ol"},"Any additional messages that you want to append during each loop iteration can be connected to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 2"),", ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 3"),", etc of the Assemble Prompt Node.")),(0,o.kt)("p",null,"The Assemble Prompt Node will flatten the output, resulting in a list of the current messages. During each loop iteration, the Assemble Prompt Node will append any additional messages connected to its inputs."),(0,o.kt)("p",null,"This setup allows you to dynamically append chat messages in a loop, which can be useful in various scenarios such as creating a chatbot that can carry on a conversation with a user."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Note:")," If you want to control the number of loop iterations, you can do so by setting the ",(0,o.kt)("inlineCode",{parentName:"p"},"Max Iterations")," property of the Loop Controller Node."),(0,o.kt)("p",null,"Here's a diagram to help visualize the setup:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Loop Controller with Assemble Prompt Node",src:n(9844).Z,width:"2098",height:"874"})),(0,o.kt)("p",null,"This example demonstrates the power and flexibility of Rivet's node-based system, allowing you to create complex behaviors with just a few nodes."),(0,o.kt)("h3",{id:"handling-missing-inputs"},"Handling Missing Inputs"),(0,o.kt)("p",null,"If an input is missing or not a chat message, the Assemble Prompt Node will simply ignore it during the assembling process. This can be useful when dealing with optional inputs that may not always be present."),(0,o.kt)("h2",{id:"error-handling"},"Error Handling"),(0,o.kt)("p",null,"If no valid chat message inputs are provided, the output will be an empty array."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: What happens if I connect a non-chat message to the Assemble Prompt Node?")),(0,o.kt)("p",null,"A: The Assemble Prompt Node is designed to work with chat message inputs. If a non-chat message input is connected, the node will attempt to convert it to a chat message. In most cases, this will be a User type message with message being the data converted to a string. If this conversion isn't possible, the input will be ignored during the assembling process."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: Can I connect an Array Node to the Assemble Prompt Node?")),(0,o.kt)("p",null,"A: Yes, you can connect an Array Node to the Assemble Prompt Node. Each element of the array will be treated as a separate chat message to be assembled (flattens the array)."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: How does the Assemble Prompt Node handle empty strings or null values?")),(0,o.kt)("p",null,"A: The Assemble Prompt Node will ignore any inputs that are null or not a chat message. Empty chat messages, however, will be included in the assembling operation."),(0,o.kt)("h2",{id:"see-also"},"See Also"))}h.isMDXComponent=!0},9844:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/assemble-prompt-node-example-02-58281e375e9beb27853612bdc6383d78.png"},5730:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/assemble-prompt-node-5c657f5eaed8b0847daaf9835178e1c7.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6828],{1042:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>h});var a=n(3249);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=a.createContext({}),u=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},m=function(e){var t=u(e.components);return a.createElement(i.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),p=u(n),d=o,h=p["".concat(i,".").concat(d)]||p[d]||c[d]||r;return n?a.createElement(h,l(l({ref:t},m),{},{components:n})):a.createElement(h,l({ref:t},m))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=d;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[p]="string"==typeof e?e:o,l[1]=s;for(var u=2;u{n.d(t,{Z:()=>p});var a=n(3249),o=n(2689),r=n(9423),l=n(1872);const s={admonition:"admonition_ZmbV",admonitionHeading:"admonitionHeading_osZu",admonitionIcon:"admonitionIcon_MdRj",admonitionContent:"admonitionContent_xkkw"};const i={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(l.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(l.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(l.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(l.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(l.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},u={secondary:"note",important:"info",success:"tip",warning:"danger"};function m(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}function p(e){const{children:t,type:n,title:l,icon:p}=m(e),c=function(e){const t=u[e]??e,n=i[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),i.info)}(n),d=l??c.label,{iconComponent:h}=c,f=p??a.createElement(h,null);return a.createElement("div",{className:(0,o.Z)(r.k.common.admonition,r.k.common.admonitionType(e.type),"alert",`alert--${c.infimaClassName}`,s.admonition)},a.createElement("div",{className:s.admonitionHeading},a.createElement("span",{className:s.admonitionIcon},f),d),a.createElement("div",{className:s.admonitionContent},t))}},5089:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(3249),o=n(2689);const r={tabItem:"tabItem_o9Hs"};function l(e){let{children:t,hidden:n,className:l}=e;return a.createElement("div",{role:"tabpanel",className:(0,o.Z)(r.tabItem,l),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>N});var a=n(7396),o=n(3249),r=n(2689),l=n(5986),s=n(6659),i=n(4532),u=n(5821),m=n(3312);function p(e){return function(e){return o.Children.map(e,(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:o}}=e;return{value:t,label:n,attributes:a,default:o}}))}function c(e){const{values:t,children:n}=e;return(0,o.useMemo)((()=>{const e=t??p(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.k6)(),r=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i._X)(r),(0,o.useCallback)((e=>{if(!r)return;const t=new URLSearchParams(a.location.search);t.set(r,e),a.replace({...a.location,search:t.toString()})}),[r,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,r=c(e),[l,s]=(0,o.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:r}))),[i,u]=h({queryString:n,groupId:a}),[p,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,r]=(0,m.Nk)(n);return[a,(0,o.useCallback)((e=>{n&&r.set(e)}),[n,r])]}({groupId:a}),g=(()=>{const e=i??p;return d({value:e,tabValues:r})?e:null})();(0,o.useLayoutEffect)((()=>{g&&s(g)}),[g]);return{selectedValue:l,selectValue:(0,o.useCallback)((e=>{if(!d({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);s(e),u(e),f(e)}),[u,f,r]),tabValues:r}}var g=n(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function v(e){let{className:t,block:n,selectedValue:s,selectValue:i,tabValues:u}=e;const m=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.o5)(),c=e=>{const t=e.currentTarget,n=m.indexOf(t),a=u[n].value;a!==s&&(p(t),i(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=m.indexOf(e.currentTarget)+1;t=m[n]??m[0];break}case"ArrowLeft":{const n=m.indexOf(e.currentTarget)-1;t=m[n]??m[m.length-1];break}}t?.focus()};return o.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:l}=e;return o.createElement("li",(0,a.Z)({role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,key:t,ref:e=>m.push(e),onKeyDown:d,onClick:c},l,{className:(0,r.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":s===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=r.find((e=>e.props.value===a));return e?(0,o.cloneElement)(e,{className:"margin-top--md"}):null}return o.createElement("div",{className:"margin-top--md"},r.map(((e,t)=>(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function y(e){const t=f(e);return o.createElement("div",{className:(0,r.Z)("tabs-container",b.tabList)},o.createElement(v,(0,a.Z)({},e,t)),o.createElement(k,(0,a.Z)({},e,t)))}function N(e){const t=(0,g.Z)();return o.createElement(y,(0,a.Z)({key:String(t)},e))}},6285:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>u,toc:()=>p});var a=n(7396),o=(n(3249),n(1042)),r=n(2327),l=n(5089);n(9119);const s={id:"assemble-prompt",title:"Assemble Prompt Node",sidebar_label:"Assemble Prompt"},i=void 0,u={unversionedId:"node-reference/assemble-prompt",id:"node-reference/assemble-prompt",title:"Assemble Prompt Node",description:"Overview",source:"@site/docs/node-reference/assemble-prompt.mdx",sourceDirName:"node-reference",slug:"/node-reference/assemble-prompt",permalink:"/docs/node-reference/assemble-prompt",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/assemble-prompt.mdx",tags:[],version:"current",frontMatter:{id:"assemble-prompt",title:"Assemble Prompt Node",sidebar_label:"Assemble Prompt"},sidebar:"nodeReference",previous:{title:"Assemble Message",permalink:"/docs/node-reference/assemble-message"},next:{title:"Chat",permalink:"/docs/node-reference/chat"}},m={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example: Assembling Multiple Chat Messages",id:"example-assembling-multiple-chat-messages",level:3},{value:"Example: Appending Chat Messages in a Loop",id:"example-appending-chat-messages-in-a-loop",level:3},{value:"Handling Missing Inputs",id:"handling-missing-inputs",level:3},{value:"Error Handling",id:"error-handling",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:p},d="wrapper";function h(e){let{components:t,...s}=e;return(0,o.kt)(d,(0,a.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"A ",(0,o.kt)("a",{parentName:"p",href:"./chat"},"Chat Node")," takes in a single Prompt input which can be a single message, or an array of messages that forms the message chain. The Assemble Prompt Node is used to assemble multiple chat messages into a single prompt. It takes multiple chat messages or strings as inputs and outputs a single prompt containing all the messages."),(0,o.kt)("p",null,"If a string is connected to any of the inputs, it will be converted to a User type chat message with the string as the message."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Assemble Prompt Node Screenshot",src:n(5730).Z,width:"684",height:"636"})),(0,o.kt)(r.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,o.kt)(l.Z,{value:"inputs",mdxType:"TabItem"},(0,o.kt)("h2",{id:"inputs"},"Inputs"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Title"),(0,o.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,o.kt)("th",{parentName:"tr",align:null},"Description"),(0,o.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,o.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},"Message ","[i]"),(0,o.kt)("td",{parentName:"tr",align:null},"chat-message, chat-message[]"),(0,o.kt)("td",{parentName:"tr",align:null},"The ith chat message input to be assembled"),(0,o.kt)("td",{parentName:"tr",align:null},"N/A"),(0,o.kt)("td",{parentName:"tr",align:null},"Dynamic number of inputs based on how many connections there are"))))),(0,o.kt)(l.Z,{value:"outputs",mdxType:"TabItem"},(0,o.kt)("h2",{id:"outputs"},"Outputs"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Title"),(0,o.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,o.kt)("th",{parentName:"tr",align:null},"Description"),(0,o.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},"Prompt"),(0,o.kt)("td",{parentName:"tr",align:null},"chat-message[]"),(0,o.kt)("td",{parentName:"tr",align:null},"The assembled chat messages"),(0,o.kt)("td",{parentName:"tr",align:null},"The output will be a single prompt resulting from assembling all valid chat messages"))))),(0,o.kt)(l.Z,{value:"settings",mdxType:"TabItem"},(0,o.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,o.kt)("p",null,"This node does not have any specific settings."))),(0,o.kt)("h3",{id:"example-assembling-multiple-chat-messages"},"Example: Assembling Multiple Chat Messages"),(0,o.kt)("p",null,"Let's say you have two ",(0,o.kt)("a",{parentName:"p",href:"./prompt"},"Prompt nodes"),': one with the the AI\'s text "How can I assist you today?" and the user\'s response "Hello". If you want to assemble these two messages into a single prompt to feed into a Chat Node, you can do the following:'),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Add an Assemble Prompt Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the first Prompt node (AI's message) to ",(0,o.kt)("inlineCode",{parentName:"li"},"Message 1")," of the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the second Prompt node (user's response) to ",(0,o.kt)("inlineCode",{parentName:"li"},"Message 2")," of the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the output of the Assemble Prompt Node to the ",(0,o.kt)("inlineCode",{parentName:"li"},"Prompt")," input of a Chat Node.")),(0,o.kt)("h3",{id:"example-appending-chat-messages-in-a-loop"},"Example: Appending Chat Messages in a Loop"),(0,o.kt)("p",null,"A common use case for the Assemble Prompt Node is to append chat messages in a loop. This can be achieved by using a Loop Controller Node in conjunction with the Assemble Prompt Node."),(0,o.kt)("p",null,"Here's how you can set this up:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Add a Loop Controller Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Add an Assemble Prompt Node to your graph."),(0,o.kt)("li",{parentName:"ol"},"Connect the ",(0,o.kt)("inlineCode",{parentName:"li"},"Output 1")," of the Loop Controller Node to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1")," of the Assemble Prompt Node. This will feed the output of the loop back into the Assemble Prompt Node."),(0,o.kt)("li",{parentName:"ol"},"Connect the ",(0,o.kt)("inlineCode",{parentName:"li"},"Output 1")," of the Assemble Prompt Node to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1")," of the Loop Controller Node. This will effectively create a feedback loop where the Assemble Prompt Node feeds back into itself."),(0,o.kt)("li",{parentName:"ol"},"Connect your first message to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 1 Default")," of the Loop Controller Node. This will be the initial message that starts the loop."),(0,o.kt)("li",{parentName:"ol"},"Any additional messages that you want to append during each loop iteration can be connected to ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 2"),", ",(0,o.kt)("inlineCode",{parentName:"li"},"Input 3"),", etc of the Assemble Prompt Node.")),(0,o.kt)("p",null,"The Assemble Prompt Node will flatten the output, resulting in a list of the current messages. During each loop iteration, the Assemble Prompt Node will append any additional messages connected to its inputs."),(0,o.kt)("p",null,"This setup allows you to dynamically append chat messages in a loop, which can be useful in various scenarios such as creating a chatbot that can carry on a conversation with a user."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Note:")," If you want to control the number of loop iterations, you can do so by setting the ",(0,o.kt)("inlineCode",{parentName:"p"},"Max Iterations")," property of the Loop Controller Node."),(0,o.kt)("p",null,"Here's a diagram to help visualize the setup:"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Loop Controller with Assemble Prompt Node",src:n(9844).Z,width:"2098",height:"874"})),(0,o.kt)("p",null,"This example demonstrates the power and flexibility of Rivet's node-based system, allowing you to create complex behaviors with just a few nodes."),(0,o.kt)("h3",{id:"handling-missing-inputs"},"Handling Missing Inputs"),(0,o.kt)("p",null,"If an input is missing or not a chat message, the Assemble Prompt Node will simply ignore it during the assembling process. This can be useful when dealing with optional inputs that may not always be present."),(0,o.kt)("h2",{id:"error-handling"},"Error Handling"),(0,o.kt)("p",null,"If no valid chat message inputs are provided, the output will be an empty array."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: What happens if I connect a non-chat message to the Assemble Prompt Node?")),(0,o.kt)("p",null,"A: The Assemble Prompt Node is designed to work with chat message inputs. If a non-chat message input is connected, the node will attempt to convert it to a chat message. In most cases, this will be a User type message with message being the data converted to a string. If this conversion isn't possible, the input will be ignored during the assembling process."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: Can I connect an Array Node to the Assemble Prompt Node?")),(0,o.kt)("p",null,"A: Yes, you can connect an Array Node to the Assemble Prompt Node. Each element of the array will be treated as a separate chat message to be assembled (flattens the array)."),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Q: How does the Assemble Prompt Node handle empty strings or null values?")),(0,o.kt)("p",null,"A: The Assemble Prompt Node will ignore any inputs that are null or not a chat message. Empty chat messages, however, will be included in the assembling operation."),(0,o.kt)("h2",{id:"see-also"},"See Also"))}h.isMDXComponent=!0},9844:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/assemble-prompt-node-example-02-58281e375e9beb27853612bdc6383d78.png"},5730:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/assemble-prompt-node-5c657f5eaed8b0847daaf9835178e1c7.png"}}]); \ No newline at end of file diff --git a/assets/js/3109fa04.37035135.js b/assets/js/3109fa04.37035135.js deleted file mode 100644 index 94f6292dd..000000000 --- a/assets/js/3109fa04.37035135.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2118],{1042:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>b});var a=n(3249);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=a.createContext({}),d=function(e){var t=a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=d(e.components);return a.createElement(u.Provider,{value:t},e.children)},s="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=d(n),c=r,b=s["".concat(u,".").concat(c)]||s[c]||p[c]||l;return n?a.createElement(b,i(i({ref:t},m),{},{components:n})):a.createElement(b,i({ref:t},m))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=c;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var d=2;d{n.d(t,{Z:()=>i});var a=n(3249),r=n(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:n,className:i}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7396),r=n(3249),l=n(2689),i=n(5986),o=n(6659),u=n(4532),d=n(5821),m=n(3312);function s(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??s(n);return function(e){const t=(0,d.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function c(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function N(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=p(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!c({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[u,d]=b({queryString:n,groupId:a}),[s,N]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,m.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),g=(()=>{const e=u??s;return c({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!c({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),N(e)}),[d,N,l]),tabValues:l}}var g=n(3072);const f={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function h(e){let{className:t,block:n,selectedValue:o,selectValue:u,tabValues:d}=e;const m=[],{blockElementScrollPositionUntilNextRender:s}=(0,i.o5)(),p=e=>{const t=e.currentTarget,n=m.indexOf(t),a=d[n].value;a!==o&&(s(t),u(a))},c=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=m.indexOf(e.currentTarget)+1;t=m[n]??m[0];break}case"ArrowLeft":{const n=m.indexOf(e.currentTarget)-1;t=m[n]??m[m.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},d.map((e=>{let{value:t,label:n,attributes:i}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>m.push(e),onKeyDown:c,onClick:p},i,{className:(0,l.Z)("tabs__item",f.tabItem,i?.className,{"tabs__item--active":o===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=N(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",f.tabList)},r.createElement(h,(0,a.Z)({},e,t)),r.createElement(k,(0,a.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},4595:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>u,default:()=>b,frontMatter:()=>o,metadata:()=>d,toc:()=>s});var a=n(7396),r=(n(3249),n(1042)),l=n(2327),i=n(5089);const o={id:"RNG",title:"RNG Node",sidebar_label:"RNG"},u=void 0,d={unversionedId:"node-reference/RNG",id:"node-reference/RNG",title:"RNG Node",description:"Random Number Node Screenshot",source:"@site/docs/node-reference/rng.mdx",sourceDirName:"node-reference",slug:"/node-reference/RNG",permalink:"/docs/node-reference/RNG",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/rng.mdx",tags:[],version:"current",frontMatter:{id:"RNG",title:"RNG Node",sidebar_label:"RNG"},sidebar:"nodeReference",previous:{title:"Number",permalink:"/docs/node-reference/number"},next:{title:"Extract JSON",permalink:"/docs/node-reference/extract-json"}},m={},s=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Generate a random integer",id:"example-1-generate-a-random-integer",level:2},{value:"Example 2: Generate a random floating-point number",id:"example-2-generate-a-random-floating-point-number",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],p={toc:s},c="wrapper";function b(e){let{components:t,...o}=e;return(0,r.kt)(c,(0,a.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Screenshot",src:n(3058).Z,width:"283",height:"242"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Random Number Node, also known as RNG, generates a random number within a specified range. This node is useful for creating randomized behavior in your graph."),(0,r.kt)("p",null,"The node can be configured to generate either integers or floating-point numbers. The range of the random number can be specified with a minimum and maximum value. The maximum value can be set to be either inclusive or exclusive."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Min"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The minimum value of the random number. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Min Input")," is enabled in the editor settings."),(0,r.kt)("td",{parentName:"tr",align:null},"(optional)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a number if it is not a number.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum value of the random number. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Max Input")," is enabled in the editor settings."),(0,r.kt)("td",{parentName:"tr",align:null},"(optional)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a number if it is not a number."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Value"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The generated random number."),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Min"),(0,r.kt)("td",{parentName:"tr",align:null},"The minimum value of the random number."),(0,r.kt)("td",{parentName:"tr",align:null},"0"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max"),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum value of the random number."),(0,r.kt)("td",{parentName:"tr",align:null},"1"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Integers"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the node will generate integer numbers. If disabled, the node will generate floating-point numbers."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max Inclusive"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the maximum value will be inclusive. If disabled, the maximum value will be exclusive."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-generate-a-random-integer"},"Example 1: Generate a random integer"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Random Number Node."),(0,r.kt)("li",{parentName:"ol"},"Set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"1")," and the ",(0,r.kt)("inlineCode",{parentName:"li"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"10"),"."),(0,r.kt)("li",{parentName:"ol"},"Enable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Integers")," setting."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The output of the Random Number Node should be a random integer between 1 and 10.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Example 1",src:n(4082).Z,width:"315",height:"293"})),(0,r.kt)("h2",{id:"example-2-generate-a-random-floating-point-number"},"Example 2: Generate a random floating-point number"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Random Number Node."),(0,r.kt)("li",{parentName:"ol"},"Set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"0")," and the ",(0,r.kt)("inlineCode",{parentName:"li"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"1"),"."),(0,r.kt)("li",{parentName:"ol"},"Disable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Integers")," setting."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The output of the Random Number Node should be a random floating-point number between 0 and 1.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Example 2",src:n(2240).Z,width:"327",height:"287"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Random Number Node will error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," is greater than the ",(0,r.kt)("inlineCode",{parentName:"p"},"Max"),". If the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"Max")," are equal, the node will always output the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," value."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Random Number Node to generate a random boolean value?")),(0,r.kt)("p",null,"A: Yes, you can use the Random Number Node to generate a random boolean value by setting the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"0"),", the ",(0,r.kt)("inlineCode",{parentName:"p"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"1"),", and enabling the ",(0,r.kt)("inlineCode",{parentName:"p"},"Integers")," setting. The node will then output either ",(0,r.kt)("inlineCode",{parentName:"p"},"0")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"1"),", which can be interpreted as ",(0,r.kt)("inlineCode",{parentName:"p"},"false")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"true")," by a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/bool"},"Bool Node"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Random Number Node to generate a random string?")),(0,r.kt)("p",null,"A: No, the Random Number Node can only generate random numbers. If you want to generate a random string, you can use a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," with a custom JavaScript function."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/code"},"Code Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/number"},"Number Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/shuffle"},"Shuffle Node"))))}b.isMDXComponent=!0},4082:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-example-01-43485f5671007b50962f67a8f9b4f532.png"},2240:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-example-02-1a2be0a8d44c4f9c15438cffaeb7143b.png"},3058:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-567d02d7d8388e059a613a01f5a36b93.png"}}]); \ No newline at end of file diff --git a/assets/js/3109fa04.65c28a9c.js b/assets/js/3109fa04.65c28a9c.js new file mode 100644 index 000000000..71879392a --- /dev/null +++ b/assets/js/3109fa04.65c28a9c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2118],{1042:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>b});var a=n(3249);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=a.createContext({}),d=function(e){var t=a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=d(e.components);return a.createElement(u.Provider,{value:t},e.children)},s="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=d(n),c=r,b=s["".concat(u,".").concat(c)]||s[c]||p[c]||l;return n?a.createElement(b,i(i({ref:t},m),{},{components:n})):a.createElement(b,i({ref:t},m))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=c;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var d=2;d{n.d(t,{Z:()=>i});var a=n(3249),r=n(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:n,className:i}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7396),r=n(3249),l=n(2689),i=n(5986),o=n(6659),u=n(4532),d=n(5821),m=n(3312);function s(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??s(n);return function(e){const t=(0,d.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function c(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function N(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=p(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!c({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[u,d]=b({queryString:n,groupId:a}),[s,N]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,m.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),g=(()=>{const e=u??s;return c({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!c({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),N(e)}),[d,N,l]),tabValues:l}}var g=n(3072);const f={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function h(e){let{className:t,block:n,selectedValue:o,selectValue:u,tabValues:d}=e;const m=[],{blockElementScrollPositionUntilNextRender:s}=(0,i.o5)(),p=e=>{const t=e.currentTarget,n=m.indexOf(t),a=d[n].value;a!==o&&(s(t),u(a))},c=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=m.indexOf(e.currentTarget)+1;t=m[n]??m[0];break}case"ArrowLeft":{const n=m.indexOf(e.currentTarget)-1;t=m[n]??m[m.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},d.map((e=>{let{value:t,label:n,attributes:i}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>m.push(e),onKeyDown:c,onClick:p},i,{className:(0,l.Z)("tabs__item",f.tabItem,i?.className,{"tabs__item--active":o===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=N(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",f.tabList)},r.createElement(h,(0,a.Z)({},e,t)),r.createElement(k,(0,a.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},4595:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>u,default:()=>b,frontMatter:()=>o,metadata:()=>d,toc:()=>s});var a=n(7396),r=(n(3249),n(1042)),l=n(2327),i=n(5089);const o={id:"RNG",title:"RNG Node",sidebar_label:"RNG"},u=void 0,d={unversionedId:"node-reference/RNG",id:"node-reference/RNG",title:"RNG Node",description:"Random Number Node Screenshot",source:"@site/docs/node-reference/rng.mdx",sourceDirName:"node-reference",slug:"/node-reference/RNG",permalink:"/docs/node-reference/RNG",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/rng.mdx",tags:[],version:"current",frontMatter:{id:"RNG",title:"RNG Node",sidebar_label:"RNG"},sidebar:"nodeReference",previous:{title:"Number",permalink:"/docs/node-reference/number"},next:{title:"Destructure",permalink:"/docs/node-reference/destructure"}},m={},s=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Generate a random integer",id:"example-1-generate-a-random-integer",level:2},{value:"Example 2: Generate a random floating-point number",id:"example-2-generate-a-random-floating-point-number",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],p={toc:s},c="wrapper";function b(e){let{components:t,...o}=e;return(0,r.kt)(c,(0,a.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Screenshot",src:n(3058).Z,width:"283",height:"242"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Random Number Node, also known as RNG, generates a random number within a specified range. This node is useful for creating randomized behavior in your graph."),(0,r.kt)("p",null,"The node can be configured to generate either integers or floating-point numbers. The range of the random number can be specified with a minimum and maximum value. The maximum value can be set to be either inclusive or exclusive."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Min"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The minimum value of the random number. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Min Input")," is enabled in the editor settings."),(0,r.kt)("td",{parentName:"tr",align:null},"(optional)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a number if it is not a number.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum value of the random number. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Max Input")," is enabled in the editor settings."),(0,r.kt)("td",{parentName:"tr",align:null},"(optional)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a number if it is not a number."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Value"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number")),(0,r.kt)("td",{parentName:"tr",align:null},"The generated random number."),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Min"),(0,r.kt)("td",{parentName:"tr",align:null},"The minimum value of the random number."),(0,r.kt)("td",{parentName:"tr",align:null},"0"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max"),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum value of the random number."),(0,r.kt)("td",{parentName:"tr",align:null},"1"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"number"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Integers"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the node will generate integer numbers. If disabled, the node will generate floating-point numbers."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Max Inclusive"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the maximum value will be inclusive. If disabled, the maximum value will be exclusive."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-generate-a-random-integer"},"Example 1: Generate a random integer"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Random Number Node."),(0,r.kt)("li",{parentName:"ol"},"Set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"1")," and the ",(0,r.kt)("inlineCode",{parentName:"li"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"10"),"."),(0,r.kt)("li",{parentName:"ol"},"Enable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Integers")," setting."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The output of the Random Number Node should be a random integer between 1 and 10.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Example 1",src:n(4082).Z,width:"315",height:"293"})),(0,r.kt)("h2",{id:"example-2-generate-a-random-floating-point-number"},"Example 2: Generate a random floating-point number"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Random Number Node."),(0,r.kt)("li",{parentName:"ol"},"Set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"0")," and the ",(0,r.kt)("inlineCode",{parentName:"li"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"li"},"1"),"."),(0,r.kt)("li",{parentName:"ol"},"Disable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Integers")," setting."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The output of the Random Number Node should be a random floating-point number between 0 and 1.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Random Number Node Example 2",src:n(2240).Z,width:"327",height:"287"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Random Number Node will error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," is greater than the ",(0,r.kt)("inlineCode",{parentName:"p"},"Max"),". If the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"Max")," are equal, the node will always output the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," value."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Random Number Node to generate a random boolean value?")),(0,r.kt)("p",null,"A: Yes, you can use the Random Number Node to generate a random boolean value by setting the ",(0,r.kt)("inlineCode",{parentName:"p"},"Min")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"0"),", the ",(0,r.kt)("inlineCode",{parentName:"p"},"Max")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"1"),", and enabling the ",(0,r.kt)("inlineCode",{parentName:"p"},"Integers")," setting. The node will then output either ",(0,r.kt)("inlineCode",{parentName:"p"},"0")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"1"),", which can be interpreted as ",(0,r.kt)("inlineCode",{parentName:"p"},"false")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"true")," by a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/bool"},"Bool Node"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Random Number Node to generate a random string?")),(0,r.kt)("p",null,"A: No, the Random Number Node can only generate random numbers. If you want to generate a random string, you can use a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," with a custom JavaScript function."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/code"},"Code Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/number"},"Number Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/shuffle"},"Shuffle Node"))))}b.isMDXComponent=!0},4082:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-example-01-43485f5671007b50962f67a8f9b4f532.png"},2240:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-example-02-1a2be0a8d44c4f9c15438cffaeb7143b.png"},3058:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/rng-node-567d02d7d8388e059a613a01f5a36b93.png"}}]); \ No newline at end of file diff --git a/assets/js/58e75369.68a3c26e.js b/assets/js/58e75369.68a3c26e.js new file mode 100644 index 000000000..cf0ab22a4 --- /dev/null +++ b/assets/js/58e75369.68a3c26e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[814],{1042:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>g});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var u=n.createContext({}),s=function(e){var t=n.useContext(u),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},d=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=s(a),c=r,g=p["".concat(u,".").concat(c)]||p[c]||m[c]||l;return a?n.createElement(g,i(i({ref:t},d),{},{components:a})):n.createElement(g,i({ref:t},d))}));function g(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=c;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o[p]="string"==typeof e?e:r,i[1]=o;for(var s=2;s{a.d(t,{Z:()=>i});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>v});var n=a(7396),r=a(3249),l=a(2689),i=a(5986),o=a(6659),u=a(4532),s=a(5821),d=a(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function m(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function c(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function g(e){let{queryString:t=!1,groupId:a}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function h(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=m(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!c({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[u,s]=g({queryString:a,groupId:n}),[p,h]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,d.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),f=(()=>{const e=u??p;return c({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{f&&o(f)}),[f]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!c({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var f=a(3072);const k={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function b(e){let{className:t,block:a,selectedValue:o,selectValue:u,tabValues:s}=e;const d=[],{blockElementScrollPositionUntilNextRender:p}=(0,i.o5)(),m=e=>{const t=e.currentTarget,a=d.indexOf(t),n=s[a].value;n!==o&&(p(t),u(n))},c=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const a=d.indexOf(e.currentTarget)+1;t=d[a]??d[0];break}case"ArrowLeft":{const a=d.indexOf(e.currentTarget)-1;t=d[a]??d[d.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},s.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>d.push(e),onKeyDown:c,onClick:m},i,{className:(0,l.Z)("tabs__item",k.tabItem,i?.className,{"tabs__item--active":o===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",k.tabList)},r.createElement(b,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function v(e){const t=(0,f.Z)();return r.createElement(y,(0,n.Z)({key:String(t)},e))}},903:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>u,default:()=>g,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),i=a(5089);const o={id:"image",title:"Image Node",sidebar_label:"Image"},u=void 0,s={unversionedId:"node-reference/image",id:"node-reference/image",title:"Image Node",description:"Image Node Screenshot",source:"@site/docs/node-reference/image.mdx",sourceDirName:"node-reference",slug:"/node-reference/image",permalink:"/docs/node-reference/image",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/image.mdx",tags:[],version:"current",frontMatter:{id:"image",title:"Image Node",sidebar_label:"Image"},sidebar:"nodeReference",previous:{title:"Hash",permalink:"/docs/node-reference/hash"},next:{title:"URL Reference",permalink:"/docs/node-reference/url-reference"}},d={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Create a static image",id:"example-1-create-a-static-image",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],m={toc:p},c="wrapper";function g(e){let{components:t,...o}=e;return(0,r.kt)(c,(0,n.Z)({},m,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Image Node Screenshot",src:a(2334).Z,width:"327",height:"288"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Image Node is used to define a static image for use with other nodes. It can convert a binary type into an image type. The node requires a media type (PNG, JPEG, or GIF) and a data input."),(0,r.kt)("p",null,"The data input can be provided in two ways:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Directly in the node's editor settings, using the image browser."),(0,r.kt)("li",{parentName:"ul"},"Dynamically, by connecting another node to the Image Node's ",(0,r.kt)("inlineCode",{parentName:"li"},"Data")," input port.")),(0,r.kt)("p",null,"The media type can also be provided in two ways:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Directly in the node's editor settings, using the dropdown menu."),(0,r.kt)("li",{parentName:"ul"},"Dynamically, by connecting another node to the Image Node's ",(0,r.kt)("inlineCode",{parentName:"li"},"Media Type")," input port.")),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Data"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted into an image."),(0,r.kt)("td",{parentName:"tr",align:null},"(required if if the input toggle for Data is enabled)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Media Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The media type of the image (PNG, JPEG, or GIF)."),(0,r.kt)("td",{parentName:"tr",align:null},"(required if if the input toggle for Media Type is enabled)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string. The value must be one of the following: ",(0,r.kt)("inlineCode",{parentName:"td"},"image/png"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"image/jpeg"),", or ",(0,r.kt)("inlineCode",{parentName:"td"},"image/gif"),"."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Image"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"image")),(0,r.kt)("td",{parentName:"tr",align:null},"The image that was created."),(0,r.kt)("td",{parentName:"tr",align:null},"None"))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Media Type"),(0,r.kt)("td",{parentName:"tr",align:null},"The media type of the image (PNG, JPEG, or GIF)."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"image/png")),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Image"),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted into an image."),(0,r.kt)("td",{parentName:"tr",align:null},"(empty)"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,r.kt)("h2",{id:"example-1-create-a-static-image"},"Example 1: Create a static image"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create an Image Node."),(0,r.kt)("li",{parentName:"ol"},"In the node's editor settings, click on the ",(0,r.kt)("inlineCode",{parentName:"li"},"Pick Image")," button. This will open the image browser."),(0,r.kt)("li",{parentName:"ol"},"Select an image from the image browser. The selected image will be displayed in the ",(0,r.kt)("inlineCode",{parentName:"li"},"Image")," field."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Image")," output of the Image Node should contain the selected image.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Image Node Example 1",src:a(9715).Z,width:"304",height:"642"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Image Node will error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input or the ",(0,r.kt)("inlineCode",{parentName:"p"},"Media Type")," input is not provided. It will also error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input cannot be converted into an image."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Image Node to display an image in the Rivet UI?")),(0,r.kt)("p",null,"A: Yes, the Image Node can be used to display an image in the Rivet UI. The image will be displayed in the node's output port when the graph is run."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Image Node to convert a binary type into an image?")),(0,r.kt)("p",null,"A: Yes, you can use the Image Node to convert a binary type into an image. You will need to provide the binary data to the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input of the Image Node and set the ",(0,r.kt)("inlineCode",{parentName:"p"},"Media Type")," to the appropriate type for the image."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What image formats are supported by the Image Node?")),(0,r.kt)("p",null,"A: The Image Node supports PNG, JPEG, and GIF formats."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/audio"},"Audio Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/user-guide/data-types"},"Data Types"))))}g.isMDXComponent=!0},9715:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/image-node-example-01-d1bfc83b56ec20a8366196466c758be7.png"},2334:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/image-node-da03e68a3621b7ef87836b8bf5b22144.png"}}]); \ No newline at end of file diff --git a/assets/js/58e75369.935c0ea2.js b/assets/js/58e75369.935c0ea2.js deleted file mode 100644 index a55cd9651..000000000 --- a/assets/js/58e75369.935c0ea2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[814],{1042:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>g});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var u=n.createContext({}),s=function(e){var t=n.useContext(u),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},d=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=s(a),c=r,g=p["".concat(u,".").concat(c)]||p[c]||m[c]||l;return a?n.createElement(g,i(i({ref:t},d),{},{components:a})):n.createElement(g,i({ref:t},d))}));function g(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=c;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o[p]="string"==typeof e?e:r,i[1]=o;for(var s=2;s{a.d(t,{Z:()=>i});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>v});var n=a(7396),r=a(3249),l=a(2689),i=a(5986),o=a(6659),u=a(4532),s=a(5821),d=a(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function m(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function c(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function g(e){let{queryString:t=!1,groupId:a}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function h(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=m(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!c({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[u,s]=g({queryString:a,groupId:n}),[p,h]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,d.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),f=(()=>{const e=u??p;return c({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{f&&o(f)}),[f]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!c({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var f=a(3072);const k={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function b(e){let{className:t,block:a,selectedValue:o,selectValue:u,tabValues:s}=e;const d=[],{blockElementScrollPositionUntilNextRender:p}=(0,i.o5)(),m=e=>{const t=e.currentTarget,a=d.indexOf(t),n=s[a].value;n!==o&&(p(t),u(n))},c=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const a=d.indexOf(e.currentTarget)+1;t=d[a]??d[0];break}case"ArrowLeft":{const a=d.indexOf(e.currentTarget)-1;t=d[a]??d[d.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},s.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>d.push(e),onKeyDown:c,onClick:m},i,{className:(0,l.Z)("tabs__item",k.tabItem,i?.className,{"tabs__item--active":o===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",k.tabList)},r.createElement(b,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function v(e){const t=(0,f.Z)();return r.createElement(y,(0,n.Z)({key:String(t)},e))}},903:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>u,default:()=>g,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),i=a(5089);const o={id:"image",title:"Image Node",sidebar_label:"Image"},u=void 0,s={unversionedId:"node-reference/image",id:"node-reference/image",title:"Image Node",description:"Image Node Screenshot",source:"@site/docs/node-reference/image.mdx",sourceDirName:"node-reference",slug:"/node-reference/image",permalink:"/docs/node-reference/image",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/image.mdx",tags:[],version:"current",frontMatter:{id:"image",title:"Image Node",sidebar_label:"Image"},sidebar:"nodeReference",previous:{title:"Hash",permalink:"/docs/node-reference/hash"},next:{title:"Abort Graph",permalink:"/docs/node-reference/abort-graph"}},d={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Create a static image",id:"example-1-create-a-static-image",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],m={toc:p},c="wrapper";function g(e){let{components:t,...o}=e;return(0,r.kt)(c,(0,n.Z)({},m,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Image Node Screenshot",src:a(2334).Z,width:"327",height:"288"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Image Node is used to define a static image for use with other nodes. It can convert a binary type into an image type. The node requires a media type (PNG, JPEG, or GIF) and a data input."),(0,r.kt)("p",null,"The data input can be provided in two ways:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Directly in the node's editor settings, using the image browser."),(0,r.kt)("li",{parentName:"ul"},"Dynamically, by connecting another node to the Image Node's ",(0,r.kt)("inlineCode",{parentName:"li"},"Data")," input port.")),(0,r.kt)("p",null,"The media type can also be provided in two ways:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Directly in the node's editor settings, using the dropdown menu."),(0,r.kt)("li",{parentName:"ul"},"Dynamically, by connecting another node to the Image Node's ",(0,r.kt)("inlineCode",{parentName:"li"},"Media Type")," input port.")),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Data"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted into an image."),(0,r.kt)("td",{parentName:"tr",align:null},"(required if if the input toggle for Data is enabled)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Media Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The media type of the image (PNG, JPEG, or GIF)."),(0,r.kt)("td",{parentName:"tr",align:null},"(required if if the input toggle for Media Type is enabled)"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string. The value must be one of the following: ",(0,r.kt)("inlineCode",{parentName:"td"},"image/png"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"image/jpeg"),", or ",(0,r.kt)("inlineCode",{parentName:"td"},"image/gif"),"."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Image"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"image")),(0,r.kt)("td",{parentName:"tr",align:null},"The image that was created."),(0,r.kt)("td",{parentName:"tr",align:null},"None"))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Media Type"),(0,r.kt)("td",{parentName:"tr",align:null},"The media type of the image (PNG, JPEG, or GIF)."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"image/png")),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Image"),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted into an image."),(0,r.kt)("td",{parentName:"tr",align:null},"(empty)"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,r.kt)("h2",{id:"example-1-create-a-static-image"},"Example 1: Create a static image"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create an Image Node."),(0,r.kt)("li",{parentName:"ol"},"In the node's editor settings, click on the ",(0,r.kt)("inlineCode",{parentName:"li"},"Pick Image")," button. This will open the image browser."),(0,r.kt)("li",{parentName:"ol"},"Select an image from the image browser. The selected image will be displayed in the ",(0,r.kt)("inlineCode",{parentName:"li"},"Image")," field."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Image")," output of the Image Node should contain the selected image.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Image Node Example 1",src:a(9715).Z,width:"304",height:"642"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Image Node will error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input or the ",(0,r.kt)("inlineCode",{parentName:"p"},"Media Type")," input is not provided. It will also error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input cannot be converted into an image."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Image Node to display an image in the Rivet UI?")),(0,r.kt)("p",null,"A: Yes, the Image Node can be used to display an image in the Rivet UI. The image will be displayed in the node's output port when the graph is run."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Image Node to convert a binary type into an image?")),(0,r.kt)("p",null,"A: Yes, you can use the Image Node to convert a binary type into an image. You will need to provide the binary data to the ",(0,r.kt)("inlineCode",{parentName:"p"},"Data")," input of the Image Node and set the ",(0,r.kt)("inlineCode",{parentName:"p"},"Media Type")," to the appropriate type for the image."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What image formats are supported by the Image Node?")),(0,r.kt)("p",null,"A: The Image Node supports PNG, JPEG, and GIF formats."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/audio"},"Audio Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/user-guide/data-types"},"Data Types"))))}g.isMDXComponent=!0},9715:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/image-node-example-01-d1bfc83b56ec20a8366196466c758be7.png"},2334:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/image-node-da03e68a3621b7ef87836b8bf5b22144.png"}}]); \ No newline at end of file diff --git a/assets/js/6929207c.55572950.js b/assets/js/6929207c.658153e3.js similarity index 52% rename from assets/js/6929207c.55572950.js rename to assets/js/6929207c.658153e3.js index 97a8a3af3..5b60ea208 100644 --- a/assets/js/6929207c.55572950.js +++ b/assets/js/6929207c.658153e3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4056],{1042:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var a=n(3249);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=a.createContext({}),s=function(e){var t=a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(u.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=s(n),m=r,f=p["".concat(u,".").concat(m)]||p[m]||d[m]||l;return n?a.createElement(f,o(o({ref:t},c),{},{components:n})):a.createElement(f,o({ref:t},c))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[p]="string"==typeof e?e:r,o[1]=i;for(var s=2;s{n.d(t,{Z:()=>o});var a=n(3249),r=n(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:n,className:o}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,o),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7396),r=n(3249),l=n(2689),o=n(5986),i=n(6659),u=n(4532),s=n(5821),c=n(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??p(n);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=d(e),[o,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[u,s]=f({queryString:n,groupId:a}),[p,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,c.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),b=(()=>{const e=u??p;return m({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var b=n(3072);const N={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function g(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:s}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,o.o5)(),d=e=>{const t=e.currentTarget,n=c.indexOf(t),a=s[n].value;a!==i&&(p(t),u(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},s.map((e=>{let{value:t,label:n,attributes:o}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:d},o,{className:(0,l.Z)("tabs__item",N.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",N.tabList)},r.createElement(g,(0,a.Z)({},e,t)),r.createElement(k,(0,a.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},1465:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>u,default:()=>f,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7396),r=(n(3249),n(1042)),l=n(2327),o=n(5089);const i={id:"to-json",title:"To JSON Node",sidebar_label:"To JSON"},u=void 0,s={unversionedId:"node-reference/to-json",id:"node-reference/to-json",title:"To JSON Node",description:"To JSON Node Screenshot",source:"@site/docs/node-reference/to-json.mdx",sourceDirName:"node-reference",slug:"/node-reference/to-json",permalink:"/docs/node-reference/to-json",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/to-json.mdx",tags:[],version:"current",frontMatter:{id:"to-json",title:"To JSON Node",sidebar_label:"To JSON"},sidebar:"nodeReference",previous:{title:"To YAML",permalink:"/docs/node-reference/to-yaml"},next:{title:"Assemble Prompt",permalink:"/docs/node-reference/assemble-prompt"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Convert an object to JSON",id:"example-1-convert-an-object-to-json",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:p},m="wrapper";function f(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"To JSON Node Screenshot",src:n(969).Z,width:"762",height:"396"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The To JSON Node is used to convert a given input into its JSON equivalent, effectively stringifying the value. This can be useful when you need to serialize an object or array into a string format for further processing or storage."),(0,r.kt)("p",null,"The node provides an option to format the JSON output with indentation for easier reading."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Data"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"any")),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted to JSON."),(0,r.kt)("td",{parentName:"tr",align:null},"(required)"),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSON"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The JSON string representation."),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Indented"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the JSON output will be formatted with indentation for readability."),(0,r.kt)("td",{parentName:"tr",align:null},"True"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-convert-an-object-to-json"},"Example 1: Convert an object to JSON"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Create an ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/object"},"Object Node")," and set the value to the following:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-json"},'{\n "name": "Claude Shannon",\n "occupation": "Computer scientist"\n}\n'))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Create a To JSON Node and connect the Object Node to it.")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Run the graph. The To JSON Node should output the JSON string representation of the object."))),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"To JSON Node Example 1",src:n(1646).Z,width:"1860",height:"710"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The To JSON Node will throw an error if it fails to convert the input to a JSON string. This can happen if the input contains a value that is not serializable, such as a function or a circular reference."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the To JSON Node to convert a string to JSON?")),(0,r.kt)("p",null,"A: Yes, but the output will be a JSON string representation of the original string. If you want to parse a JSON string into an object or array, use the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-json"},"Extract JSON Node")," or the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the To JSON Node to convert a number or boolean to JSON?")),(0,r.kt)("p",null,"A: Yes, the To JSON Node can convert any data type to a JSON string. For numbers and booleans, the output will be the string representation of the original value."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},'Q: What does the "Indented" setting do?')),(0,r.kt)("p",null,'A: When the "Indented" setting is enabled, the JSON output will be formatted with indentation and line breaks for easier reading. This can be useful when you need to inspect the JSON output for debugging purposes.'),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-json"},"Extract JSON Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/object"},"Object Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/user-guide/data-types"},"Data Types"))))}f.isMDXComponent=!0},1646:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/to-json-node-example-01-1367ec601bf3eb6a2fa1f9079d9cfab6.png"},969:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/to-json-node-f9ec4ccee1cc970a58653403a196afd9.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4056],{1042:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var a=n(3249);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=a.createContext({}),s=function(e){var t=a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(u.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=s(n),m=r,f=p["".concat(u,".").concat(m)]||p[m]||d[m]||l;return n?a.createElement(f,o(o({ref:t},c),{},{components:n})):a.createElement(f,o({ref:t},c))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[p]="string"==typeof e?e:r,o[1]=i;for(var s=2;s{n.d(t,{Z:()=>o});var a=n(3249),r=n(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:n,className:o}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,o),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7396),r=n(3249),l=n(2689),o=n(5986),i=n(6659),u=n(4532),s=n(5821),c=n(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??p(n);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=d(e),[o,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[u,s]=f({queryString:n,groupId:a}),[p,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,c.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),b=(()=>{const e=u??p;return m({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var b=n(3072);const N={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function g(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:s}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,o.o5)(),d=e=>{const t=e.currentTarget,n=c.indexOf(t),a=s[n].value;a!==i&&(p(t),u(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},s.map((e=>{let{value:t,label:n,attributes:o}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:d},o,{className:(0,l.Z)("tabs__item",N.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",N.tabList)},r.createElement(g,(0,a.Z)({},e,t)),r.createElement(k,(0,a.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},1465:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>u,default:()=>f,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7396),r=(n(3249),n(1042)),l=n(2327),o=n(5089);const i={id:"to-json",title:"To JSON Node",sidebar_label:"To JSON"},u=void 0,s={unversionedId:"node-reference/to-json",id:"node-reference/to-json",title:"To JSON Node",description:"To JSON Node Screenshot",source:"@site/docs/node-reference/to-json.mdx",sourceDirName:"node-reference",slug:"/node-reference/to-json",permalink:"/docs/node-reference/to-json",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/to-json.mdx",tags:[],version:"current",frontMatter:{id:"to-json",title:"To JSON Node",sidebar_label:"To JSON"},sidebar:"nodeReference",previous:{title:"To YAML",permalink:"/docs/node-reference/to-yaml"},next:{title:"Assemble Message",permalink:"/docs/node-reference/assemble-message"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Convert an object to JSON",id:"example-1-convert-an-object-to-json",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:p},m="wrapper";function f(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"To JSON Node Screenshot",src:n(969).Z,width:"762",height:"396"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The To JSON Node is used to convert a given input into its JSON equivalent, effectively stringifying the value. This can be useful when you need to serialize an object or array into a string format for further processing or storage."),(0,r.kt)("p",null,"The node provides an option to format the JSON output with indentation for easier reading."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Data"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"any")),(0,r.kt)("td",{parentName:"tr",align:null},"The data to be converted to JSON."),(0,r.kt)("td",{parentName:"tr",align:null},"(required)"),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSON"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The JSON string representation."),(0,r.kt)("td",{parentName:"tr",align:null}))))),(0,r.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Indented"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the JSON output will be formatted with indentation for readability."),(0,r.kt)("td",{parentName:"tr",align:null},"True"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-convert-an-object-to-json"},"Example 1: Convert an object to JSON"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Create an ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/object"},"Object Node")," and set the value to the following:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-json"},'{\n "name": "Claude Shannon",\n "occupation": "Computer scientist"\n}\n'))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Create a To JSON Node and connect the Object Node to it.")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Run the graph. The To JSON Node should output the JSON string representation of the object."))),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"To JSON Node Example 1",src:n(4815).Z,width:"1860",height:"710"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The To JSON Node will throw an error if it fails to convert the input to a JSON string. This can happen if the input contains a value that is not serializable, such as a function or a circular reference."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the To JSON Node to convert a string to JSON?")),(0,r.kt)("p",null,"A: Yes, but the output will be a JSON string representation of the original string. If you want to parse a JSON string into an object or array, use the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-json"},"Extract JSON Node")," or the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the To JSON Node to convert a number or boolean to JSON?")),(0,r.kt)("p",null,"A: Yes, the To JSON Node can convert any data type to a JSON string. For numbers and booleans, the output will be the string representation of the original value."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},'Q: What does the "Indented" setting do?')),(0,r.kt)("p",null,'A: When the "Indented" setting is enabled, the JSON output will be formatted with indentation and line breaks for easier reading. This can be useful when you need to inspect the JSON output for debugging purposes.'),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-json"},"Extract JSON Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/object"},"Object Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/user-guide/data-types"},"Data Types"))))}f.isMDXComponent=!0},4815:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/to-json-node-example-01-1367ec601bf3eb6a2fa1f9079d9cfab6.png"},969:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/to-json-node-f9ec4ccee1cc970a58653403a196afd9.png"}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.5b896ae1.js b/assets/js/935f2afb.5b896ae1.js deleted file mode 100644 index 6a9ed6871..000000000 --- a/assets/js/935f2afb.5b896ae1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"userGuide":[{"type":"link","label":"Introduction to Rivet","href":"/docs/","docId":"introduction"},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Installation","href":"/docs/getting-started/installation","docId":"getting-started/installation"},{"type":"link","label":"Setup","href":"/docs/getting-started/setup","docId":"getting-started/setup"},{"type":"link","label":"First AI Agent","href":"/docs/getting-started/first-ai-agent","docId":"getting-started/first-ai-agent"}]},{"type":"category","label":"Working with Rivet","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Overview of the Interface","href":"/docs/user-guide/overview-of-interface","docId":"user-guide/overview-of-interface"},{"type":"link","label":"Working with Nodes","href":"/docs/user-guide/adding-connecting-nodes","docId":"user-guide/adding-connecting-nodes"},{"type":"link","label":"Working with Graphs","href":"/docs/user-guide/working-with-graphs","docId":"user-guide/working-with-graphs"},{"type":"link","label":"Working with Projects","href":"/docs/user-guide/working-with-projects","docId":"user-guide/working-with-projects"},{"type":"link","label":"Executing AI Chains","href":"/docs/user-guide/executing-ai-chains","docId":"user-guide/executing-ai-chains"},{"type":"link","label":"Splitting","href":"/docs/user-guide/splitting","docId":"user-guide/splitting"},{"type":"link","label":"Subgraphs","href":"/docs/user-guide/subgraphs","docId":"user-guide/subgraphs"},{"type":"link","label":"Executors","href":"/docs/user-guide/executors","docId":"user-guide/executors"},{"type":"link","label":"Recordings","href":"/docs/user-guide/recordings","docId":"user-guide/recordings"}]},{"type":"category","label":"Features","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Prompt Designer","href":"/docs/user-guide/features/prompt-designer","docId":"user-guide/features/prompt-designer"},{"type":"link","label":"Trivet Tests","href":"/docs/user-guide/features/trivet-tests","docId":"user-guide/features/trivet-tests"},{"type":"link","label":"Chat Viewer","href":"/docs/user-guide/features/chat-viewer","docId":"user-guide/features/chat-viewer"},{"type":"link","label":"Data Studio","href":"/docs/user-guide/features/data-studio","docId":"user-guide/features/data-studio"}]},{"type":"category","label":"Plugins","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Plugins","href":"/docs/user-guide/plugins","docId":"user-guide/plugins"},{"type":"link","label":"Creating a Plugin","href":"/docs/user-guide/plugins/creating-plugins","docId":"user-guide/plugins/creating-plugins"}]},{"type":"category","label":"Built-In Plugins","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"All Built-In Plugins","href":"/docs/user-guide/plugins/built-in/all","docId":"user-guide/plugins/built-in/all"},{"type":"link","label":"Anthropic","href":"/docs/user-guide/plugins/built-in/anthropic","docId":"user-guide/plugins/built-in/anthropic"},{"type":"link","label":"AssemblyAI","href":"/docs/user-guide/plugins/built-in/assemblyai","docId":"user-guide/plugins/built-in/assemblyai"},{"type":"link","label":"Autoevals","href":"/docs/user-guide/plugins/built-in/autoevals","docId":"user-guide/plugins/built-in/autoevals"},{"type":"link","label":"Gentrace","href":"/docs/user-guide/plugins/built-in/gentrace","docId":"user-guide/plugins/built-in/gentrace"},{"type":"link","label":"Hugging Face","href":"/docs/user-guide/plugins/built-in/huggingface","docId":"user-guide/plugins/built-in/huggingface"},{"type":"link","label":"Pinecone","href":"/docs/user-guide/plugins/built-in/pinecone","docId":"user-guide/plugins/built-in/pinecone"}]},{"type":"category","label":"Debugging","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Live Debugging","href":"/docs/user-guide/live-debugging","docId":"user-guide/live-debugging"},{"type":"link","label":"Remote Debugging","href":"/docs/user-guide/remote-debugging","docId":"user-guide/remote-debugging"}]},{"type":"category","label":"Testing","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Trivet","href":"/docs/trivet","docId":"trivet"},{"type":"link","label":"Getting Started","href":"/docs/user-guide/trivet-getting-started","docId":"user-guide/trivet-getting-started"},{"type":"link","label":"Validation Graphs","href":"/docs/user-guide/trivet-validation-graphs","docId":"user-guide/trivet-validation-graphs"},{"type":"link","label":"Tutorial","href":"/docs/user-guide/trivet-tutorial","docId":"user-guide/trivet-tutorial"},{"type":"link","label":"Trivet Library","href":"/docs/user-guide/trivet-library","docId":"user-guide/trivet-library"}]},{"type":"category","label":"Advanced","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Data Types","href":"/docs/user-guide/data-types","docId":"user-guide/data-types"},{"type":"link","label":"Control Flow","href":"/docs/user-guide/control-flow","docId":"user-guide/control-flow"},{"type":"link","label":"Loops","href":"/docs/user-guide/loops","docId":"user-guide/loops"}]}],"tutorial":[{"type":"link","label":"Rivet Tutorial","href":"/docs/tutorial","docId":"tutorial"},{"type":"link","label":"00 - Installing & Overview","href":"/docs/tutorial/installing-getting-started","docId":"tutorial/installing-getting-started"},{"type":"link","label":"01 - Simple Graph","href":"/docs/tutorial/simple-graph","docId":"tutorial/simple-graph"},{"type":"link","label":"02 - Interpolation & More Node Types","href":"/docs/tutorial/interpolation-more-node-types","docId":"tutorial/interpolation-more-node-types"},{"type":"link","label":"03 - Matching & Conditionals","href":"/docs/tutorial/matching-conditionals","docId":"tutorial/matching-conditionals"},{"type":"link","label":"04 - YAML","href":"/docs/tutorial/yaml","docId":"tutorial/yaml"},{"type":"link","label":"05 - Subgraphs","href":"/docs/tutorial/subgraphs","docId":"tutorial/subgraphs"},{"type":"link","label":"06 - Splitting","href":"/docs/tutorial/splitting","docId":"tutorial/splitting"},{"type":"link","label":"07 - Loops","href":"/docs/tutorial/loops","docId":"tutorial/loops"}],"apiReference":[{"type":"link","label":"Rivet API Reference","href":"/docs/api-reference","docId":"api-reference"},{"type":"link","label":"Rivet Integration Getting Started","href":"/docs/api-reference/getting-started-integration","docId":"api-reference/getting-started-integration"},{"type":"link","label":"Remote Debugging with Rivet","href":"/docs/api-reference/remote-debugging","docId":"api-reference/remote-debugging"},{"type":"category","label":"@rivet/node","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"API Overview","href":"/docs/api-reference/node/overview","docId":"api-reference/node/overview"},{"type":"link","label":"createProcessor","href":"/docs/api-reference/node/createProcessor","docId":"api-reference/node/createProcessor"},{"type":"link","label":"loadProjectFromFile","href":"/docs/api-reference/node/loadProjectFromFile","docId":"api-reference/node/loadProjectFromFile"},{"type":"link","label":"loadProjectFromString","href":"/docs/api-reference/node/loadProjectFromString","docId":"api-reference/node/loadProjectFromString"},{"type":"link","label":"runGraph","href":"/docs/api-reference/node/runGraph","docId":"api-reference/node/runGraph"},{"type":"link","label":"runGraphInFile","href":"/docs/api-reference/node/runGraphInFile","docId":"api-reference/node/runGraphInFile"},{"type":"link","label":"startDebuggerServer","href":"/docs/api-reference/node/startDebuggerServer","docId":"api-reference/node/startDebuggerServer"},{"type":"category","label":"Types","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"DebuggerEvents","href":"/docs/api-reference/node/DebuggerEvents","docId":"api-reference/node/DebuggerEvents"},{"type":"link","label":"LooseDataValue","href":"/docs/api-reference/node/LooseDataValue","docId":"api-reference/node/LooseDataValue"},{"type":"link","label":"RivetDebuggerServer","href":"/docs/api-reference/node/RivetDebuggerServer","docId":"api-reference/node/RivetDebuggerServer"},{"type":"link","label":"RunGraphOptions","href":"/docs/api-reference/node/RunGraphOptions","docId":"api-reference/node/RunGraphOptions"}]}]},{"type":"category","label":"@rivet/core","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"API Overview","href":"/docs/api-reference/core/overview","docId":"api-reference/core/overview"},{"type":"link","label":"DataValue","href":"/docs/api-reference/core/DataValue","docId":"api-reference/core/DataValue"},{"type":"link","label":"GraphProcessor","href":"/docs/api-reference/core/GraphProcessor","docId":"api-reference/core/GraphProcessor"},{"type":"category","label":"Types","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"DataValue","href":"/docs/api-reference/core/DataValue","docId":"api-reference/core/DataValue"},{"type":"link","label":"NodeGraph","href":"/docs/api-reference/core/NodeGraph","docId":"api-reference/core/NodeGraph"},{"type":"link","label":"Project","href":"/docs/api-reference/core/Project","docId":"api-reference/core/Project"},{"type":"link","label":"Settings","href":"/docs/api-reference/core/Settings","docId":"api-reference/core/Settings"}]}]}],"nodeReference":[{"type":"link","label":"Rivet Node Reference","href":"/docs/node-reference","docId":"node-reference"},{"type":"link","label":"All Nodes","href":"/docs/node-reference/all-nodes","docId":"node-reference/all-nodes"},{"type":"category","label":"Text","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Chunk","href":"/docs/node-reference/chunk","docId":"node-reference/chunk"},{"type":"link","label":"Extract Markdown Code Blocks","href":"/docs/node-reference/extract-markdown-code-blocks","docId":"node-reference/extract-markdown-code-blocks"},{"type":"link","label":"Extract with Regex","href":"/docs/node-reference/extract-with-regex","docId":"node-reference/extract-with-regex"},{"type":"link","label":"Join","href":"/docs/node-reference/join","docId":"node-reference/join"},{"type":"link","label":"Prompt","href":"/docs/node-reference/prompt","docId":"node-reference/prompt"},{"type":"link","label":"Split Text","href":"/docs/node-reference/split-text","docId":"node-reference/split-text"},{"type":"link","label":"Text","href":"/docs/node-reference/text","docId":"node-reference/text"},{"type":"link","label":"To YAML","href":"/docs/node-reference/to-yaml","docId":"node-reference/to-yaml"},{"type":"link","label":"To JSON","href":"/docs/node-reference/to-json","docId":"node-reference/to-json"}]},{"type":"category","label":"AI","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Assemble Prompt","href":"/docs/node-reference/assemble-prompt","docId":"node-reference/assemble-prompt"},{"type":"link","label":"Chat","href":"/docs/node-reference/chat","docId":"node-reference/chat"},{"type":"link","label":"GPT Function","href":"/docs/node-reference/gpt-function","docId":"node-reference/gpt-function"},{"type":"link","label":"Get Embedding","href":"/docs/node-reference/get-embedding","docId":"node-reference/get-embedding"},{"type":"link","label":"Trim Chat Messages","href":"/docs/node-reference/trim-chat-messages","docId":"node-reference/trim-chat-messages"}]},{"type":"category","label":"Lists","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Array","href":"/docs/node-reference/array","docId":"node-reference/array"},{"type":"link","label":"Filter","href":"/docs/node-reference/filter","docId":"node-reference/filter"},{"type":"link","label":"Pop","href":"/docs/node-reference/pop","docId":"node-reference/pop"},{"type":"link","label":"Shuffle","href":"/docs/node-reference/shuffle","docId":"node-reference/shuffle"},{"type":"link","label":"Slice","href":"/docs/node-reference/slice","docId":"node-reference/slice"}]},{"type":"category","label":"Numbers","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Evaluate","href":"/docs/node-reference/evaluate","docId":"node-reference/evaluate"},{"type":"link","label":"Number","href":"/docs/node-reference/number","docId":"node-reference/number"},{"type":"link","label":"RNG","href":"/docs/node-reference/RNG","docId":"node-reference/RNG"}]},{"type":"category","label":"Objects","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Extract JSON","href":"/docs/node-reference/extract-json","docId":"node-reference/extract-json"},{"type":"link","label":"Extract Object Path","href":"/docs/node-reference/extract-object-path","docId":"node-reference/extract-object-path"},{"type":"link","label":"Extract YAML","href":"/docs/node-reference/extract-yaml","docId":"node-reference/extract-yaml"},{"type":"link","label":"Object","href":"/docs/node-reference/object","docId":"node-reference/object"}]},{"type":"category","label":"Data","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Audio","href":"/docs/node-reference/audio","docId":"node-reference/audio"},{"type":"link","label":"Bool","href":"/docs/node-reference/bool","docId":"node-reference/bool"},{"type":"link","label":"Hash","href":"/docs/node-reference/hash","docId":"node-reference/hash"},{"type":"link","label":"Image","href":"/docs/node-reference/image","docId":"node-reference/image"}]},{"type":"category","label":"Logic","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Abort Graph","href":"/docs/node-reference/abort-graph","docId":"node-reference/abort-graph"},{"type":"link","label":"Coalesce","href":"/docs/node-reference/coalesce","docId":"node-reference/coalesce"},{"type":"link","label":"Compare","href":"/docs/node-reference/compare","docId":"node-reference/compare"},{"type":"link","label":"Delay","href":"/docs/node-reference/delay","docId":"node-reference/delay"},{"type":"link","label":"If","href":"/docs/node-reference/if","docId":"node-reference/if"},{"type":"link","label":"If/Else","href":"/docs/node-reference/if-else","docId":"node-reference/if-else"},{"type":"link","label":"Loop Controller","href":"/docs/node-reference/loop-controller","docId":"node-reference/loop-controller"},{"type":"link","label":"Match","href":"/docs/node-reference/match","docId":"node-reference/match"},{"type":"link","label":"Passthrough","href":"/docs/node-reference/passthrough","docId":"node-reference/passthrough"},{"type":"link","label":"Race Inputs","href":"/docs/node-reference/race-inputs","docId":"node-reference/race-inputs"}]},{"type":"category","label":"Input/Output","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Append to Dataset","href":"/docs/node-reference/append-to-dataset","docId":"node-reference/append-to-dataset"},{"type":"link","label":"Create Dataset","href":"/docs/node-reference/create-dataset","docId":"node-reference/create-dataset"},{"type":"link","label":"Get All Datasets","href":"/docs/node-reference/get-all-datasets","docId":"node-reference/get-all-datasets"},{"type":"link","label":"Get Dataset Row","href":"/docs/node-reference/get-dataset-row","docId":"node-reference/get-dataset-row"},{"type":"link","label":"Graph Input","href":"/docs/node-reference/graph-input","docId":"node-reference/graph-input"},{"type":"link","label":"Graph Output","href":"/docs/node-reference/graph-output","docId":"node-reference/graph-output"},{"type":"link","label":"KNN Dataset","href":"/docs/node-reference/knn-dataset","docId":"node-reference/knn-dataset"},{"type":"link","label":"Load Dataset","href":"/docs/node-reference/load-dataset","docId":"node-reference/load-dataset"},{"type":"link","label":"Read Directory","href":"/docs/node-reference/read-directory","docId":"node-reference/read-directory"},{"type":"link","label":"Read File","href":"/docs/node-reference/read-file","docId":"node-reference/read-file"},{"type":"link","label":"User Input","href":"/docs/node-reference/user-input","docId":"node-reference/user-input"},{"type":"link","label":"Vector Store","href":"/docs/node-reference/vector-store","docId":"node-reference/vector-store"},{"type":"link","label":"Vector KNN","href":"/docs/node-reference/vector-knn","docId":"node-reference/vector-knn"}]},{"type":"category","label":"Advanced","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Code","href":"/docs/node-reference/code","docId":"node-reference/code"},{"type":"link","label":"Comment","href":"/docs/node-reference/comment","docId":"node-reference/comment"},{"type":"link","label":"Context","href":"/docs/node-reference/context","docId":"node-reference/context"},{"type":"link","label":"External Call","href":"/docs/node-reference/external-call","docId":"node-reference/external-call"},{"type":"link","label":"Get Global","href":"/docs/node-reference/get-global","docId":"node-reference/get-global"},{"type":"link","label":"HTTP Call","href":"/docs/node-reference/http-call","docId":"node-reference/http-call"},{"type":"link","label":"Raise Event","href":"/docs/node-reference/raise-event","docId":"node-reference/raise-event"},{"type":"link","label":"Set Global","href":"/docs/node-reference/set-global","docId":"node-reference/set-global"},{"type":"link","label":"Subgraph","href":"/docs/node-reference/subgraph","docId":"node-reference/subgraph"},{"type":"link","label":"Wait For Event","href":"/docs/node-reference/wait-for-event","docId":"node-reference/wait-for-event"}]}]},"docs":{"api-reference":{"id":"api-reference","title":"Rivet API Reference","description":"This section of the Rivet documentation goes over the TypeScript APIs for @ironclad/rivet-core and @ironclad/rivet-node.","sidebar":"apiReference"},"api-reference/core/DataValue":{"id":"api-reference/core/DataValue","title":"DataValue","description":"","sidebar":"apiReference"},"api-reference/core/GraphProcessor":{"id":"api-reference/core/GraphProcessor","title":"GraphProcessor","description":"","sidebar":"apiReference"},"api-reference/core/NodeGraph":{"id":"api-reference/core/NodeGraph","title":"NodeGraph","description":"","sidebar":"apiReference"},"api-reference/core/overview":{"id":"api-reference/core/overview","title":"API Overview","description":"","sidebar":"apiReference"},"api-reference/core/Project":{"id":"api-reference/core/Project","title":"Project","description":"","sidebar":"apiReference"},"api-reference/core/Settings":{"id":"api-reference/core/Settings","title":"Settings","description":"Description","sidebar":"apiReference"},"api-reference/getting-started-integration":{"id":"api-reference/getting-started-integration","title":"Rivet Integration Getting Started","description":"Welcome to the starting guide for integrating Rivet into your application! Currently, we only support integration via Node.js using the @ironclad/rivet-node package.","sidebar":"apiReference"},"api-reference/node/createProcessor":{"id":"api-reference/node/createProcessor","title":"createProcessor","description":"","sidebar":"apiReference"},"api-reference/node/DebuggerEvents":{"id":"api-reference/node/DebuggerEvents","title":"DebuggerEvents","description":"","sidebar":"apiReference"},"api-reference/node/loadProjectFromFile":{"id":"api-reference/node/loadProjectFromFile","title":"loadProjectFromFile","description":"Description","sidebar":"apiReference"},"api-reference/node/loadProjectFromString":{"id":"api-reference/node/loadProjectFromString","title":"loadProjectFromString","description":"Description","sidebar":"apiReference"},"api-reference/node/LooseDataValue":{"id":"api-reference/node/LooseDataValue","title":"LooseDataValue","description":"Description","sidebar":"apiReference"},"api-reference/node/overview":{"id":"api-reference/node/overview","title":"API Overview","description":"This is the API overview for the @ironclad/rivet-node Node.js library. Each of the exports in the api.ts file is documented in its own page, as linked below:","sidebar":"apiReference"},"api-reference/node/RivetDebuggerServer":{"id":"api-reference/node/RivetDebuggerServer","title":"RivetDebuggerServer","description":"","sidebar":"apiReference"},"api-reference/node/runGraph":{"id":"api-reference/node/runGraph","title":"runGraph","description":"Description","sidebar":"apiReference"},"api-reference/node/runGraphInFile":{"id":"api-reference/node/runGraphInFile","title":"runGraphInFile","description":"Description","sidebar":"apiReference"},"api-reference/node/RunGraphOptions":{"id":"api-reference/node/RunGraphOptions","title":"RunGraphOptions","description":"Description","sidebar":"apiReference"},"api-reference/node/startDebuggerServer":{"id":"api-reference/node/startDebuggerServer","title":"startDebuggerServer","description":"Description","sidebar":"apiReference"},"api-reference/recording":{"id":"api-reference/recording","title":"Recording","description":"Enabling recording of your rivet graph executions is simple and straightforward."},"api-reference/remote-debugging":{"id":"api-reference/remote-debugging","title":"Remote Debugging with Rivet","description":"Introduction","sidebar":"apiReference"},"getting-started/first-ai-agent":{"id":"getting-started/first-ai-agent","title":"First AI Agent","description":"When you first open Rivet you are presented with a blank canvas. This is where you can create your first AI agent.","sidebar":"userGuide"},"getting-started/installation":{"id":"getting-started/installation","title":"Installation","description":"System Requirements","sidebar":"userGuide"},"getting-started/setup":{"id":"getting-started/setup","title":"Setup","description":"Settings","sidebar":"userGuide"},"introduction":{"id":"introduction","title":"Introduction to Rivet","description":"Welcome to the Rivet User Guide! Rivet is a powerful Integrated Development Environment (IDE) and library designed for creating AI agents using a visual, graph-based interface. This guide will provide you with an overview of Rivet\'s capabilities and walk you through its various features and functionalities.","sidebar":"userGuide"},"node-reference":{"id":"node-reference","title":"Rivet Node Reference","description":"The node reference contains information about every node built-in to Rivet.","sidebar":"nodeReference"},"node-reference/abort-graph":{"id":"node-reference/abort-graph","title":"Abort Graph Node","description":"Overview","sidebar":"nodeReference"},"node-reference/all-nodes":{"id":"node-reference/all-nodes","title":"All Nodes","description":"The following is all of the nodes built-in to the core of Rivet.","sidebar":"nodeReference"},"node-reference/append-to-dataset":{"id":"node-reference/append-to-dataset","title":"Append to Dataset Node","description":"Append to Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/array":{"id":"node-reference/array","title":"Array Node","description":"Overview","sidebar":"nodeReference"},"node-reference/assemble-prompt":{"id":"node-reference/assemble-prompt","title":"Assemble Prompt Node","description":"Overview","sidebar":"nodeReference"},"node-reference/audio":{"id":"node-reference/audio","title":"Audio Node","description":"Audio Node Screenshot","sidebar":"nodeReference"},"node-reference/bool":{"id":"node-reference/bool","title":"Bool Node","description":"Bool Node Screenshot","sidebar":"nodeReference"},"node-reference/chat":{"id":"node-reference/chat","title":"Chat Node","description":"Overview","sidebar":"nodeReference"},"node-reference/chunk":{"id":"node-reference/chunk","title":"Chunk Node","description":"Overview","sidebar":"nodeReference"},"node-reference/coalesce":{"id":"node-reference/coalesce","title":"Coalesce Node","description":"Overview","sidebar":"nodeReference"},"node-reference/code":{"id":"node-reference/code","title":"Code Node","description":"Code Node Screenshot","sidebar":"nodeReference"},"node-reference/comment":{"id":"node-reference/comment","title":"Comment Node","description":"Comment Node Screenshot","sidebar":"nodeReference"},"node-reference/compare":{"id":"node-reference/compare","title":"Compare Node","description":"Overview","sidebar":"nodeReference"},"node-reference/context":{"id":"node-reference/context","title":"Context Node","description":"Context Node Screenshot","sidebar":"nodeReference"},"node-reference/create-dataset":{"id":"node-reference/create-dataset","title":"Create Dataset Node","description":"Create Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/delay":{"id":"node-reference/delay","title":"Delay Node","description":"Delay Node Screenshot","sidebar":"nodeReference"},"node-reference/evaluate":{"id":"node-reference/evaluate","title":"Evaluate Node","description":"Evaluate Node Screenshot","sidebar":"nodeReference"},"node-reference/external-call":{"id":"node-reference/external-call","title":"External Call Node","description":"External Call Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-json":{"id":"node-reference/extract-json","title":"Extract JSON Node","description":"Extract JSON Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-markdown-code-blocks":{"id":"node-reference/extract-markdown-code-blocks","title":"Extract Markdown Code Blocks Node","description":"Extract Markdown Code Blocks Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-object-path":{"id":"node-reference/extract-object-path","title":"Extract Object Path Node","description":"Extract Object Path Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-with-regex":{"id":"node-reference/extract-with-regex","title":"Extract with Regex Node","description":"Extract with Regex Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-yaml":{"id":"node-reference/extract-yaml","title":"Extract YAML Node","description":"Extract YAML Node Screenshot","sidebar":"nodeReference"},"node-reference/filter":{"id":"node-reference/filter","title":"Filter Node","description":"Filter Node Screenshot","sidebar":"nodeReference"},"node-reference/get-all-datasets":{"id":"node-reference/get-all-datasets","title":"Get All Datasets Node","description":"Get All Datasets Node Screenshot","sidebar":"nodeReference"},"node-reference/get-dataset-row":{"id":"node-reference/get-dataset-row","title":"Get Dataset Row Node","description":"Get Dataset Row Node Screenshot","sidebar":"nodeReference"},"node-reference/get-embedding":{"id":"node-reference/get-embedding","title":"Get Embedding Node","description":"Get Embedding Node Screenshot","sidebar":"nodeReference"},"node-reference/get-global":{"id":"node-reference/get-global","title":"Get Global Node","description":"Get Global Node Screenshot","sidebar":"nodeReference"},"node-reference/gpt-function":{"id":"node-reference/gpt-function","title":"GPT Function Node","description":"GPT Function Node Screenshot","sidebar":"nodeReference"},"node-reference/graph-input":{"id":"node-reference/graph-input","title":"Graph Input Node","description":"Graph Input Node Screenshot","sidebar":"nodeReference"},"node-reference/graph-output":{"id":"node-reference/graph-output","title":"Graph Output Node","description":"Graph Output Node Screenshot","sidebar":"nodeReference"},"node-reference/hash":{"id":"node-reference/hash","title":"Hash Node","description":"Hash Node Screenshot","sidebar":"nodeReference"},"node-reference/http-call":{"id":"node-reference/http-call","title":"HTTP Call Node","description":"HTTP Call Node Screenshot","sidebar":"nodeReference"},"node-reference/if":{"id":"node-reference/if","title":"If Node","description":"Overview","sidebar":"nodeReference"},"node-reference/if-else":{"id":"node-reference/if-else","title":"If/Else Node","description":"If/Else Node Screenshot","sidebar":"nodeReference"},"node-reference/image":{"id":"node-reference/image","title":"Image Node","description":"Image Node Screenshot","sidebar":"nodeReference"},"node-reference/join":{"id":"node-reference/join","title":"Join Node","description":"Join Node Screenshot","sidebar":"nodeReference"},"node-reference/knn-dataset":{"id":"node-reference/knn-dataset","title":"KNN Dataset Node","description":"KNN Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/load-dataset":{"id":"node-reference/load-dataset","title":"Load Dataset Node","description":"Load Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/loop-controller":{"id":"node-reference/loop-controller","title":"Loop Controller Node","description":"Loop Controller Node Screenshot","sidebar":"nodeReference"},"node-reference/match":{"id":"node-reference/match","title":"Match Node","description":"Match Node Screenshot","sidebar":"nodeReference"},"node-reference/number":{"id":"node-reference/number","title":"Number Node","description":"Number Node Screenshot","sidebar":"nodeReference"},"node-reference/object":{"id":"node-reference/object","title":"Object Node","description":"Object Node Screenshot","sidebar":"nodeReference"},"node-reference/passthrough":{"id":"node-reference/passthrough","title":"Passthrough Node","description":"Passthrough Node Screenshot","sidebar":"nodeReference"},"node-reference/pop":{"id":"node-reference/pop","title":"Pop Node","description":"Pop Node Screenshot","sidebar":"nodeReference"},"node-reference/prompt":{"id":"node-reference/prompt","title":"Prompt Node","description":"Prompt Node Screenshot","sidebar":"nodeReference"},"node-reference/race-inputs":{"id":"node-reference/race-inputs","title":"Race Inputs Node","description":"Race Inputs Node Screenshot","sidebar":"nodeReference"},"node-reference/raise-event":{"id":"node-reference/raise-event","title":"Raise Event Node","description":"Raise Event Node Screenshot","sidebar":"nodeReference"},"node-reference/read-directory":{"id":"node-reference/read-directory","title":"Read Directory Node","description":"Read Directory Node Screenshot","sidebar":"nodeReference"},"node-reference/read-file":{"id":"node-reference/read-file","title":"Read File Node","description":"Read File Node Screenshot","sidebar":"nodeReference"},"node-reference/RNG":{"id":"node-reference/RNG","title":"RNG Node","description":"Random Number Node Screenshot","sidebar":"nodeReference"},"node-reference/set-global":{"id":"node-reference/set-global","title":"Set Global Node","description":"Set Global Node Screenshot","sidebar":"nodeReference"},"node-reference/shuffle":{"id":"node-reference/shuffle","title":"Shuffle Node","description":"Shuffle Node Screenshot","sidebar":"nodeReference"},"node-reference/slice":{"id":"node-reference/slice","title":"Slice Node","description":"Slice Node Screenshot","sidebar":"nodeReference"},"node-reference/split-text":{"id":"node-reference/split-text","title":"Split Text Node","description":"Split Text Node Screenshot","sidebar":"nodeReference"},"node-reference/subgraph":{"id":"node-reference/subgraph","title":"Subgraph Node","description":"Subgraph Node Screenshot","sidebar":"nodeReference"},"node-reference/text":{"id":"node-reference/text","title":"Text Node","description":"Text Node Screenshot","sidebar":"nodeReference"},"node-reference/to-json":{"id":"node-reference/to-json","title":"To JSON Node","description":"To JSON Node Screenshot","sidebar":"nodeReference"},"node-reference/to-yaml":{"id":"node-reference/to-yaml","title":"To YAML Node","description":"To YAML Node Screenshot","sidebar":"nodeReference"},"node-reference/trim-chat-messages":{"id":"node-reference/trim-chat-messages","title":"Trim Chat Messages Node","description":"Trim Chat Messages Node Screenshot","sidebar":"nodeReference"},"node-reference/user-input":{"id":"node-reference/user-input","title":"User Input Node","description":"User Input Node Screenshot","sidebar":"nodeReference"},"node-reference/vector-knn":{"id":"node-reference/vector-knn","title":"Vector K-Nearest Neighbors Node","description":"Overview","sidebar":"nodeReference"},"node-reference/vector-store":{"id":"node-reference/vector-store","title":"Vector Store","description":"Chat Node Screenshot","sidebar":"nodeReference"},"node-reference/wait-for-event":{"id":"node-reference/wait-for-event","title":"Wait For Event Node","description":"Wait For Event Node Screenshot","sidebar":"nodeReference"},"trivet":{"id":"trivet","title":"Trivet","description":"Trivet is a library for running Rivet tests, and an integrated test runner in the Rivet application.","sidebar":"userGuide"},"tutorial":{"id":"tutorial","title":"Rivet Tutorial","description":"The tutorial series in the sidebar will walk you through the process of creating graphs and using different node","sidebar":"tutorial"},"tutorial/installing-getting-started":{"id":"tutorial/installing-getting-started","title":"Installing & Overview","description":"This Tutorial will walk you through the basic building blocks of Rivet.","sidebar":"tutorial"},"tutorial/interpolation-more-node-types":{"id":"tutorial/interpolation-more-node-types","title":"Interpolation & More Node Types","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/loops":{"id":"tutorial/loops","title":"07 - Loops","description":"","sidebar":"tutorial"},"tutorial/matching-conditionals":{"id":"tutorial/matching-conditionals","title":"Matching & Conditionals","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/simple-graph":{"id":"tutorial/simple-graph","title":"Simple Graph","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/splitting":{"id":"tutorial/splitting","title":"06 - Splitting","description":"","sidebar":"tutorial"},"tutorial/subgraphs":{"id":"tutorial/subgraphs","title":"05 - Subgraphs","description":"","sidebar":"tutorial"},"tutorial/testing-graphs":{"id":"tutorial/testing-graphs","title":"08 - Testing Graphs","description":"As your graphs get more complicated, it becomes important to test whether they improving without regressing previous functionality."},"tutorial/yaml":{"id":"tutorial/yaml","title":"04 - YAML","description":"","sidebar":"tutorial"},"user-guide/adding-connecting-nodes":{"id":"user-guide/adding-connecting-nodes","title":"Working with Nodes","description":"Adding Nodes","sidebar":"userGuide"},"user-guide/control-flow":{"id":"user-guide/control-flow","title":"Control Flow","description":"The flow of data in Rivet (and the control of that flow) is handled in two passes on the graph of nodes.","sidebar":"userGuide"},"user-guide/data-types":{"id":"user-guide/data-types","title":"Data Types","description":"Internally, the data the passes through Rivet is marked as a number of data types. When integrating Rivet with your own application, you will need to know what these data types are and how to handle them.","sidebar":"userGuide"},"user-guide/executing-ai-chains":{"id":"user-guide/executing-ai-chains","title":"Executing AI Chains","description":"Data Flow","sidebar":"userGuide"},"user-guide/executors":{"id":"user-guide/executors","title":"Executors","description":"Executors are responsible for running the graphs in Rivet. The executor can be chosen using the dropdown in the menu bar of the application.","sidebar":"userGuide"},"user-guide/features/chat-viewer":{"id":"user-guide/features/chat-viewer","title":"Chat Viewer","description":"The Chat Viewer gives you a live view of all Chat nodes that are running in your Rivet graphs. It is accessible by clicking the \\"Chat Viewer\\" tab at the top of Rivet.","sidebar":"userGuide"},"user-guide/features/data-studio":{"id":"user-guide/features/data-studio","title":"Data Studio","description":"The Data Studio in Rivet is your scratch pad for working with data and graphs. It is accessible by clicking the \\"Data Studio\\" tab at the top of Rivet.","sidebar":"userGuide"},"user-guide/features/prompt-designer":{"id":"user-guide/features/prompt-designer","title":"Prompt Designer","description":"The Prompt Designer gives you a UI to tweak and design your prompts that you pass into your Chat nodes.","sidebar":"userGuide"},"user-guide/features/trivet-tests":{"id":"user-guide/features/trivet-tests","title":"Trivet Tests","description":"See Trivet for more information.","sidebar":"userGuide"},"user-guide/live-debugging":{"id":"user-guide/live-debugging","title":"Live Debugging","description":"Currently Executing Nodes","sidebar":"userGuide"},"user-guide/loops":{"id":"user-guide/loops","title":"Loops","description":"Loops and the loop controller are the most difficult concept in Rivet. They are also incredibly powerful and necessary for many use cases.","sidebar":"userGuide"},"user-guide/overview-of-interface":{"id":"user-guide/overview-of-interface","title":"Overview of the Interface","description":"Sidebar","sidebar":"userGuide"},"user-guide/plugins":{"id":"user-guide/plugins","title":"Plugins","description":"Plugins allow authors to extend the functionality of Rivet, such as adding new nodes that you can use in your graphs.","sidebar":"userGuide"},"user-guide/plugins/built-in/all":{"id":"user-guide/plugins/built-in/all","title":"All Built-In Plugins","description":"The available built-in plugins are:","sidebar":"userGuide"},"user-guide/plugins/built-in/anthropic":{"id":"user-guide/plugins/built-in/anthropic","title":"Anthropic Plugin","description":"The Anthropic plugin provides access to Claude and Claude Instant using the","sidebar":"userGuide"},"user-guide/plugins/built-in/assemblyai":{"id":"user-guide/plugins/built-in/assemblyai","title":"AssemblyAI Plugin","description":"At the moment you must use the node executor to use the AssemblyAI plugin in the Rivet UI. You may also use the plugin when embedding Rivet in your own application.","sidebar":"userGuide"},"user-guide/plugins/built-in/autoevals":{"id":"user-guide/plugins/built-in/autoevals","title":"Autoevals Plugin","description":"The Autoevals plugin provides a node that can automatically evaluate the performance of an LLM response using a battle-tested set of prompts.","sidebar":"userGuide"},"user-guide/plugins/built-in/gentrace":{"id":"user-guide/plugins/built-in/gentrace","title":"Gentrace Plugin","description":"Gentrace is\xa0an evaluation and observability product that helps improve the quality, safety, and compliance of your AI features.","sidebar":"userGuide"},"user-guide/plugins/built-in/huggingface":{"id":"user-guide/plugins/built-in/huggingface","title":"Hugging Face Plugin","description":"","sidebar":"userGuide"},"user-guide/plugins/built-in/pinecone":{"id":"user-guide/plugins/built-in/pinecone","title":"Pinecone Plugin","description":"","sidebar":"userGuide"},"user-guide/plugins/creating-plugins":{"id":"user-guide/plugins/creating-plugins","title":"Creating a Plugin","description":"Introduction","sidebar":"userGuide"},"user-guide/prompt-designer":{"id":"user-guide/prompt-designer","title":"Prompt Designer","description":"TODO"},"user-guide/recordings":{"id":"user-guide/recordings","title":"Recordings","description":"Using the ExecutionRecorder class in your code, you can generate .rivet-recording files that contain","sidebar":"userGuide"},"user-guide/remote-debugging":{"id":"user-guide/remote-debugging","title":"Remote Debugging","description":"Remote debugging allows you to integrate the Rivet Core or Rivet Node libraries in another application, run your graphs in that other application, but see the live graph execution in the Rivet application! This is useful for debugging graphs that are running in a production environment, or for debugging graphs that are running in a different environment than the Rivet application. This is very useful when using the External Call Node, as the default executor cannot call into your own application\'s code.","sidebar":"userGuide"},"user-guide/splitting":{"id":"user-guide/splitting","title":"Splitting","description":"Splitting a node is a powerful tool for parallelizing execution. Change a node to a Split node by toggling on Split on any node:","sidebar":"userGuide"},"user-guide/subgraphs":{"id":"user-guide/subgraphs","title":"Subgraphs","description":"Subgraphs are a powerful tool for composing graphs together. They allow you to create a graph that can be used as a node in another graph. This allows you to create reusable components, and to create graphs that are easier to understand.","sidebar":"userGuide"},"user-guide/trivet-getting-started":{"id":"user-guide/trivet-getting-started","title":"Trivet - Getting Started","description":"To get started with Trivet, select the Trivet Tests tab at the top of the Rivet application.","sidebar":"userGuide"},"user-guide/trivet-library":{"id":"user-guide/trivet-library","title":"Trivet Library","description":"The Trivet Library is a powerful tool for running tests on your Rivet projects programmatically. It provides a way to validate and test the functionality of your Rivet graphs. All code examples in this documentation are written in TypeScript.","sidebar":"userGuide"},"user-guide/trivet-tutorial":{"id":"user-guide/trivet-tutorial","title":"Trivet - Tutorial","description":"Suppose that we want to test a simple graph that executes a call against GPT-3.5, but that names the assistant:","sidebar":"userGuide"},"user-guide/trivet-validation-graphs":{"id":"user-guide/trivet-validation-graphs","title":"Trivet - Validator Graphs","description":"Instead of using baked-in validations, Trivet uses Rivet graphs to perform validation on your test graph. This allows you the ultimate flexibility in how you want to validate your graph. It is common to make LLM calls to validate your graph - a great pattern is asking an LLM to respond with YES or NO after asking it a question, and then using a Match node to find either the YES or NO.","sidebar":"userGuide"},"user-guide/working-with-graphs":{"id":"user-guide/working-with-graphs","title":"Working with Graphs","description":"A Rivet project contains a set of named graphs. Each of these graphs contains a set of nodes connected together, forming the graph.","sidebar":"userGuide"},"user-guide/working-with-projects":{"id":"user-guide/working-with-projects","title":"Working with Projects","description":"A Rivet project contains a set of graphs. These graphs can call each other by using a Subgraph Node. Any graph can call any other graph in the project (including itself).","sidebar":"userGuide"}}}')}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.6511b052.js b/assets/js/935f2afb.6511b052.js new file mode 100644 index 000000000..3c7e06231 --- /dev/null +++ b/assets/js/935f2afb.6511b052.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"userGuide":[{"type":"link","label":"Introduction to Rivet","href":"/docs/","docId":"introduction"},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Installation","href":"/docs/getting-started/installation","docId":"getting-started/installation"},{"type":"link","label":"Setup","href":"/docs/getting-started/setup","docId":"getting-started/setup"},{"type":"link","label":"First AI Agent","href":"/docs/getting-started/first-ai-agent","docId":"getting-started/first-ai-agent"}]},{"type":"category","label":"Working with Rivet","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Overview of the Interface","href":"/docs/user-guide/overview-of-interface","docId":"user-guide/overview-of-interface"},{"type":"link","label":"Working with Nodes","href":"/docs/user-guide/adding-connecting-nodes","docId":"user-guide/adding-connecting-nodes"},{"type":"link","label":"Working with Graphs","href":"/docs/user-guide/working-with-graphs","docId":"user-guide/working-with-graphs"},{"type":"link","label":"Working with Projects","href":"/docs/user-guide/working-with-projects","docId":"user-guide/working-with-projects"},{"type":"link","label":"Executing AI Chains","href":"/docs/user-guide/executing-ai-chains","docId":"user-guide/executing-ai-chains"},{"type":"link","label":"Splitting","href":"/docs/user-guide/splitting","docId":"user-guide/splitting"},{"type":"link","label":"Subgraphs","href":"/docs/user-guide/subgraphs","docId":"user-guide/subgraphs"},{"type":"link","label":"Executors","href":"/docs/user-guide/executors","docId":"user-guide/executors"},{"type":"link","label":"Recordings","href":"/docs/user-guide/recordings","docId":"user-guide/recordings"}]},{"type":"category","label":"Features","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Prompt Designer","href":"/docs/user-guide/features/prompt-designer","docId":"user-guide/features/prompt-designer"},{"type":"link","label":"Trivet Tests","href":"/docs/user-guide/features/trivet-tests","docId":"user-guide/features/trivet-tests"},{"type":"link","label":"Chat Viewer","href":"/docs/user-guide/features/chat-viewer","docId":"user-guide/features/chat-viewer"},{"type":"link","label":"Data Studio","href":"/docs/user-guide/features/data-studio","docId":"user-guide/features/data-studio"}]},{"type":"category","label":"Plugins","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Plugins","href":"/docs/user-guide/plugins","docId":"user-guide/plugins"},{"type":"link","label":"Creating a Plugin","href":"/docs/user-guide/plugins/creating-plugins","docId":"user-guide/plugins/creating-plugins"}]},{"type":"category","label":"Built-In Plugins","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"All Built-In Plugins","href":"/docs/user-guide/plugins/built-in/all","docId":"user-guide/plugins/built-in/all"},{"type":"link","label":"Anthropic","href":"/docs/user-guide/plugins/built-in/anthropic","docId":"user-guide/plugins/built-in/anthropic"},{"type":"link","label":"AssemblyAI","href":"/docs/user-guide/plugins/built-in/assemblyai","docId":"user-guide/plugins/built-in/assemblyai"},{"type":"link","label":"Autoevals","href":"/docs/user-guide/plugins/built-in/autoevals","docId":"user-guide/plugins/built-in/autoevals"},{"type":"link","label":"Gentrace","href":"/docs/user-guide/plugins/built-in/gentrace","docId":"user-guide/plugins/built-in/gentrace"},{"type":"link","label":"Hugging Face","href":"/docs/user-guide/plugins/built-in/huggingface","docId":"user-guide/plugins/built-in/huggingface"},{"type":"link","label":"Pinecone","href":"/docs/user-guide/plugins/built-in/pinecone","docId":"user-guide/plugins/built-in/pinecone"}]},{"type":"category","label":"Debugging","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Live Debugging","href":"/docs/user-guide/live-debugging","docId":"user-guide/live-debugging"},{"type":"link","label":"Remote Debugging","href":"/docs/user-guide/remote-debugging","docId":"user-guide/remote-debugging"}]},{"type":"category","label":"Testing","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Trivet","href":"/docs/trivet","docId":"trivet"},{"type":"link","label":"Getting Started","href":"/docs/user-guide/trivet-getting-started","docId":"user-guide/trivet-getting-started"},{"type":"link","label":"Validation Graphs","href":"/docs/user-guide/trivet-validation-graphs","docId":"user-guide/trivet-validation-graphs"},{"type":"link","label":"Tutorial","href":"/docs/user-guide/trivet-tutorial","docId":"user-guide/trivet-tutorial"},{"type":"link","label":"Trivet Library","href":"/docs/user-guide/trivet-library","docId":"user-guide/trivet-library"}]},{"type":"category","label":"Advanced","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Data Types","href":"/docs/user-guide/data-types","docId":"user-guide/data-types"},{"type":"link","label":"Control Flow","href":"/docs/user-guide/control-flow","docId":"user-guide/control-flow"},{"type":"link","label":"Loops","href":"/docs/user-guide/loops","docId":"user-guide/loops"}]}],"tutorial":[{"type":"link","label":"Rivet Tutorial","href":"/docs/tutorial","docId":"tutorial"},{"type":"link","label":"00 - Installing & Overview","href":"/docs/tutorial/installing-getting-started","docId":"tutorial/installing-getting-started"},{"type":"link","label":"01 - Simple Graph","href":"/docs/tutorial/simple-graph","docId":"tutorial/simple-graph"},{"type":"link","label":"02 - Interpolation & More Node Types","href":"/docs/tutorial/interpolation-more-node-types","docId":"tutorial/interpolation-more-node-types"},{"type":"link","label":"03 - Matching & Conditionals","href":"/docs/tutorial/matching-conditionals","docId":"tutorial/matching-conditionals"},{"type":"link","label":"04 - YAML","href":"/docs/tutorial/yaml","docId":"tutorial/yaml"},{"type":"link","label":"05 - Subgraphs","href":"/docs/tutorial/subgraphs","docId":"tutorial/subgraphs"},{"type":"link","label":"06 - Splitting","href":"/docs/tutorial/splitting","docId":"tutorial/splitting"},{"type":"link","label":"07 - Loops","href":"/docs/tutorial/loops","docId":"tutorial/loops"}],"apiReference":[{"type":"link","label":"Rivet API Reference","href":"/docs/api-reference","docId":"api-reference"},{"type":"link","label":"Rivet Integration Getting Started","href":"/docs/api-reference/getting-started-integration","docId":"api-reference/getting-started-integration"},{"type":"link","label":"Remote Debugging with Rivet","href":"/docs/api-reference/remote-debugging","docId":"api-reference/remote-debugging"},{"type":"category","label":"@rivet/node","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"API Overview","href":"/docs/api-reference/node/overview","docId":"api-reference/node/overview"},{"type":"link","label":"createProcessor","href":"/docs/api-reference/node/createProcessor","docId":"api-reference/node/createProcessor"},{"type":"link","label":"loadProjectFromFile","href":"/docs/api-reference/node/loadProjectFromFile","docId":"api-reference/node/loadProjectFromFile"},{"type":"link","label":"loadProjectFromString","href":"/docs/api-reference/node/loadProjectFromString","docId":"api-reference/node/loadProjectFromString"},{"type":"link","label":"runGraph","href":"/docs/api-reference/node/runGraph","docId":"api-reference/node/runGraph"},{"type":"link","label":"runGraphInFile","href":"/docs/api-reference/node/runGraphInFile","docId":"api-reference/node/runGraphInFile"},{"type":"link","label":"startDebuggerServer","href":"/docs/api-reference/node/startDebuggerServer","docId":"api-reference/node/startDebuggerServer"},{"type":"category","label":"Types","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"DebuggerEvents","href":"/docs/api-reference/node/DebuggerEvents","docId":"api-reference/node/DebuggerEvents"},{"type":"link","label":"LooseDataValue","href":"/docs/api-reference/node/LooseDataValue","docId":"api-reference/node/LooseDataValue"},{"type":"link","label":"RivetDebuggerServer","href":"/docs/api-reference/node/RivetDebuggerServer","docId":"api-reference/node/RivetDebuggerServer"},{"type":"link","label":"RunGraphOptions","href":"/docs/api-reference/node/RunGraphOptions","docId":"api-reference/node/RunGraphOptions"}]}]},{"type":"category","label":"@rivet/core","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"API Overview","href":"/docs/api-reference/core/overview","docId":"api-reference/core/overview"},{"type":"link","label":"DataValue","href":"/docs/api-reference/core/DataValue","docId":"api-reference/core/DataValue"},{"type":"link","label":"GraphProcessor","href":"/docs/api-reference/core/GraphProcessor","docId":"api-reference/core/GraphProcessor"},{"type":"category","label":"Types","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"DataValue","href":"/docs/api-reference/core/DataValue","docId":"api-reference/core/DataValue"},{"type":"link","label":"NodeGraph","href":"/docs/api-reference/core/NodeGraph","docId":"api-reference/core/NodeGraph"},{"type":"link","label":"Project","href":"/docs/api-reference/core/Project","docId":"api-reference/core/Project"},{"type":"link","label":"Settings","href":"/docs/api-reference/core/Settings","docId":"api-reference/core/Settings"}]}]}],"nodeReference":[{"type":"link","label":"Rivet Node Reference","href":"/docs/node-reference","docId":"node-reference"},{"type":"link","label":"All Nodes","href":"/docs/node-reference/all-nodes","docId":"node-reference/all-nodes"},{"type":"category","label":"Text","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Chunk","href":"/docs/node-reference/chunk","docId":"node-reference/chunk"},{"type":"link","label":"Extract Markdown Code Blocks","href":"/docs/node-reference/extract-markdown-code-blocks","docId":"node-reference/extract-markdown-code-blocks"},{"type":"link","label":"Extract with Regex","href":"/docs/node-reference/extract-with-regex","docId":"node-reference/extract-with-regex"},{"type":"link","label":"Join","href":"/docs/node-reference/join","docId":"node-reference/join"},{"type":"link","label":"Prompt","href":"/docs/node-reference/prompt","docId":"node-reference/prompt"},{"type":"link","label":"Split Text","href":"/docs/node-reference/split-text","docId":"node-reference/split-text"},{"type":"link","label":"Text","href":"/docs/node-reference/text","docId":"node-reference/text"},{"type":"link","label":"To YAML","href":"/docs/node-reference/to-yaml","docId":"node-reference/to-yaml"},{"type":"link","label":"To JSON","href":"/docs/node-reference/to-json","docId":"node-reference/to-json"}]},{"type":"category","label":"AI","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Assemble Message","href":"/docs/node-reference/assemble-message","docId":"node-reference/assemble-message"},{"type":"link","label":"Assemble Prompt","href":"/docs/node-reference/assemble-prompt","docId":"node-reference/assemble-prompt"},{"type":"link","label":"Chat","href":"/docs/node-reference/chat","docId":"node-reference/chat"},{"type":"link","label":"GPT Function","href":"/docs/node-reference/gpt-function","docId":"node-reference/gpt-function"},{"type":"link","label":"Get Embedding","href":"/docs/node-reference/get-embedding","docId":"node-reference/get-embedding"},{"type":"link","label":"Trim Chat Messages","href":"/docs/node-reference/trim-chat-messages","docId":"node-reference/trim-chat-messages"}]},{"type":"category","label":"Lists","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Array","href":"/docs/node-reference/array","docId":"node-reference/array"},{"type":"link","label":"Filter","href":"/docs/node-reference/filter","docId":"node-reference/filter"},{"type":"link","label":"Pop","href":"/docs/node-reference/pop","docId":"node-reference/pop"},{"type":"link","label":"Shuffle","href":"/docs/node-reference/shuffle","docId":"node-reference/shuffle"},{"type":"link","label":"Slice","href":"/docs/node-reference/slice","docId":"node-reference/slice"}]},{"type":"category","label":"Numbers","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Evaluate","href":"/docs/node-reference/evaluate","docId":"node-reference/evaluate"},{"type":"link","label":"Number","href":"/docs/node-reference/number","docId":"node-reference/number"},{"type":"link","label":"RNG","href":"/docs/node-reference/RNG","docId":"node-reference/RNG"}]},{"type":"category","label":"Objects","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Destructure","href":"/docs/node-reference/destructure","docId":"node-reference/destructure"},{"type":"link","label":"Extract JSON","href":"/docs/node-reference/extract-json","docId":"node-reference/extract-json"},{"type":"link","label":"Extract Object Path","href":"/docs/node-reference/extract-object-path","docId":"node-reference/extract-object-path"},{"type":"link","label":"Extract YAML","href":"/docs/node-reference/extract-yaml","docId":"node-reference/extract-yaml"},{"type":"link","label":"Object","href":"/docs/node-reference/object","docId":"node-reference/object"}]},{"type":"category","label":"Data","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Audio","href":"/docs/node-reference/audio","docId":"node-reference/audio"},{"type":"link","label":"Bool","href":"/docs/node-reference/bool","docId":"node-reference/bool"},{"type":"link","label":"Hash","href":"/docs/node-reference/hash","docId":"node-reference/hash"},{"type":"link","label":"Image","href":"/docs/node-reference/image","docId":"node-reference/image"},{"type":"link","label":"URL Reference","href":"/docs/node-reference/url-reference","docId":"node-reference/url-reference"}]},{"type":"category","label":"Logic","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Abort Graph","href":"/docs/node-reference/abort-graph","docId":"node-reference/abort-graph"},{"type":"link","label":"Coalesce","href":"/docs/node-reference/coalesce","docId":"node-reference/coalesce"},{"type":"link","label":"Compare","href":"/docs/node-reference/compare","docId":"node-reference/compare"},{"type":"link","label":"Delay","href":"/docs/node-reference/delay","docId":"node-reference/delay"},{"type":"link","label":"If","href":"/docs/node-reference/if","docId":"node-reference/if"},{"type":"link","label":"If/Else","href":"/docs/node-reference/if-else","docId":"node-reference/if-else"},{"type":"link","label":"Loop Controller","href":"/docs/node-reference/loop-controller","docId":"node-reference/loop-controller"},{"type":"link","label":"Match","href":"/docs/node-reference/match","docId":"node-reference/match"},{"type":"link","label":"Passthrough","href":"/docs/node-reference/passthrough","docId":"node-reference/passthrough"},{"type":"link","label":"Race Inputs","href":"/docs/node-reference/race-inputs","docId":"node-reference/race-inputs"}]},{"type":"category","label":"Input/Output","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Append to Dataset","href":"/docs/node-reference/append-to-dataset","docId":"node-reference/append-to-dataset"},{"type":"link","label":"Create Dataset","href":"/docs/node-reference/create-dataset","docId":"node-reference/create-dataset"},{"type":"link","label":"Get All Datasets","href":"/docs/node-reference/get-all-datasets","docId":"node-reference/get-all-datasets"},{"type":"link","label":"Get Dataset Row","href":"/docs/node-reference/get-dataset-row","docId":"node-reference/get-dataset-row"},{"type":"link","label":"Graph Input","href":"/docs/node-reference/graph-input","docId":"node-reference/graph-input"},{"type":"link","label":"Graph Output","href":"/docs/node-reference/graph-output","docId":"node-reference/graph-output"},{"type":"link","label":"KNN Dataset","href":"/docs/node-reference/knn-dataset","docId":"node-reference/knn-dataset"},{"type":"link","label":"Load Dataset","href":"/docs/node-reference/load-dataset","docId":"node-reference/load-dataset"},{"type":"link","label":"Read Directory","href":"/docs/node-reference/read-directory","docId":"node-reference/read-directory"},{"type":"link","label":"Read File","href":"/docs/node-reference/read-file","docId":"node-reference/read-file"},{"type":"link","label":"Replace Dataset","href":"/docs/node-reference/replace-dataset","docId":"node-reference/replace-dataset"},{"type":"link","label":"User Input","href":"/docs/node-reference/user-input","docId":"node-reference/user-input"},{"type":"link","label":"Vector Store","href":"/docs/node-reference/vector-store","docId":"node-reference/vector-store"},{"type":"link","label":"Vector KNN","href":"/docs/node-reference/vector-knn","docId":"node-reference/vector-knn"}]},{"type":"category","label":"Advanced","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Code","href":"/docs/node-reference/code","docId":"node-reference/code"},{"type":"link","label":"Comment","href":"/docs/node-reference/comment","docId":"node-reference/comment"},{"type":"link","label":"Context","href":"/docs/node-reference/context","docId":"node-reference/context"},{"type":"link","label":"External Call","href":"/docs/node-reference/external-call","docId":"node-reference/external-call"},{"type":"link","label":"Get Global","href":"/docs/node-reference/get-global","docId":"node-reference/get-global"},{"type":"link","label":"HTTP Call","href":"/docs/node-reference/http-call","docId":"node-reference/http-call"},{"type":"link","label":"Raise Event","href":"/docs/node-reference/raise-event","docId":"node-reference/raise-event"},{"type":"link","label":"Set Global","href":"/docs/node-reference/set-global","docId":"node-reference/set-global"},{"type":"link","label":"Subgraph","href":"/docs/node-reference/subgraph","docId":"node-reference/subgraph"},{"type":"link","label":"Wait For Event","href":"/docs/node-reference/wait-for-event","docId":"node-reference/wait-for-event"}]}]},"docs":{"api-reference":{"id":"api-reference","title":"Rivet API Reference","description":"This section of the Rivet documentation goes over the TypeScript APIs for @ironclad/rivet-core and @ironclad/rivet-node.","sidebar":"apiReference"},"api-reference/core/DataValue":{"id":"api-reference/core/DataValue","title":"DataValue","description":"","sidebar":"apiReference"},"api-reference/core/GraphProcessor":{"id":"api-reference/core/GraphProcessor","title":"GraphProcessor","description":"","sidebar":"apiReference"},"api-reference/core/NodeGraph":{"id":"api-reference/core/NodeGraph","title":"NodeGraph","description":"","sidebar":"apiReference"},"api-reference/core/overview":{"id":"api-reference/core/overview","title":"API Overview","description":"","sidebar":"apiReference"},"api-reference/core/Project":{"id":"api-reference/core/Project","title":"Project","description":"","sidebar":"apiReference"},"api-reference/core/Settings":{"id":"api-reference/core/Settings","title":"Settings","description":"Description","sidebar":"apiReference"},"api-reference/getting-started-integration":{"id":"api-reference/getting-started-integration","title":"Rivet Integration Getting Started","description":"Welcome to the starting guide for integrating Rivet into your application! Currently, we only support integration via Node.js using the @ironclad/rivet-node package.","sidebar":"apiReference"},"api-reference/node/createProcessor":{"id":"api-reference/node/createProcessor","title":"createProcessor","description":"","sidebar":"apiReference"},"api-reference/node/DebuggerEvents":{"id":"api-reference/node/DebuggerEvents","title":"DebuggerEvents","description":"","sidebar":"apiReference"},"api-reference/node/loadProjectFromFile":{"id":"api-reference/node/loadProjectFromFile","title":"loadProjectFromFile","description":"Description","sidebar":"apiReference"},"api-reference/node/loadProjectFromString":{"id":"api-reference/node/loadProjectFromString","title":"loadProjectFromString","description":"Description","sidebar":"apiReference"},"api-reference/node/LooseDataValue":{"id":"api-reference/node/LooseDataValue","title":"LooseDataValue","description":"Description","sidebar":"apiReference"},"api-reference/node/overview":{"id":"api-reference/node/overview","title":"API Overview","description":"This is the API overview for the @ironclad/rivet-node Node.js library. Each of the exports in the api.ts file is documented in its own page, as linked below:","sidebar":"apiReference"},"api-reference/node/RivetDebuggerServer":{"id":"api-reference/node/RivetDebuggerServer","title":"RivetDebuggerServer","description":"","sidebar":"apiReference"},"api-reference/node/runGraph":{"id":"api-reference/node/runGraph","title":"runGraph","description":"Description","sidebar":"apiReference"},"api-reference/node/runGraphInFile":{"id":"api-reference/node/runGraphInFile","title":"runGraphInFile","description":"Description","sidebar":"apiReference"},"api-reference/node/RunGraphOptions":{"id":"api-reference/node/RunGraphOptions","title":"RunGraphOptions","description":"Description","sidebar":"apiReference"},"api-reference/node/startDebuggerServer":{"id":"api-reference/node/startDebuggerServer","title":"startDebuggerServer","description":"Description","sidebar":"apiReference"},"api-reference/recording":{"id":"api-reference/recording","title":"Recording","description":"Enabling recording of your rivet graph executions is simple and straightforward."},"api-reference/remote-debugging":{"id":"api-reference/remote-debugging","title":"Remote Debugging with Rivet","description":"Introduction","sidebar":"apiReference"},"getting-started/first-ai-agent":{"id":"getting-started/first-ai-agent","title":"First AI Agent","description":"When you first open Rivet you are presented with a blank canvas. This is where you can create your first AI agent.","sidebar":"userGuide"},"getting-started/installation":{"id":"getting-started/installation","title":"Installation","description":"System Requirements","sidebar":"userGuide"},"getting-started/setup":{"id":"getting-started/setup","title":"Setup","description":"Settings","sidebar":"userGuide"},"introduction":{"id":"introduction","title":"Introduction to Rivet","description":"Welcome to the Rivet User Guide! Rivet is a powerful Integrated Development Environment (IDE) and library designed for creating AI agents using a visual, graph-based interface. This guide will provide you with an overview of Rivet\'s capabilities and walk you through its various features and functionalities.","sidebar":"userGuide"},"node-reference":{"id":"node-reference","title":"Rivet Node Reference","description":"The node reference contains information about every node built-in to Rivet.","sidebar":"nodeReference"},"node-reference/abort-graph":{"id":"node-reference/abort-graph","title":"Abort Graph Node","description":"Overview","sidebar":"nodeReference"},"node-reference/all-nodes":{"id":"node-reference/all-nodes","title":"All Nodes","description":"The following is all of the nodes built-in to the core of Rivet.","sidebar":"nodeReference"},"node-reference/append-to-dataset":{"id":"node-reference/append-to-dataset","title":"Append to Dataset Node","description":"Append to Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/array":{"id":"node-reference/array","title":"Array Node","description":"Overview","sidebar":"nodeReference"},"node-reference/assemble-message":{"id":"node-reference/assemble-message","title":"Assemble Message Node","description":"Assemble Message Node Screenshot","sidebar":"nodeReference"},"node-reference/assemble-prompt":{"id":"node-reference/assemble-prompt","title":"Assemble Prompt Node","description":"Overview","sidebar":"nodeReference"},"node-reference/audio":{"id":"node-reference/audio","title":"Audio Node","description":"Audio Node Screenshot","sidebar":"nodeReference"},"node-reference/bool":{"id":"node-reference/bool","title":"Bool Node","description":"Bool Node Screenshot","sidebar":"nodeReference"},"node-reference/chat":{"id":"node-reference/chat","title":"Chat Node","description":"Overview","sidebar":"nodeReference"},"node-reference/chunk":{"id":"node-reference/chunk","title":"Chunk Node","description":"Overview","sidebar":"nodeReference"},"node-reference/coalesce":{"id":"node-reference/coalesce","title":"Coalesce Node","description":"Overview","sidebar":"nodeReference"},"node-reference/code":{"id":"node-reference/code","title":"Code Node","description":"Code Node Screenshot","sidebar":"nodeReference"},"node-reference/comment":{"id":"node-reference/comment","title":"Comment Node","description":"Comment Node Screenshot","sidebar":"nodeReference"},"node-reference/compare":{"id":"node-reference/compare","title":"Compare Node","description":"Overview","sidebar":"nodeReference"},"node-reference/context":{"id":"node-reference/context","title":"Context Node","description":"Context Node Screenshot","sidebar":"nodeReference"},"node-reference/create-dataset":{"id":"node-reference/create-dataset","title":"Create Dataset Node","description":"Create Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/delay":{"id":"node-reference/delay","title":"Delay Node","description":"Delay Node Screenshot","sidebar":"nodeReference"},"node-reference/destructure":{"id":"node-reference/destructure","title":"Destructure Node","description":"Destructure Node Screenshot","sidebar":"nodeReference"},"node-reference/evaluate":{"id":"node-reference/evaluate","title":"Evaluate Node","description":"Evaluate Node Screenshot","sidebar":"nodeReference"},"node-reference/external-call":{"id":"node-reference/external-call","title":"External Call Node","description":"External Call Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-json":{"id":"node-reference/extract-json","title":"Extract JSON Node","description":"Extract JSON Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-markdown-code-blocks":{"id":"node-reference/extract-markdown-code-blocks","title":"Extract Markdown Code Blocks Node","description":"Extract Markdown Code Blocks Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-object-path":{"id":"node-reference/extract-object-path","title":"Extract Object Path Node","description":"Extract Object Path Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-with-regex":{"id":"node-reference/extract-with-regex","title":"Extract with Regex Node","description":"Extract with Regex Node Screenshot","sidebar":"nodeReference"},"node-reference/extract-yaml":{"id":"node-reference/extract-yaml","title":"Extract YAML Node","description":"Extract YAML Node Screenshot","sidebar":"nodeReference"},"node-reference/filter":{"id":"node-reference/filter","title":"Filter Node","description":"Filter Node Screenshot","sidebar":"nodeReference"},"node-reference/get-all-datasets":{"id":"node-reference/get-all-datasets","title":"Get All Datasets Node","description":"Get All Datasets Node Screenshot","sidebar":"nodeReference"},"node-reference/get-dataset-row":{"id":"node-reference/get-dataset-row","title":"Get Dataset Row Node","description":"Get Dataset Row Node Screenshot","sidebar":"nodeReference"},"node-reference/get-embedding":{"id":"node-reference/get-embedding","title":"Get Embedding Node","description":"Get Embedding Node Screenshot","sidebar":"nodeReference"},"node-reference/get-global":{"id":"node-reference/get-global","title":"Get Global Node","description":"Get Global Node Screenshot","sidebar":"nodeReference"},"node-reference/gpt-function":{"id":"node-reference/gpt-function","title":"GPT Function Node","description":"GPT Function Node Screenshot","sidebar":"nodeReference"},"node-reference/graph-input":{"id":"node-reference/graph-input","title":"Graph Input Node","description":"Graph Input Node Screenshot","sidebar":"nodeReference"},"node-reference/graph-output":{"id":"node-reference/graph-output","title":"Graph Output Node","description":"Graph Output Node Screenshot","sidebar":"nodeReference"},"node-reference/hash":{"id":"node-reference/hash","title":"Hash Node","description":"Hash Node Screenshot","sidebar":"nodeReference"},"node-reference/http-call":{"id":"node-reference/http-call","title":"HTTP Call Node","description":"HTTP Call Node Screenshot","sidebar":"nodeReference"},"node-reference/if":{"id":"node-reference/if","title":"If Node","description":"Overview","sidebar":"nodeReference"},"node-reference/if-else":{"id":"node-reference/if-else","title":"If/Else Node","description":"If/Else Node Screenshot","sidebar":"nodeReference"},"node-reference/image":{"id":"node-reference/image","title":"Image Node","description":"Image Node Screenshot","sidebar":"nodeReference"},"node-reference/join":{"id":"node-reference/join","title":"Join Node","description":"Join Node Screenshot","sidebar":"nodeReference"},"node-reference/knn-dataset":{"id":"node-reference/knn-dataset","title":"KNN Dataset Node","description":"KNN Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/load-dataset":{"id":"node-reference/load-dataset","title":"Load Dataset Node","description":"Load Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/loop-controller":{"id":"node-reference/loop-controller","title":"Loop Controller Node","description":"Loop Controller Node Screenshot","sidebar":"nodeReference"},"node-reference/match":{"id":"node-reference/match","title":"Match Node","description":"Match Node Screenshot","sidebar":"nodeReference"},"node-reference/number":{"id":"node-reference/number","title":"Number Node","description":"Number Node Screenshot","sidebar":"nodeReference"},"node-reference/object":{"id":"node-reference/object","title":"Object Node","description":"Object Node Screenshot","sidebar":"nodeReference"},"node-reference/passthrough":{"id":"node-reference/passthrough","title":"Passthrough Node","description":"Passthrough Node Screenshot","sidebar":"nodeReference"},"node-reference/pop":{"id":"node-reference/pop","title":"Pop Node","description":"Pop Node Screenshot","sidebar":"nodeReference"},"node-reference/prompt":{"id":"node-reference/prompt","title":"Prompt Node","description":"Prompt Node Screenshot","sidebar":"nodeReference"},"node-reference/race-inputs":{"id":"node-reference/race-inputs","title":"Race Inputs Node","description":"Race Inputs Node Screenshot","sidebar":"nodeReference"},"node-reference/raise-event":{"id":"node-reference/raise-event","title":"Raise Event Node","description":"Raise Event Node Screenshot","sidebar":"nodeReference"},"node-reference/read-directory":{"id":"node-reference/read-directory","title":"Read Directory Node","description":"Read Directory Node Screenshot","sidebar":"nodeReference"},"node-reference/read-file":{"id":"node-reference/read-file","title":"Read File Node","description":"Read File Node Screenshot","sidebar":"nodeReference"},"node-reference/replace-dataset":{"id":"node-reference/replace-dataset","title":"Replace Dataset Node","description":"Replace Dataset Node Screenshot","sidebar":"nodeReference"},"node-reference/RNG":{"id":"node-reference/RNG","title":"RNG Node","description":"Random Number Node Screenshot","sidebar":"nodeReference"},"node-reference/set-global":{"id":"node-reference/set-global","title":"Set Global Node","description":"Set Global Node Screenshot","sidebar":"nodeReference"},"node-reference/shuffle":{"id":"node-reference/shuffle","title":"Shuffle Node","description":"Shuffle Node Screenshot","sidebar":"nodeReference"},"node-reference/slice":{"id":"node-reference/slice","title":"Slice Node","description":"Slice Node Screenshot","sidebar":"nodeReference"},"node-reference/split-text":{"id":"node-reference/split-text","title":"Split Text Node","description":"Split Text Node Screenshot","sidebar":"nodeReference"},"node-reference/subgraph":{"id":"node-reference/subgraph","title":"Subgraph Node","description":"Subgraph Node Screenshot","sidebar":"nodeReference"},"node-reference/text":{"id":"node-reference/text","title":"Text Node","description":"Text Node Screenshot","sidebar":"nodeReference"},"node-reference/to-json":{"id":"node-reference/to-json","title":"To JSON Node","description":"To JSON Node Screenshot","sidebar":"nodeReference"},"node-reference/to-yaml":{"id":"node-reference/to-yaml","title":"To YAML Node","description":"To YAML Node Screenshot","sidebar":"nodeReference"},"node-reference/trim-chat-messages":{"id":"node-reference/trim-chat-messages","title":"Trim Chat Messages Node","description":"Trim Chat Messages Node Screenshot","sidebar":"nodeReference"},"node-reference/url-reference":{"id":"node-reference/url-reference","title":"URL Reference Node","description":"URL Reference Node Screenshot","sidebar":"nodeReference"},"node-reference/user-input":{"id":"node-reference/user-input","title":"User Input Node","description":"User Input Node Screenshot","sidebar":"nodeReference"},"node-reference/vector-knn":{"id":"node-reference/vector-knn","title":"Vector K-Nearest Neighbors Node","description":"Overview","sidebar":"nodeReference"},"node-reference/vector-store":{"id":"node-reference/vector-store","title":"Vector Store","description":"Chat Node Screenshot","sidebar":"nodeReference"},"node-reference/wait-for-event":{"id":"node-reference/wait-for-event","title":"Wait For Event Node","description":"Wait For Event Node Screenshot","sidebar":"nodeReference"},"trivet":{"id":"trivet","title":"Trivet","description":"Trivet is a library for running Rivet tests, and an integrated test runner in the Rivet application.","sidebar":"userGuide"},"tutorial":{"id":"tutorial","title":"Rivet Tutorial","description":"The tutorial series in the sidebar will walk you through the process of creating graphs and using different node","sidebar":"tutorial"},"tutorial/installing-getting-started":{"id":"tutorial/installing-getting-started","title":"Installing & Overview","description":"This Tutorial will walk you through the basic building blocks of Rivet.","sidebar":"tutorial"},"tutorial/interpolation-more-node-types":{"id":"tutorial/interpolation-more-node-types","title":"Interpolation & More Node Types","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/loops":{"id":"tutorial/loops","title":"07 - Loops","description":"","sidebar":"tutorial"},"tutorial/matching-conditionals":{"id":"tutorial/matching-conditionals","title":"Matching & Conditionals","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/simple-graph":{"id":"tutorial/simple-graph","title":"Simple Graph","description":"In the sidebar you should see the graphs tab with a list of numbered folders with graphs. These are the graphs that are included in the tutorial project.","sidebar":"tutorial"},"tutorial/splitting":{"id":"tutorial/splitting","title":"06 - Splitting","description":"","sidebar":"tutorial"},"tutorial/subgraphs":{"id":"tutorial/subgraphs","title":"05 - Subgraphs","description":"","sidebar":"tutorial"},"tutorial/testing-graphs":{"id":"tutorial/testing-graphs","title":"08 - Testing Graphs","description":"As your graphs get more complicated, it becomes important to test whether they improving without regressing previous functionality."},"tutorial/yaml":{"id":"tutorial/yaml","title":"04 - YAML","description":"","sidebar":"tutorial"},"user-guide/adding-connecting-nodes":{"id":"user-guide/adding-connecting-nodes","title":"Working with Nodes","description":"Adding Nodes","sidebar":"userGuide"},"user-guide/control-flow":{"id":"user-guide/control-flow","title":"Control Flow","description":"The flow of data in Rivet (and the control of that flow) is handled in two passes on the graph of nodes.","sidebar":"userGuide"},"user-guide/data-types":{"id":"user-guide/data-types","title":"Data Types","description":"Internally, the data the passes through Rivet is marked as a number of data types. When integrating Rivet with your own application, you will need to know what these data types are and how to handle them.","sidebar":"userGuide"},"user-guide/executing-ai-chains":{"id":"user-guide/executing-ai-chains","title":"Executing AI Chains","description":"Data Flow","sidebar":"userGuide"},"user-guide/executors":{"id":"user-guide/executors","title":"Executors","description":"Executors are responsible for running the graphs in Rivet. The executor can be chosen using the dropdown in the menu bar of the application.","sidebar":"userGuide"},"user-guide/features/chat-viewer":{"id":"user-guide/features/chat-viewer","title":"Chat Viewer","description":"The Chat Viewer gives you a live view of all Chat nodes that are running in your Rivet graphs. It is accessible by clicking the \\"Chat Viewer\\" tab at the top of Rivet.","sidebar":"userGuide"},"user-guide/features/data-studio":{"id":"user-guide/features/data-studio","title":"Data Studio","description":"The Data Studio in Rivet is your scratch pad for working with data and graphs. It is accessible by clicking the \\"Data Studio\\" tab at the top of Rivet.","sidebar":"userGuide"},"user-guide/features/prompt-designer":{"id":"user-guide/features/prompt-designer","title":"Prompt Designer","description":"The Prompt Designer gives you a UI to tweak and design your prompts that you pass into your Chat nodes.","sidebar":"userGuide"},"user-guide/features/trivet-tests":{"id":"user-guide/features/trivet-tests","title":"Trivet Tests","description":"See Trivet for more information.","sidebar":"userGuide"},"user-guide/live-debugging":{"id":"user-guide/live-debugging","title":"Live Debugging","description":"Currently Executing Nodes","sidebar":"userGuide"},"user-guide/loops":{"id":"user-guide/loops","title":"Loops","description":"Loops and the loop controller are the most difficult concept in Rivet. They are also incredibly powerful and necessary for many use cases.","sidebar":"userGuide"},"user-guide/overview-of-interface":{"id":"user-guide/overview-of-interface","title":"Overview of the Interface","description":"Sidebar","sidebar":"userGuide"},"user-guide/plugins":{"id":"user-guide/plugins","title":"Plugins","description":"Plugins allow authors to extend the functionality of Rivet, such as adding new nodes that you can use in your graphs.","sidebar":"userGuide"},"user-guide/plugins/built-in/all":{"id":"user-guide/plugins/built-in/all","title":"All Built-In Plugins","description":"The available built-in plugins are:","sidebar":"userGuide"},"user-guide/plugins/built-in/anthropic":{"id":"user-guide/plugins/built-in/anthropic","title":"Anthropic Plugin","description":"The Anthropic plugin provides access to Claude and Claude Instant using the","sidebar":"userGuide"},"user-guide/plugins/built-in/assemblyai":{"id":"user-guide/plugins/built-in/assemblyai","title":"AssemblyAI Plugin","description":"At the moment you must use the node executor to use the AssemblyAI plugin in the Rivet UI. You may also use the plugin when embedding Rivet in your own application.","sidebar":"userGuide"},"user-guide/plugins/built-in/autoevals":{"id":"user-guide/plugins/built-in/autoevals","title":"Autoevals Plugin","description":"The Autoevals plugin provides a node that can automatically evaluate the performance of an LLM response using a battle-tested set of prompts.","sidebar":"userGuide"},"user-guide/plugins/built-in/gentrace":{"id":"user-guide/plugins/built-in/gentrace","title":"Gentrace Plugin","description":"Gentrace is\xa0an evaluation and observability product that helps improve the quality, safety, and compliance of your AI features.","sidebar":"userGuide"},"user-guide/plugins/built-in/huggingface":{"id":"user-guide/plugins/built-in/huggingface","title":"Hugging Face Plugin","description":"","sidebar":"userGuide"},"user-guide/plugins/built-in/pinecone":{"id":"user-guide/plugins/built-in/pinecone","title":"Pinecone Plugin","description":"","sidebar":"userGuide"},"user-guide/plugins/creating-plugins":{"id":"user-guide/plugins/creating-plugins","title":"Creating a Plugin","description":"Introduction","sidebar":"userGuide"},"user-guide/prompt-designer":{"id":"user-guide/prompt-designer","title":"Prompt Designer","description":"TODO"},"user-guide/recordings":{"id":"user-guide/recordings","title":"Recordings","description":"Using the ExecutionRecorder class in your code, you can generate .rivet-recording files that contain","sidebar":"userGuide"},"user-guide/remote-debugging":{"id":"user-guide/remote-debugging","title":"Remote Debugging","description":"Remote debugging allows you to integrate the Rivet Core or Rivet Node libraries in another application, run your graphs in that other application, but see the live graph execution in the Rivet application! This is useful for debugging graphs that are running in a production environment, or for debugging graphs that are running in a different environment than the Rivet application. This is very useful when using the External Call Node, as the default executor cannot call into your own application\'s code.","sidebar":"userGuide"},"user-guide/splitting":{"id":"user-guide/splitting","title":"Splitting","description":"Splitting a node is a powerful tool for parallelizing execution. Change a node to a Split node by toggling on Split on any node:","sidebar":"userGuide"},"user-guide/subgraphs":{"id":"user-guide/subgraphs","title":"Subgraphs","description":"Subgraphs are a powerful tool for composing graphs together. They allow you to create a graph that can be used as a node in another graph. This allows you to create reusable components, and to create graphs that are easier to understand.","sidebar":"userGuide"},"user-guide/trivet-getting-started":{"id":"user-guide/trivet-getting-started","title":"Trivet - Getting Started","description":"To get started with Trivet, select the Trivet Tests tab at the top of the Rivet application.","sidebar":"userGuide"},"user-guide/trivet-library":{"id":"user-guide/trivet-library","title":"Trivet Library","description":"The Trivet Library is a powerful tool for running tests on your Rivet projects programmatically. It provides a way to validate and test the functionality of your Rivet graphs. All code examples in this documentation are written in TypeScript.","sidebar":"userGuide"},"user-guide/trivet-tutorial":{"id":"user-guide/trivet-tutorial","title":"Trivet - Tutorial","description":"Suppose that we want to test a simple graph that executes a call against GPT-3.5, but that names the assistant:","sidebar":"userGuide"},"user-guide/trivet-validation-graphs":{"id":"user-guide/trivet-validation-graphs","title":"Trivet - Validator Graphs","description":"Instead of using baked-in validations, Trivet uses Rivet graphs to perform validation on your test graph. This allows you the ultimate flexibility in how you want to validate your graph. It is common to make LLM calls to validate your graph - a great pattern is asking an LLM to respond with YES or NO after asking it a question, and then using a Match node to find either the YES or NO.","sidebar":"userGuide"},"user-guide/working-with-graphs":{"id":"user-guide/working-with-graphs","title":"Working with Graphs","description":"A Rivet project contains a set of named graphs. Each of these graphs contains a set of nodes connected together, forming the graph.","sidebar":"userGuide"},"user-guide/working-with-projects":{"id":"user-guide/working-with-projects","title":"Working with Projects","description":"A Rivet project contains a set of graphs. These graphs can call each other by using a Subgraph Node. Any graph can call any other graph in the project (including itself).","sidebar":"userGuide"}}}')}}]); \ No newline at end of file diff --git a/assets/js/a6838e53.ebc20530.js b/assets/js/a6838e53.ebc20530.js new file mode 100644 index 000000000..858bbf880 --- /dev/null +++ b/assets/js/a6838e53.ebc20530.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3887],{1042:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var r=n(3249);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=r.createContext({}),s=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(u.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,u=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,h=d["".concat(u,".").concat(m)]||d[m]||c[m]||l;return n?r.createElement(h,o(o({ref:t},p),{},{components:n})):r.createElement(h,o({ref:t},p))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[d]="string"==typeof e?e:a,o[1]=i;for(var s=2;s{n.d(t,{Z:()=>o});var r=n(3249),a=n(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:n,className:o}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,o),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(7396),a=n(3249),l=n(2689),o=n(5986),i=n(6659),u=n(4532),s=n(5821),p=n(3312);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function c(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??d(n);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const r=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,l=c(e),[o,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,s]=h({queryString:n,groupId:r}),[d,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,p.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:r}),g=(()=>{const e=u??d;return m({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),s(e),f(e)}),[s,f,l]),tabValues:l}}var g=n(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.o5)(),c=e=>{const t=e.currentTarget,n=p.indexOf(t),r=s[n].value;r!==i&&(d(t),u(r))},m=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},s.map((e=>{let{value:t,label:n,attributes:o}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:c},o,{className:(0,l.Z)("tabs__item",b.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:r}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function v(e){const t=f(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",b.tabList)},a.createElement(k,(0,r.Z)({},e,t)),a.createElement(N,(0,r.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return a.createElement(v,(0,r.Z)({key:String(t)},e))}},4109:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>d});var r=n(7396),a=(n(3249),n(1042)),l=n(2327),o=n(5089);const i={id:"user-input",title:"User Input Node",sidebar_label:"User Input"},u=void 0,s={unversionedId:"node-reference/user-input",id:"node-reference/user-input",title:"User Input Node",description:"User Input Node Screenshot",source:"@site/docs/node-reference/user-input.mdx",sourceDirName:"node-reference",slug:"/node-reference/user-input",permalink:"/docs/node-reference/user-input",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/user-input.mdx",tags:[],version:"current",frontMatter:{id:"user-input",title:"User Input Node",sidebar_label:"User Input"},sidebar:"nodeReference",previous:{title:"Replace Dataset",permalink:"/docs/node-reference/replace-dataset"},next:{title:"Vector Store",permalink:"/docs/node-reference/vector-store"}},p={},d=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Using a static prompt",id:"example-1-using-a-static-prompt",level:2},{value:"Example 2: Using dynamic prompts",id:"example-2-using-dynamic-prompts",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:d},m="wrapper";function h(e){let{components:t,...i}=e;return(0,a.kt)(m,(0,r.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Screenshot",src:n(4195).Z,width:"786",height:"486"})),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"The User Input Node is designed to prompt the user for input during the execution of the graph. The user's response becomes the output of this node. This node is particularly useful in interactive scenarios where user input is required to proceed with the graph execution."),(0,a.kt)("p",null,"The User Input Node can either use a static prompt defined in the node settings or dynamic prompts provided via the node's input."),(0,a.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,a.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"inputs"},"Inputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Questions"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},"An array of questions to prompt the user."),(0,a.kt)("td",{parentName:"tr",align:null},"N/A"),(0,a.kt)("td",{parentName:"tr",align:null},'This input is only available when the "Use Input" toggle is enabled in the node settings.'))))),(0,a.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"outputs"},"Outputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Answers Only"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},"An array containing the user's answers to the prompted questions."),(0,a.kt)("td",{parentName:"tr",align:null})),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Q & A"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},'An array containing the questions and answers formatted as "Question\\nAnswer".'),(0,a.kt)("td",{parentName:"tr",align:null}))))),(0,a.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,a.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Setting"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,a.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Prompt"),(0,a.kt)("td",{parentName:"tr",align:null},"The question to prompt the user."),(0,a.kt)("td",{parentName:"tr",align:null},"(required)"),(0,a.kt)("td",{parentName:"tr",align:null},"Yes"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,a.kt)("h2",{id:"example-1-using-a-static-prompt"},"Example 1: Using a static prompt"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a User Input Node."),(0,a.kt)("li",{parentName:"ol"},'In the node settings, set the "Prompt" to "What is your name?".'),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The graph execution will pause and prompt you for input."),(0,a.kt)("li",{parentName:"ol"},'Enter your name and press "Submit". The graph execution will resume and the output of the User Input Node will be the name you entered.')),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Example 1",src:n(1438).Z,width:"1806",height:"904"})),(0,a.kt)("h2",{id:"example-2-using-dynamic-prompts"},"Example 2: Using dynamic prompts"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a User Input Node."),(0,a.kt)("li",{parentName:"ol"},'In the node settings, enable the "Use Input" toggle.'),(0,a.kt)("li",{parentName:"ol"},"Create an ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")," and connect 2 ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Nodes")," to it."),(0,a.kt)("li",{parentName:"ol"},'Add the text "What is your name?" to the first Text Node and "What is your favorite color?" to the second Text Node.'),(0,a.kt)("li",{parentName:"ol"},'Connect the Array Node to the "Questions" input of the User Input Node.'),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The graph execution will pause and prompt you for input."),(0,a.kt)("li",{parentName:"ol"},'Enter your answers and press "Submit". The graph execution will resume and the output of the User Input Node will be an array containing your answers.')),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Example 2",src:n(2444).Z,width:"2876",height:"900"})),(0,a.kt)("h2",{id:"error-handling"},"Error Handling"),(0,a.kt)("p",null,"The User Input Node does not have any error handling behavior. If the node is executed, it will always pause the graph execution and prompt the user for input."),(0,a.kt)("h2",{id:"faq"},"FAQ"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: Can I use the User Input Node to prompt the user for multiple inputs at once?")),(0,a.kt)("p",null,'A: Yes, you can do this by connecting an Array Node to the "Questions" input of the User Input Node. Each item in the array will be a separate question that the user is prompted for.'),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What happens if the user does not provide any input?")),(0,a.kt)("p",null,'A: If the user does not provide any input and presses "Submit", the output of the User Input Node will be an empty string.'),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: Can I use the User Input Node to prompt the user for a password or other sensitive information?")),(0,a.kt)("p",null,"A: No, the User Input Node does not currently support masking the user's input. All input provided by the user will be visible in the graph execution log."),(0,a.kt)("h2",{id:"see-also"},"See Also"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/split-text"},"Split Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/join"},"Join Node"))))}h.isMDXComponent=!0},1438:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-example-01-a4a63ab63122b1a525185a29e1e24242.png"},2444:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-example-02-8639a0848492a3b087c9fe3bda5335ce.png"},4195:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-f903ec6717a07cb2ff412223d7a7086f.png"}}]); \ No newline at end of file diff --git a/assets/js/a6838e53.f5d1671d.js b/assets/js/a6838e53.f5d1671d.js deleted file mode 100644 index ad9248ee6..000000000 --- a/assets/js/a6838e53.f5d1671d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3887],{1042:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var r=n(3249);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=r.createContext({}),s=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(u.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,u=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,h=d["".concat(u,".").concat(m)]||d[m]||c[m]||l;return n?r.createElement(h,o(o({ref:t},p),{},{components:n})):r.createElement(h,o({ref:t},p))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[d]="string"==typeof e?e:a,o[1]=i;for(var s=2;s{n.d(t,{Z:()=>o});var r=n(3249),a=n(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:n,className:o}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,o),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(7396),a=n(3249),l=n(2689),o=n(5986),i=n(6659),u=n(4532),s=n(5821),p=n(3312);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function c(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??d(n);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const r=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,l=c(e),[o,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,s]=h({queryString:n,groupId:r}),[d,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,p.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:r}),g=(()=>{const e=u??d;return m({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),s(e),f(e)}),[s,f,l]),tabValues:l}}var g=n(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.o5)(),c=e=>{const t=e.currentTarget,n=p.indexOf(t),r=s[n].value;r!==i&&(d(t),u(r))},m=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},s.map((e=>{let{value:t,label:n,attributes:o}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:c},o,{className:(0,l.Z)("tabs__item",b.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:r}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function v(e){const t=f(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",b.tabList)},a.createElement(k,(0,r.Z)({},e,t)),a.createElement(N,(0,r.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return a.createElement(v,(0,r.Z)({key:String(t)},e))}},4109:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>d});var r=n(7396),a=(n(3249),n(1042)),l=n(2327),o=n(5089);const i={id:"user-input",title:"User Input Node",sidebar_label:"User Input"},u=void 0,s={unversionedId:"node-reference/user-input",id:"node-reference/user-input",title:"User Input Node",description:"User Input Node Screenshot",source:"@site/docs/node-reference/user-input.mdx",sourceDirName:"node-reference",slug:"/node-reference/user-input",permalink:"/docs/node-reference/user-input",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/user-input.mdx",tags:[],version:"current",frontMatter:{id:"user-input",title:"User Input Node",sidebar_label:"User Input"},sidebar:"nodeReference",previous:{title:"Read File",permalink:"/docs/node-reference/read-file"},next:{title:"Vector Store",permalink:"/docs/node-reference/vector-store"}},p={},d=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Using a static prompt",id:"example-1-using-a-static-prompt",level:2},{value:"Example 2: Using dynamic prompts",id:"example-2-using-dynamic-prompts",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:d},m="wrapper";function h(e){let{components:t,...i}=e;return(0,a.kt)(m,(0,r.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Screenshot",src:n(4195).Z,width:"786",height:"486"})),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"The User Input Node is designed to prompt the user for input during the execution of the graph. The user's response becomes the output of this node. This node is particularly useful in interactive scenarios where user input is required to proceed with the graph execution."),(0,a.kt)("p",null,"The User Input Node can either use a static prompt defined in the node settings or dynamic prompts provided via the node's input."),(0,a.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,a.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"inputs"},"Inputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Questions"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},"An array of questions to prompt the user."),(0,a.kt)("td",{parentName:"tr",align:null},"N/A"),(0,a.kt)("td",{parentName:"tr",align:null},'This input is only available when the "Use Input" toggle is enabled in the node settings.'))))),(0,a.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"outputs"},"Outputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Answers Only"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},"An array containing the user's answers to the prompted questions."),(0,a.kt)("td",{parentName:"tr",align:null})),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Q & A"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string[]")),(0,a.kt)("td",{parentName:"tr",align:null},'An array containing the questions and answers formatted as "Question\\nAnswer".'),(0,a.kt)("td",{parentName:"tr",align:null}))))),(0,a.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,a.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Setting"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,a.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Prompt"),(0,a.kt)("td",{parentName:"tr",align:null},"The question to prompt the user."),(0,a.kt)("td",{parentName:"tr",align:null},"(required)"),(0,a.kt)("td",{parentName:"tr",align:null},"Yes"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,a.kt)("h2",{id:"example-1-using-a-static-prompt"},"Example 1: Using a static prompt"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a User Input Node."),(0,a.kt)("li",{parentName:"ol"},'In the node settings, set the "Prompt" to "What is your name?".'),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The graph execution will pause and prompt you for input."),(0,a.kt)("li",{parentName:"ol"},'Enter your name and press "Submit". The graph execution will resume and the output of the User Input Node will be the name you entered.')),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Example 1",src:n(1438).Z,width:"1806",height:"904"})),(0,a.kt)("h2",{id:"example-2-using-dynamic-prompts"},"Example 2: Using dynamic prompts"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a User Input Node."),(0,a.kt)("li",{parentName:"ol"},'In the node settings, enable the "Use Input" toggle.'),(0,a.kt)("li",{parentName:"ol"},"Create an ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")," and connect 2 ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Nodes")," to it."),(0,a.kt)("li",{parentName:"ol"},'Add the text "What is your name?" to the first Text Node and "What is your favorite color?" to the second Text Node.'),(0,a.kt)("li",{parentName:"ol"},'Connect the Array Node to the "Questions" input of the User Input Node.'),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The graph execution will pause and prompt you for input."),(0,a.kt)("li",{parentName:"ol"},'Enter your answers and press "Submit". The graph execution will resume and the output of the User Input Node will be an array containing your answers.')),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"User Input Node Example 2",src:n(2444).Z,width:"2876",height:"900"})),(0,a.kt)("h2",{id:"error-handling"},"Error Handling"),(0,a.kt)("p",null,"The User Input Node does not have any error handling behavior. If the node is executed, it will always pause the graph execution and prompt the user for input."),(0,a.kt)("h2",{id:"faq"},"FAQ"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: Can I use the User Input Node to prompt the user for multiple inputs at once?")),(0,a.kt)("p",null,'A: Yes, you can do this by connecting an Array Node to the "Questions" input of the User Input Node. Each item in the array will be a separate question that the user is prompted for.'),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What happens if the user does not provide any input?")),(0,a.kt)("p",null,'A: If the user does not provide any input and presses "Submit", the output of the User Input Node will be an empty string.'),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: Can I use the User Input Node to prompt the user for a password or other sensitive information?")),(0,a.kt)("p",null,"A: No, the User Input Node does not currently support masking the user's input. All input provided by the user will be visible in the graph execution log."),(0,a.kt)("h2",{id:"see-also"},"See Also"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/split-text"},"Split Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/join"},"Join Node"))))}h.isMDXComponent=!0},1438:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-example-01-a4a63ab63122b1a525185a29e1e24242.png"},2444:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-example-02-8639a0848492a3b087c9fe3bda5335ce.png"},4195:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/user-input-node-f903ec6717a07cb2ff412223d7a7086f.png"}}]); \ No newline at end of file diff --git a/assets/js/acacfcbf.ac430c09.js b/assets/js/acacfcbf.ac430c09.js new file mode 100644 index 000000000..b6288e149 --- /dev/null +++ b/assets/js/acacfcbf.ac430c09.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7703],{1042:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var a=r(3249);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),u=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,l=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(r),h=n,m=c["".concat(s,".").concat(h)]||c[h]||d[h]||l;return r?a.createElement(m,o(o({ref:t},p),{},{components:r})):a.createElement(m,o({ref:t},p))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=r.length,o=new Array(l);o[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:n,o[1]=i;for(var u=2;u{r.d(t,{Z:()=>o});var a=r(3249),n=r(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:r,className:o}=e;return a.createElement("div",{role:"tabpanel",className:(0,n.Z)(l.tabItem,o),hidden:r},t)}},2327:(e,t,r)=>{r.d(t,{Z:()=>N});var a=r(7396),n=r(3249),l=r(2689),o=r(5986),i=r(6659),s=r(4532),u=r(5821),p=r(3312);function c(e){return function(e){return n.Children.map(e,(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:a,default:n}}=e;return{value:t,label:r,attributes:a,default:n}}))}function d(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function h(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(l),(0,n.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,l=d(e),[o,i]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=r.find((e=>e.default))??r[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[s,u]=m({queryString:r,groupId:a}),[c,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,p.Nk)(r);return[a,(0,n.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:a}),g=(()=>{const e=s??c;return h({value:e,tabValues:l})?e:null})();(0,n.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,n.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),b(e)}),[u,b,l]),tabValues:l}}var g=r(3072);const f={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:r,selectedValue:i,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.o5)(),d=e=>{const t=e.currentTarget,r=p.indexOf(t),a=u[r].value;a!==i&&(c(t),s(a))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return n.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:o}=e;return n.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:h,onClick:d},o,{className:(0,l.Z)("tabs__item",f.tabItem,o?.className,{"tabs__item--active":i===t})}),r??t)})))}function y(e){let{lazy:t,children:r,selectedValue:a}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return n.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=b(e);return n.createElement("div",{className:(0,l.Z)("tabs-container",f.tabList)},n.createElement(k,(0,a.Z)({},e,t)),n.createElement(y,(0,a.Z)({},e,t)))}function N(e){const t=(0,g.Z)();return n.createElement(v,(0,a.Z)({key:String(t)},e))}},3315:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var a=r(7396),n=(r(3249),r(1042)),l=r(2327),o=r(5089);const i={id:"abort-graph",title:"Abort Graph Node",sidebar_label:"Abort Graph"},s=void 0,u={unversionedId:"node-reference/abort-graph",id:"node-reference/abort-graph",title:"Abort Graph Node",description:"Overview",source:"@site/docs/node-reference/abort-graph.mdx",sourceDirName:"node-reference",slug:"/node-reference/abort-graph",permalink:"/docs/node-reference/abort-graph",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/abort-graph.mdx",tags:[],version:"current",frontMatter:{id:"abort-graph",title:"Abort Graph Node",sidebar_label:"Abort Graph"},sidebar:"nodeReference",previous:{title:"URL Reference",permalink:"/docs/node-reference/url-reference"},next:{title:"Coalesce",permalink:"/docs/node-reference/coalesce"}},p={},c=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Successfully aborting a graph",id:"example-1-successfully-aborting-a-graph",level:3},{value:"Example 2: Aborting a graph with an error",id:"example-2-aborting-a-graph-with-an-error",level:3},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:c},h="wrapper";function m(e){let{components:t,...i}=e;return(0,n.kt)(h,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h2",{id:"overview"},"Overview"),(0,n.kt)("p",null,'The Abort Graph Node is used to stop the execution of the entire graph immediately. It can either "successfully" abort the graph (early-exit), or "error" abort the graph. This can be useful for stopping the graph under certain conditions, or for handling errors.'),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Abort Graph Node Screenshot",src:r(7977).Z,width:"334",height:"187"})),(0,n.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,n.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"inputs"},"Inputs"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Title"),(0,n.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Data or Error"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"any")),(0,n.kt)("td",{parentName:"tr",align:null},"The data or error message to be used when aborting the graph. If it's a string, it will be used as the error message for error aborting."),(0,n.kt)("td",{parentName:"tr",align:null},"N/A"),(0,n.kt)("td",{parentName:"tr",align:null},"None")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Successfully"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"boolean")),(0,n.kt)("td",{parentName:"tr",align:null},"Determines whether the graph should be aborted successfully or with an error."),(0,n.kt)("td",{parentName:"tr",align:null},"true"),(0,n.kt)("td",{parentName:"tr",align:null},"Only available if the \"Successfully Abort\" setting is toggled on in the node's settings. Otherwise, the node's setting value will be used."))))),(0,n.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"outputs"},"Outputs"),(0,n.kt)("p",null,"This node does not have any outputs.")),(0,n.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,n.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Setting"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Successfully Abort"),(0,n.kt)("td",{parentName:"tr",align:null},"Determines whether the graph should be aborted successfully or with an error."),(0,n.kt)("td",{parentName:"tr",align:null},"true"),(0,n.kt)("td",{parentName:"tr",align:null},"Yes")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Error Message"),(0,n.kt)("td",{parentName:"tr",align:null},'The error message to be used when aborting the graph with an error. Only used if "Successfully Abort" is not checked.'),(0,n.kt)("td",{parentName:"tr",align:null},"(Empty)"),(0,n.kt)("td",{parentName:"tr",align:null},"No")))))),(0,n.kt)("h3",{id:"example-1-successfully-aborting-a-graph"},"Example 1: Successfully aborting a graph"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Add an Abort Graph node to your graph."),(0,n.kt)("li",{parentName:"ol"},'Make sure the "Successfully Abort" setting is checked.'),(0,n.kt)("li",{parentName:"ol"},"Connect any node to the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error")," input of the Abort Graph node. This could be a condition, a value, or anything else."),(0,n.kt)("li",{parentName:"ol"},"Run your graph. The graph will abort immediately after the Abort Graph node is processed, and no subsequent nodes will be executed.")),(0,n.kt)("h3",{id:"example-2-aborting-a-graph-with-an-error"},"Example 2: Aborting a graph with an error"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Add an Abort Graph node to your graph."),(0,n.kt)("li",{parentName:"ol"},'Uncheck the "Successfully Abort" setting.'),(0,n.kt)("li",{parentName:"ol"},'Optionally, enter an error message in the "Error Message" setting. This message will be used as the error message when the graph is aborted.'),(0,n.kt)("li",{parentName:"ol"},"Connect any node to the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error")," input of the Abort Graph node. If this node outputs a string, it will be used as the error message when the graph is aborted."),(0,n.kt)("li",{parentName:"ol"},"Run your graph. The graph will abort immediately after the Abort Graph node is processed, and no subsequent nodes will be executed. An error message will be displayed, either the one from the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error"),' input or the one from the "Error Message" setting.')),(0,n.kt)("h2",{id:"error-handling"},"Error Handling"),(0,n.kt)("p",null,"The Abort Graph Node does not produce any errors itself. However, it causes the entire graph to stop executing when it is processed, either successfully or with an error."),(0,n.kt)("h2",{id:"faq"},"FAQ"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I connect a non-string node to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Data or Error")," input?")),(0,n.kt)("p",null,"A: If the node outputs a string, it will be used as the error message when the graph is aborted. If it does not output a string, it will be coerced into a string."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I connect a node to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Successfully"),' input but the "Successfully Abort" setting is not checked?')),(0,n.kt)("p",null,"A: The ",(0,n.kt)("inlineCode",{parentName:"p"},"Successfully")," input will be ignored, and the graph will be aborted with an error."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I don't connect anything to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Data or Error"),' input or leave the "Error Message" setting empty?')),(0,n.kt)("p",null,'A: The graph will be aborted with a default error message of "Graph aborted with error".'),(0,n.kt)("h2",{id:"see-also"},"See Also"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/if"},"If Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/if-else"},"If/Else Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/race-inputs"},"Race Inputs Node"))))}m.isMDXComponent=!0},7977:(e,t,r)=>{r.d(t,{Z:()=>a});const a=r.p+"assets/images/abort-graph-node-649a28df470c3bceb1a6a558f8f92370.png"}}]); \ No newline at end of file diff --git a/assets/js/acacfcbf.fb2a937e.js b/assets/js/acacfcbf.fb2a937e.js deleted file mode 100644 index 89bf0c903..000000000 --- a/assets/js/acacfcbf.fb2a937e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7703],{1042:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var a=r(3249);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),u=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,l=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(r),h=n,m=c["".concat(s,".").concat(h)]||c[h]||d[h]||l;return r?a.createElement(m,o(o({ref:t},p),{},{components:r})):a.createElement(m,o({ref:t},p))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=r.length,o=new Array(l);o[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:n,o[1]=i;for(var u=2;u{r.d(t,{Z:()=>o});var a=r(3249),n=r(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:r,className:o}=e;return a.createElement("div",{role:"tabpanel",className:(0,n.Z)(l.tabItem,o),hidden:r},t)}},2327:(e,t,r)=>{r.d(t,{Z:()=>N});var a=r(7396),n=r(3249),l=r(2689),o=r(5986),i=r(6659),s=r(4532),u=r(5821),p=r(3312);function c(e){return function(e){return n.Children.map(e,(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:a,default:n}}=e;return{value:t,label:r,attributes:a,default:n}}))}function d(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function h(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(l),(0,n.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function g(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,l=d(e),[o,i]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=r.find((e=>e.default))??r[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:l}))),[s,u]=m({queryString:r,groupId:a}),[c,g]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,p.Nk)(r);return[a,(0,n.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:a}),b=(()=>{const e=s??c;return h({value:e,tabValues:l})?e:null})();(0,n.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:o,selectValue:(0,n.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),g(e)}),[u,g,l]),tabValues:l}}var b=r(3072);const f={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:r,selectedValue:i,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.o5)(),d=e=>{const t=e.currentTarget,r=p.indexOf(t),a=u[r].value;a!==i&&(c(t),s(a))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return n.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:o}=e;return n.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:h,onClick:d},o,{className:(0,l.Z)("tabs__item",f.tabItem,o?.className,{"tabs__item--active":i===t})}),r??t)})))}function y(e){let{lazy:t,children:r,selectedValue:a}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return n.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=g(e);return n.createElement("div",{className:(0,l.Z)("tabs-container",f.tabList)},n.createElement(k,(0,a.Z)({},e,t)),n.createElement(y,(0,a.Z)({},e,t)))}function N(e){const t=(0,b.Z)();return n.createElement(v,(0,a.Z)({key:String(t)},e))}},3315:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var a=r(7396),n=(r(3249),r(1042)),l=r(2327),o=r(5089);const i={id:"abort-graph",title:"Abort Graph Node",sidebar_label:"Abort Graph"},s=void 0,u={unversionedId:"node-reference/abort-graph",id:"node-reference/abort-graph",title:"Abort Graph Node",description:"Overview",source:"@site/docs/node-reference/abort-graph.mdx",sourceDirName:"node-reference",slug:"/node-reference/abort-graph",permalink:"/docs/node-reference/abort-graph",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/abort-graph.mdx",tags:[],version:"current",frontMatter:{id:"abort-graph",title:"Abort Graph Node",sidebar_label:"Abort Graph"},sidebar:"nodeReference",previous:{title:"Image",permalink:"/docs/node-reference/image"},next:{title:"Coalesce",permalink:"/docs/node-reference/coalesce"}},p={},c=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Successfully aborting a graph",id:"example-1-successfully-aborting-a-graph",level:3},{value:"Example 2: Aborting a graph with an error",id:"example-2-aborting-a-graph-with-an-error",level:3},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:c},h="wrapper";function m(e){let{components:t,...i}=e;return(0,n.kt)(h,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h2",{id:"overview"},"Overview"),(0,n.kt)("p",null,'The Abort Graph Node is used to stop the execution of the entire graph immediately. It can either "successfully" abort the graph (early-exit), or "error" abort the graph. This can be useful for stopping the graph under certain conditions, or for handling errors.'),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Abort Graph Node Screenshot",src:r(7977).Z,width:"334",height:"187"})),(0,n.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,n.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"inputs"},"Inputs"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Title"),(0,n.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Data or Error"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"any")),(0,n.kt)("td",{parentName:"tr",align:null},"The data or error message to be used when aborting the graph. If it's a string, it will be used as the error message for error aborting."),(0,n.kt)("td",{parentName:"tr",align:null},"N/A"),(0,n.kt)("td",{parentName:"tr",align:null},"None")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Successfully"),(0,n.kt)("td",{parentName:"tr",align:null},(0,n.kt)("inlineCode",{parentName:"td"},"boolean")),(0,n.kt)("td",{parentName:"tr",align:null},"Determines whether the graph should be aborted successfully or with an error."),(0,n.kt)("td",{parentName:"tr",align:null},"true"),(0,n.kt)("td",{parentName:"tr",align:null},"Only available if the \"Successfully Abort\" setting is toggled on in the node's settings. Otherwise, the node's setting value will be used."))))),(0,n.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,n.kt)("h2",{id:"outputs"},"Outputs"),(0,n.kt)("p",null,"This node does not have any outputs.")),(0,n.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,n.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,n.kt)("table",null,(0,n.kt)("thead",{parentName:"table"},(0,n.kt)("tr",{parentName:"thead"},(0,n.kt)("th",{parentName:"tr",align:null},"Setting"),(0,n.kt)("th",{parentName:"tr",align:null},"Description"),(0,n.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,n.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"))),(0,n.kt)("tbody",{parentName:"table"},(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Successfully Abort"),(0,n.kt)("td",{parentName:"tr",align:null},"Determines whether the graph should be aborted successfully or with an error."),(0,n.kt)("td",{parentName:"tr",align:null},"true"),(0,n.kt)("td",{parentName:"tr",align:null},"Yes")),(0,n.kt)("tr",{parentName:"tbody"},(0,n.kt)("td",{parentName:"tr",align:null},"Error Message"),(0,n.kt)("td",{parentName:"tr",align:null},'The error message to be used when aborting the graph with an error. Only used if "Successfully Abort" is not checked.'),(0,n.kt)("td",{parentName:"tr",align:null},"(Empty)"),(0,n.kt)("td",{parentName:"tr",align:null},"No")))))),(0,n.kt)("h3",{id:"example-1-successfully-aborting-a-graph"},"Example 1: Successfully aborting a graph"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Add an Abort Graph node to your graph."),(0,n.kt)("li",{parentName:"ol"},'Make sure the "Successfully Abort" setting is checked.'),(0,n.kt)("li",{parentName:"ol"},"Connect any node to the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error")," input of the Abort Graph node. This could be a condition, a value, or anything else."),(0,n.kt)("li",{parentName:"ol"},"Run your graph. The graph will abort immediately after the Abort Graph node is processed, and no subsequent nodes will be executed.")),(0,n.kt)("h3",{id:"example-2-aborting-a-graph-with-an-error"},"Example 2: Aborting a graph with an error"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Add an Abort Graph node to your graph."),(0,n.kt)("li",{parentName:"ol"},'Uncheck the "Successfully Abort" setting.'),(0,n.kt)("li",{parentName:"ol"},'Optionally, enter an error message in the "Error Message" setting. This message will be used as the error message when the graph is aborted.'),(0,n.kt)("li",{parentName:"ol"},"Connect any node to the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error")," input of the Abort Graph node. If this node outputs a string, it will be used as the error message when the graph is aborted."),(0,n.kt)("li",{parentName:"ol"},"Run your graph. The graph will abort immediately after the Abort Graph node is processed, and no subsequent nodes will be executed. An error message will be displayed, either the one from the ",(0,n.kt)("inlineCode",{parentName:"li"},"Data or Error"),' input or the one from the "Error Message" setting.')),(0,n.kt)("h2",{id:"error-handling"},"Error Handling"),(0,n.kt)("p",null,"The Abort Graph Node does not produce any errors itself. However, it causes the entire graph to stop executing when it is processed, either successfully or with an error."),(0,n.kt)("h2",{id:"faq"},"FAQ"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I connect a non-string node to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Data or Error")," input?")),(0,n.kt)("p",null,"A: If the node outputs a string, it will be used as the error message when the graph is aborted. If it does not output a string, it will be coerced into a string."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I connect a node to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Successfully"),' input but the "Successfully Abort" setting is not checked?')),(0,n.kt)("p",null,"A: The ",(0,n.kt)("inlineCode",{parentName:"p"},"Successfully")," input will be ignored, and the graph will be aborted with an error."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Q: What happens if I don't connect anything to the ",(0,n.kt)("inlineCode",{parentName:"strong"},"Data or Error"),' input or leave the "Error Message" setting empty?')),(0,n.kt)("p",null,'A: The graph will be aborted with a default error message of "Graph aborted with error".'),(0,n.kt)("h2",{id:"see-also"},"See Also"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/if"},"If Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/if-else"},"If/Else Node")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/node-reference/race-inputs"},"Race Inputs Node"))))}m.isMDXComponent=!0},7977:(e,t,r)=>{r.d(t,{Z:()=>a});const a=r.p+"assets/images/abort-graph-node-649a28df470c3bceb1a6a558f8f92370.png"}}]); \ No newline at end of file diff --git a/assets/js/c1d447ec.abea905f.js b/assets/js/c1d447ec.abea905f.js new file mode 100644 index 000000000..546bda8cd --- /dev/null +++ b/assets/js/c1d447ec.abea905f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3294],{1042:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>m});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},d=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=u(a),f=r,m=p["".concat(s,".").concat(f)]||p[f]||c[f]||l;return a?n.createElement(m,i(i({ref:t},d),{},{components:a})):n.createElement(m,i({ref:t},d))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=f;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[p]="string"==typeof e?e:r,i[1]=o;for(var u=2;u{a.d(t,{Z:()=>i});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>y});var n=a(7396),r=a(3249),l=a(2689),i=a(5986),o=a(6659),s=a(4532),u=a(5821),d=a(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function c(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function f(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:a}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,s._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function h(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=c(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[s,u]=m({queryString:a,groupId:n}),[p,h]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,d.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),g=(()=>{const e=s??p;return f({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),h(e)}),[u,h,l]),tabValues:l}}var g=a(3072);const k={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function b(e){let{className:t,block:a,selectedValue:o,selectValue:s,tabValues:u}=e;const d=[],{blockElementScrollPositionUntilNextRender:p}=(0,i.o5)(),c=e=>{const t=e.currentTarget,a=d.indexOf(t),n=u[a].value;n!==o&&(p(t),s(n))},f=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const a=d.indexOf(e.currentTarget)+1;t=d[a]??d[0];break}case"ArrowLeft":{const a=d.indexOf(e.currentTarget)-1;t=d[a]??d[d.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},u.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>d.push(e),onKeyDown:f,onClick:c},i,{className:(0,l.Z)("tabs__item",k.tabItem,i?.className,{"tabs__item--active":o===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function v(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",k.tabList)},r.createElement(b,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(v,(0,n.Z)({key:String(t)},e))}},1389:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>m,frontMatter:()=>o,metadata:()=>u,toc:()=>p});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),i=a(5089);const o={id:"read-file",title:"Read File Node",sidebar_label:"Read File"},s=void 0,u={unversionedId:"node-reference/read-file",id:"node-reference/read-file",title:"Read File Node",description:"Read File Node Screenshot",source:"@site/docs/node-reference/read-file.mdx",sourceDirName:"node-reference",slug:"/node-reference/read-file",permalink:"/docs/node-reference/read-file",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/read-file.mdx",tags:[],version:"current",frontMatter:{id:"read-file",title:"Read File Node",sidebar_label:"Read File"},sidebar:"nodeReference",previous:{title:"Read Directory",permalink:"/docs/node-reference/read-directory"},next:{title:"Replace Dataset",permalink:"/docs/node-reference/replace-dataset"}},d={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Read a file from a specified path",id:"example-1-read-a-file-from-a-specified-path",level:2},{value:"Example 2: Read a file from a dynamic path",id:"example-2-read-a-file-from-a-dynamic-path",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:p},f="wrapper";function m(e){let{components:t,...o}=e;return(0,r.kt)(f,(0,n.Z)({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Screenshot",src:a(2791).Z,width:"414",height:"171"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Read File Node is used to read the contents of a specified file from the file system and output it as a string."),(0,r.kt)("p",null,"If you are using the Rivet SDK, this node requires a native API to be available in the context when the graph is being run. The native API is responsible for providing the functionality to read the contents of a directory."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Path"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The path of the file to read. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Path Input")," is enabled in settings."),(0,r.kt)("td",{parentName:"tr",align:null},"N/A"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Content"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The contents of the file read from the specified path."),(0,r.kt)("td",{parentName:"tr",align:null},"If the file does not exist and ",(0,r.kt)("inlineCode",{parentName:"td"},"Error On Missing File")," is disabled, this output will be an empty string."))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Path"),(0,r.kt)("td",{parentName:"tr",align:null},"The path of the file to read."),(0,r.kt)("td",{parentName:"tr",align:null},"(required)"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Use Path Input"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the path can be provided via the Path input port."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Error On Missing File"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the node will error if the file does not exist. If disabled, the node will output an empty string if the file does not exist."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-read-a-file-from-a-specified-path"},"Example 1: Read a file from a specified path"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Read File Node and set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Path")," to the path of the file you want to read."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Content")," output of the Read File Node should contain the contents of the file.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Example 1",src:a(2895).Z,width:"672",height:"786"})),(0,r.kt)("h2",{id:"example-2-read-a-file-from-a-dynamic-path"},"Example 2: Read a file from a dynamic path"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a ",(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")," and set the text to the path of the file you want to read."),(0,r.kt)("li",{parentName:"ol"},"Create a Read File Node and enable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Use Path Input")," setting."),(0,r.kt)("li",{parentName:"ol"},"Connect the Text Node to the ",(0,r.kt)("inlineCode",{parentName:"li"},"Path")," input of the Read File Node."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Content")," output of the Read File Node should contain the contents of the file.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Example 2",src:a(3976).Z,width:"1028",height:"254"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Read File Node will error if the native API is not available in the context when the graph is being run. It will also error if the file does not exist and the ",(0,r.kt)("inlineCode",{parentName:"p"},"Error On Missing File")," setting is enabled. If the file does not exist and the ",(0,r.kt)("inlineCode",{parentName:"p"},"Error On Missing File")," setting is disabled, the node will output an empty string."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What is a native API?")),(0,r.kt)("p",null,"A: A native API is an object that is responsible for providing native functionality to nodes. It is passed to the context when the graph is being run. The native API must implement the ",(0,r.kt)("inlineCode",{parentName:"p"},"NativeApi")," interface, which includes methods for reading directories, reading and writing files, and other native operations. See the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api-reference"},"API Reference")," for more information."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I read a file from a URL?")),(0,r.kt)("p",null,"A: No, the Read File Node can only read files from the local file system. If you want to read a file from a URL, you can use the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/http-call"},"HTTP Call Node")," to make a GET request to the URL."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I read a file in a different format, like CSV or XML?")),(0,r.kt)("p",null,"A: The Read File Node will always output the contents of the file as a string. If you want to parse the contents of the file, you can use other nodes like the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-json"},"Extract JSON"),", ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-yaml"},"Extract YAML"),", and the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," to parse the contents of the file."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/http-call"},"HTTP Call Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node"))))}m.isMDXComponent=!0},2895:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-example-01-bd550bf6bd942ac434ddbdb67a19618b.png"},3976:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-example-02-5c3311a00ad3199de93a8b77ef5d5c5e.png"},2791:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-1f5ec13ed1a28103be3644e3c499aeab.png"}}]); \ No newline at end of file diff --git a/assets/js/c1d447ec.cf4aadfa.js b/assets/js/c1d447ec.cf4aadfa.js deleted file mode 100644 index 5f6904f98..000000000 --- a/assets/js/c1d447ec.cf4aadfa.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3294],{1042:(e,t,a)=>{a.d(t,{Zo:()=>d,kt:()=>m});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var u=n.createContext({}),s=function(e){var t=n.useContext(u),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},d=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=s(a),f=r,m=p["".concat(u,".").concat(f)]||p[f]||c[f]||l;return a?n.createElement(m,i(i({ref:t},d),{},{components:a})):n.createElement(m,i({ref:t},d))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=f;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o[p]="string"==typeof e?e:r,i[1]=o;for(var s=2;s{a.d(t,{Z:()=>i});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,i),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>y});var n=a(7396),r=a(3249),l=a(2689),i=a(5986),o=a(6659),u=a(4532),s=a(5821),d=a(3312);function p(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function c(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??p(a);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function f(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:a}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,u._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function h(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=c(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[u,s]=m({queryString:a,groupId:n}),[p,h]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,d.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),g=(()=>{const e=u??p;return f({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var g=a(3072);const k={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function b(e){let{className:t,block:a,selectedValue:o,selectValue:u,tabValues:s}=e;const d=[],{blockElementScrollPositionUntilNextRender:p}=(0,i.o5)(),c=e=>{const t=e.currentTarget,a=d.indexOf(t),n=s[a].value;n!==o&&(p(t),u(n))},f=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const a=d.indexOf(e.currentTarget)+1;t=d[a]??d[0];break}case"ArrowLeft":{const a=d.indexOf(e.currentTarget)-1;t=d[a]??d[d.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},s.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>d.push(e),onKeyDown:f,onClick:c},i,{className:(0,l.Z)("tabs__item",k.tabItem,i?.className,{"tabs__item--active":o===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function v(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",k.tabList)},r.createElement(b,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(v,(0,n.Z)({key:String(t)},e))}},1389:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>u,default:()=>m,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),i=a(5089);const o={id:"read-file",title:"Read File Node",sidebar_label:"Read File"},u=void 0,s={unversionedId:"node-reference/read-file",id:"node-reference/read-file",title:"Read File Node",description:"Read File Node Screenshot",source:"@site/docs/node-reference/read-file.mdx",sourceDirName:"node-reference",slug:"/node-reference/read-file",permalink:"/docs/node-reference/read-file",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/read-file.mdx",tags:[],version:"current",frontMatter:{id:"read-file",title:"Read File Node",sidebar_label:"Read File"},sidebar:"nodeReference",previous:{title:"Read Directory",permalink:"/docs/node-reference/read-directory"},next:{title:"User Input",permalink:"/docs/node-reference/user-input"}},d={},p=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Read a file from a specified path",id:"example-1-read-a-file-from-a-specified-path",level:2},{value:"Example 2: Read a file from a dynamic path",id:"example-2-read-a-file-from-a-dynamic-path",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],c={toc:p},f="wrapper";function m(e){let{components:t,...o}=e;return(0,r.kt)(f,(0,n.Z)({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Screenshot",src:a(2791).Z,width:"414",height:"171"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Read File Node is used to read the contents of a specified file from the file system and output it as a string."),(0,r.kt)("p",null,"If you are using the Rivet SDK, this node requires a native API to be available in the context when the graph is being run. The native API is responsible for providing the functionality to read the contents of a directory."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Path"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The path of the file to read. This input is only available if ",(0,r.kt)("inlineCode",{parentName:"td"},"Use Path Input")," is enabled in settings."),(0,r.kt)("td",{parentName:"tr",align:null},"N/A"),(0,r.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string."))))),(0,r.kt)(i.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Content"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The contents of the file read from the specified path."),(0,r.kt)("td",{parentName:"tr",align:null},"If the file does not exist and ",(0,r.kt)("inlineCode",{parentName:"td"},"Error On Missing File")," is disabled, this output will be an empty string."))))),(0,r.kt)(i.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Path"),(0,r.kt)("td",{parentName:"tr",align:null},"The path of the file to read."),(0,r.kt)("td",{parentName:"tr",align:null},"(required)"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Use Path Input"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the path can be provided via the Path input port."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Error On Missing File"),(0,r.kt)("td",{parentName:"tr",align:null},"If enabled, the node will error if the file does not exist. If disabled, the node will output an empty string if the file does not exist."),(0,r.kt)("td",{parentName:"tr",align:null},"False"),(0,r.kt)("td",{parentName:"tr",align:null},"No"),(0,r.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,r.kt)("h2",{id:"example-1-read-a-file-from-a-specified-path"},"Example 1: Read a file from a specified path"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a Read File Node and set the ",(0,r.kt)("inlineCode",{parentName:"li"},"Path")," to the path of the file you want to read."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Content")," output of the Read File Node should contain the contents of the file.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Example 1",src:a(2895).Z,width:"672",height:"786"})),(0,r.kt)("h2",{id:"example-2-read-a-file-from-a-dynamic-path"},"Example 2: Read a file from a dynamic path"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create a ",(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")," and set the text to the path of the file you want to read."),(0,r.kt)("li",{parentName:"ol"},"Create a Read File Node and enable the ",(0,r.kt)("inlineCode",{parentName:"li"},"Use Path Input")," setting."),(0,r.kt)("li",{parentName:"ol"},"Connect the Text Node to the ",(0,r.kt)("inlineCode",{parentName:"li"},"Path")," input of the Read File Node."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Content")," output of the Read File Node should contain the contents of the file.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Read File Node Example 2",src:a(3976).Z,width:"1028",height:"254"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Read File Node will error if the native API is not available in the context when the graph is being run. It will also error if the file does not exist and the ",(0,r.kt)("inlineCode",{parentName:"p"},"Error On Missing File")," setting is enabled. If the file does not exist and the ",(0,r.kt)("inlineCode",{parentName:"p"},"Error On Missing File")," setting is disabled, the node will output an empty string."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: What is a native API?")),(0,r.kt)("p",null,"A: A native API is an object that is responsible for providing native functionality to nodes. It is passed to the context when the graph is being run. The native API must implement the ",(0,r.kt)("inlineCode",{parentName:"p"},"NativeApi")," interface, which includes methods for reading directories, reading and writing files, and other native operations. See the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api-reference"},"API Reference")," for more information."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I read a file from a URL?")),(0,r.kt)("p",null,"A: No, the Read File Node can only read files from the local file system. If you want to read a file from a URL, you can use the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/http-call"},"HTTP Call Node")," to make a GET request to the URL."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I read a file in a different format, like CSV or XML?")),(0,r.kt)("p",null,"A: The Read File Node will always output the contents of the file as a string. If you want to parse the contents of the file, you can use other nodes like the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-json"},"Extract JSON"),", ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/extract-yaml"},"Extract YAML"),", and the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," to parse the contents of the file."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/http-call"},"HTTP Call Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node"))))}m.isMDXComponent=!0},2895:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-example-01-bd550bf6bd942ac434ddbdb67a19618b.png"},3976:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-example-02-5c3311a00ad3199de93a8b77ef5d5c5e.png"},2791:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/read-file-node-1f5ec13ed1a28103be3644e3c499aeab.png"}}]); \ No newline at end of file diff --git a/assets/js/e22bf98f.55cb8b43.js b/assets/js/e22bf98f.55cb8b43.js new file mode 100644 index 000000000..3ef2cbbc0 --- /dev/null +++ b/assets/js/e22bf98f.55cb8b43.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1919],{1042:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>g});var n=a(3249);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=n.createContext({}),u=function(e){var t=n.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},m=function(e){var t=u(e.components);return n.createElement(i.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,i=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),c=u(a),d=r,g=c["".concat(i,".").concat(d)]||c[d]||p[d]||l;return a?n.createElement(g,s(s({ref:t},m),{},{components:a})):n.createElement(g,s({ref:t},m))}));function g(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,s=new Array(l);s[0]=d;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[c]="string"==typeof e?e:r,s[1]=o;for(var u=2;u{a.d(t,{Z:()=>s});var n=a(3249),r=a(2689);const l={tabItem:"tabItem_o9Hs"};function s(e){let{children:t,hidden:a,className:s}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,s),hidden:a},t)}},2327:(e,t,a)=>{a.d(t,{Z:()=>y});var n=a(7396),r=a(3249),l=a(2689),s=a(5986),o=a(6659),i=a(4532),u=a(5821),m=a(3312);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function p(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??c(a);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function d(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function g(e){let{queryString:t=!1,groupId:a}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function h(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=p(e),[s,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[i,u]=g({queryString:a,groupId:n}),[c,h]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,m.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),f=(()=>{const e=i??c;return d({value:e,tabValues:l})?e:null})();(0,r.useLayoutEffect)((()=>{f&&o(f)}),[f]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),h(e)}),[u,h,l]),tabValues:l}}var f=a(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:a,selectedValue:o,selectValue:i,tabValues:u}=e;const m=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.o5)(),p=e=>{const t=e.currentTarget,a=m.indexOf(t),n=u[a].value;n!==o&&(c(t),i(n))},d=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const a=m.indexOf(e.currentTarget)+1;t=m[a]??m[0];break}case"ArrowLeft":{const a=m.indexOf(e.currentTarget)-1;t=m[a]??m[m.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},u.map((e=>{let{value:t,label:a,attributes:s}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>m.push(e),onKeyDown:d,onClick:p},s,{className:(0,l.Z)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":o===t})}),a??t)})))}function N(e){let{lazy:t,children:a,selectedValue:n}=e;const l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function v(e){const t=h(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",b.tabList)},r.createElement(k,(0,n.Z)({},e,t)),r.createElement(N,(0,n.Z)({},e,t)))}function y(e){const t=(0,f.Z)();return r.createElement(v,(0,n.Z)({key:String(t)},e))}},2621:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>m,contentTitle:()=>i,default:()=>g,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var n=a(7396),r=(a(3249),a(1042)),l=a(2327),s=a(5089);const o={id:"assemble-message",title:"Assemble Message Node",sidebar_label:"Assemble Message"},i=void 0,u={unversionedId:"node-reference/assemble-message",id:"node-reference/assemble-message",title:"Assemble Message Node",description:"Assemble Message Node Screenshot",source:"@site/docs/node-reference/assemble-message.mdx",sourceDirName:"node-reference",slug:"/node-reference/assemble-message",permalink:"/docs/node-reference/assemble-message",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/assemble-message.mdx",tags:[],version:"current",frontMatter:{id:"assemble-message",title:"Assemble Message Node",sidebar_label:"Assemble Message"},sidebar:"nodeReference",previous:{title:"To JSON",permalink:"/docs/node-reference/to-json"},next:{title:"Assemble Prompt",permalink:"/docs/node-reference/assemble-prompt"}},m={},c=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Assemble a user message with text and an image",id:"example-1-assemble-a-user-message-with-text-and-an-image",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],p={toc:c},d="wrapper";function g(e){let{components:t,...o}=e;return(0,r.kt)(d,(0,n.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Assemble Message Node Screenshot",src:a(9165).Z,width:"379",height:"224"})),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"The Assemble Message Node is designed to assemble a single chat message from multiple parts. It is similar to a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/prompt"},"Prompt Node"),", but it works with multimodal models, allowing you to include both text and images in the message. This node is particularly useful when working with multimodal LLMs such as GPT-4 Vision that can process both text and images simultaneously."),(0,r.kt)("p",null,"The Assemble Message Node can be used in conjunction with the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/image"},"Image Node")," or ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/url-reference"},"URL Reference Node")," to include images in a message."),(0,r.kt)("p",null,"The Assemble Message Node outputs a chat message in the same format as a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/prompt"},"Prompt Node"),"."),(0,r.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,r.kt)(s.Z,{value:"inputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"inputs"},"Inputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Part N"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"),"/",(0,r.kt)("inlineCode",{parentName:"td"},"string[]"),"/",(0,r.kt)("inlineCode",{parentName:"td"},"image"),"/",(0,r.kt)("inlineCode",{parentName:"td"},"image[]")),(0,r.kt)("td",{parentName:"tr",align:null},"A part of the message to assemble. Arrays connected to inputs will be flattened, so connecting a single ",(0,r.kt)("inlineCode",{parentName:"td"},"image[]")," connection will put multiple images into the message."),(0,r.kt)("td",{parentName:"tr",align:null},"N/A"),(0,r.kt)("td",{parentName:"tr",align:null},"Dynamic number of input ports based on how many inputs are already connected to the node."))))),(0,r.kt)(s.Z,{value:"outputs",mdxType:"TabItem"},(0,r.kt)("h2",{id:"outputs"},"Outputs"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Title"),(0,r.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Message"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"chat-message")),(0,r.kt)("td",{parentName:"tr",align:null},"The assembled chat message. The message will be in the same format as a message from a ",(0,r.kt)("a",{parentName:"td",href:"/docs/node-reference/prompt"},"Prompt Node"),"."),(0,r.kt)("td",{parentName:"tr",align:null},"The output will be a chat message containing the assembled data. The type of the message will be the specified type."))))),(0,r.kt)(s.Z,{value:"settings",mdxType:"TabItem"},(0,r.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Setting"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,r.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,r.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Type"),(0,r.kt)("td",{parentName:"tr",align:null},"The type of message to assemble. The value should be either 'system', 'user', 'assistant', or 'function'."),(0,r.kt)("td",{parentName:"tr",align:null},"'user'"),(0,r.kt)("td",{parentName:"tr",align:null},"Yes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string"))))))),(0,r.kt)("h2",{id:"example-1-assemble-a-user-message-with-text-and-an-image"},"Example 1: Assemble a user message with text and an image"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Create an Assemble Message Node and set the Type to 'user'."),(0,r.kt)("li",{parentName:"ol"},"Create a ",(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node"),' and set the value to "Here is an image:". Connect the output of the Text Node to the first input of the Assemble Message Node.'),(0,r.kt)("li",{parentName:"ol"},"Create an ",(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/image"},"Image Node")," and browse for your image. Connect the output of the Image Node to the second input of the Assemble Message Node."),(0,r.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,r.kt)("inlineCode",{parentName:"li"},"Message"),' output of the Assemble Message Node should contain a user message with the text "Here is an image of a cat:" and the text ',(0,r.kt)("inlineCode",{parentName:"li"},"(Image)")," indicating that an image is included in the message.")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Assemble Message Node Example 1",src:a(4793).Z,width:"1254",height:"1014"})),(0,r.kt)("h2",{id:"error-handling"},"Error Handling"),(0,r.kt)("p",null,"The Assemble Message Node will error if the ",(0,r.kt)("inlineCode",{parentName:"p"},"Type")," input is enabled and is set to an invalid value."),(0,r.kt)("h2",{id:"faq"},"FAQ"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I include multiple images in a message?")),(0,r.kt)("p",null,"A: Yes, you can include multiple images in a message by connecting multiple input nodes."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I use the Assemble Message Node with a function tool call?")),(0,r.kt)("p",null,"A: Yes, you can set the Type to 'function' to assemble a function response tool call message. Note that function tool call messages require a Tool Call ID, which can be provided via the ",(0,r.kt)("inlineCode",{parentName:"p"},"Tool Call ID")," input or setting. The output of the tool call is the assembled message content."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Q: Can I include a function call with an ",(0,r.kt)("inlineCode",{parentName:"strong"},"assistant"),"-type message?")),(0,r.kt)("p",null,"A: At this time, only the ",(0,r.kt)("a",{parentName:"p",href:"/docs/node-reference/prompt"},"Prompt Node")," supports function/tool calls with ",(0,r.kt)("inlineCode",{parentName:"p"},"assistant"),"-type messages."),(0,r.kt)("h2",{id:"see-also"},"See Also"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/prompt"},"Prompt Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/image"},"Image Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/url-reference"},"URL Reference Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/array"},"Array Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/docs/node-reference/chat"},"Chat Node"))))}g.isMDXComponent=!0},4793:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/assemble-message-node-example-01-6bf162c8c957f04c0c51d9fb555f62b8.png"},9165:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/assemble-message-node-78f820983d1493836f71bc6947ef703e.png"}}]); \ No newline at end of file diff --git a/assets/js/e44794b9.7219cc7d.js b/assets/js/e44794b9.7219cc7d.js new file mode 100644 index 000000000..112f935fc --- /dev/null +++ b/assets/js/e44794b9.7219cc7d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7843],{1042:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>h});var n=r(3249);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),u=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},c=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(r),m=a,h=p["".concat(s,".").concat(m)]||p[m]||d[m]||o;return r?n.createElement(h,l(l({ref:t},c),{},{components:r})):n.createElement(h,l({ref:t},c))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{r.d(t,{Z:()=>l});var n=r(3249),a=r(2689);const o={tabItem:"tabItem_o9Hs"};function l(e){let{children:t,hidden:r,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:r},t)}},2327:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(7396),a=r(3249),o=r(2689),l=r(5986),i=r(6659),s=r(4532),u=r(5821),c=r(3312);function p(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}function d(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??p(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function m(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:r}=e;const n=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})}),[o,n])]}function f(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,o=d(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[s,u]=h({queryString:r,groupId:n}),[p,f]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,o]=(0,c.Nk)(r);return[n,(0,a.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:n}),b=(()=>{const e=s??p;return m({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var b=r(3072);const g={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function N(e){let{className:t,block:r,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.o5)(),d=e=>{const t=e.currentTarget,r=c.indexOf(t),n=u[r].value;n!==i&&(p(t),s(n))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=c.indexOf(e.currentTarget)+1;t=c[r]??c[0];break}case"ArrowLeft":{const r=c.indexOf(e.currentTarget)-1;t=c[r]??c[c.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===t})}),r??t)})))}function k(e){let{lazy:t,children:r,selectedValue:n}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function v(e){const t=f(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(N,(0,n.Z)({},e,t)),a.createElement(k,(0,n.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return a.createElement(v,(0,n.Z)({key:String(t)},e))}},1867:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>u,toc:()=>p});var n=r(7396),a=(r(3249),r(1042)),o=r(2327),l=r(5089);const i={id:"extract-json",title:"Extract JSON Node",sidebar_label:"Extract JSON"},s=void 0,u={unversionedId:"node-reference/extract-json",id:"node-reference/extract-json",title:"Extract JSON Node",description:"Extract JSON Node Screenshot",source:"@site/docs/node-reference/extract-json.mdx",sourceDirName:"node-reference",slug:"/node-reference/extract-json",permalink:"/docs/node-reference/extract-json",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/extract-json.mdx",tags:[],version:"current",frontMatter:{id:"extract-json",title:"Extract JSON Node",sidebar_label:"Extract JSON"},sidebar:"nodeReference",previous:{title:"Destructure",permalink:"/docs/node-reference/destructure"},next:{title:"Extract Object Path",permalink:"/docs/node-reference/extract-object-path"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Algorithm",id:"algorithm",level:3},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Extract a JSON object from an LLM response",id:"example-1-extract-a-json-object-from-an-llm-response",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:p},m="wrapper";function h(e){let{components:t,...i}=e;return(0,a.kt)(m,(0,n.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Extract JSON Node Screenshot",src:r(2578).Z,width:"412",height:"211"})),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"The Extract JSON node lets you extract an object from a string containing a JSON object or array. Data outside of the JSON object or array will be ignored."),(0,a.kt)("p",null,"Extract JSON is very useful to extract structured data from LLM responses. Ask the LLM to reply with a JSON object, and then use Extract JSON to extract that data from its response, ignoring any text around the JSON object."),(0,a.kt)("h3",{id:"algorithm"},"Algorithm"),(0,a.kt)("p",null,"The node finds the first instance of ",(0,a.kt)("inlineCode",{parentName:"p"},"{")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"["),", and the last instance of ",(0,a.kt)("inlineCode",{parentName:"p"},"}")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"]")," in the string. It then extracts the substring between those two points, and attempts to parse it as JSON."),(0,a.kt)("p",null,"This process is not iterative at the moment, so if the parsing fails because the text contains, for example, two JSON objects, with text in between, the node will error. Use this node when you are sure that the string contains only one JSON object or array."),(0,a.kt)(o.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"inputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"inputs"},"Inputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Input"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:null},"The string that a JSON object or array will be extracted from."),(0,a.kt)("td",{parentName:"tr",align:null},"(required)"),(0,a.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string."))))),(0,a.kt)(l.Z,{value:"outputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"outputs"},"Outputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Output"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"object")),(0,a.kt)("td",{parentName:"tr",align:null},"The string or array that was extracted from the string."),(0,a.kt)("td",{parentName:"tr",align:null},"If there was no string or array found in the input string, then this port will not be ran.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"No Match"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:null},"If there was no string or object found in the input text, then this port will run, with the full contents of the input string."),(0,a.kt)("td",{parentName:"tr",align:null},"If there was a string or array found in the input string, this port will not be ran."))))),(0,a.kt)(l.Z,{value:"settings",mdxType:"TabItem"},(0,a.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,a.kt)("p",null,"This node has no configurable editor settings."))),(0,a.kt)("h2",{id:"example-1-extract-a-json-object-from-an-llm-response"},"Example 1: Extract a JSON object from an LLM response"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node"),", and ask the LLM to reply with JSON:",(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre"},"Please reply to this message with a JSON object.\n"))),(0,a.kt)("li",{parentName:"ol"},"Create a ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/chat"},"Chat Node"),", and connect the Text node to its ",(0,a.kt)("inlineCode",{parentName:"li"},"Prompt")," input."),(0,a.kt)("li",{parentName:"ol"},"Create an Extract JSON node, and connect the Chat node to its ",(0,a.kt)("inlineCode",{parentName:"li"},"Input")," input."),(0,a.kt)("li",{parentName:"ol"},"Run the graph, and note that you see the JSON object that you replied with in the Extract JSON node's output. The ",(0,a.kt)("inlineCode",{parentName:"li"},"No Match")," output is not ran, because there was a match.")),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Extract JSON Example 1",src:r(9102).Z,width:"1089",height:"548"})),(0,a.kt)("h2",{id:"error-handling"},"Error Handling"),(0,a.kt)("p",null,"This node cannot error under normal circumstances. If the input fails to extract JSON, then the ",(0,a.kt)("inlineCode",{parentName:"p"},"No Match")," output will be executed instead of the ",(0,a.kt)("inlineCode",{parentName:"p"},"Result")," output."),(0,a.kt)("h2",{id:"faq"},"FAQ"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What if the string contains more than one JSON object?")),(0,a.kt)("p",null,"A: The node will error. Use this node when you are sure that the string contains only one JSON object or array. For more complex use-cases, you may want to use a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," to parse the string in a custom way."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What if I just want to call ",(0,a.kt)("inlineCode",{parentName:"strong"},"JSON.parse()"),"?")),(0,a.kt)("p",null,"A: You can use a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," that simply calls JSON.parse() on the input string."),(0,a.kt)("h2",{id:"see-also"},"See Also"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-yaml"},"Extract YAML Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/to-json"},"To JSON Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-with-regex"},"Extract with Regex Node"))))}h.isMDXComponent=!0},9102:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/extract-json-node-example-01-084bcf9aa769af0151e1308d7c407bb9.png"},2578:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/extract-json-node-daae5a3dc6f25249a298b5db7455225d.png"}}]); \ No newline at end of file diff --git a/assets/js/e44794b9.9167b539.js b/assets/js/e44794b9.9167b539.js deleted file mode 100644 index a04046dcd..000000000 --- a/assets/js/e44794b9.9167b539.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7843],{1042:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>h});var r=n(3249);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(n),m=a,h=p["".concat(s,".").concat(m)]||p[m]||d[m]||o;return n?r.createElement(h,l(l({ref:t},c),{},{components:n})):r.createElement(h,l({ref:t},c))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{n.d(t,{Z:()=>l});var r=n(3249),a=n(2689);const o={tabItem:"tabItem_o9Hs"};function l(e){let{children:t,hidden:n,className:l}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(7396),a=n(3249),o=n(2689),l=n(5986),i=n(6659),s=n(4532),u=n(5821),c=n(3312);function p(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function d(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??p(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const r=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(r.location.search);t.set(o,e),r.replace({...r.location,search:t.toString()})}),[o,r])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=d(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[s,u]=h({queryString:n,groupId:r}),[p,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,o]=(0,c.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:r}),b=(()=>{const e=s??p;return m({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var b=n(3072);const g={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function N(e){let{className:t,block:n,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.o5)(),d=e=>{const t=e.currentTarget,n=c.indexOf(t),r=u[n].value;r!==i&&(p(t),s(r))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:l}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:r}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function v(e){const t=f(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(N,(0,r.Z)({},e,t)),a.createElement(k,(0,r.Z)({},e,t)))}function y(e){const t=(0,b.Z)();return a.createElement(v,(0,r.Z)({key:String(t)},e))}},1867:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>u,toc:()=>p});var r=n(7396),a=(n(3249),n(1042)),o=n(2327),l=n(5089);const i={id:"extract-json",title:"Extract JSON Node",sidebar_label:"Extract JSON"},s=void 0,u={unversionedId:"node-reference/extract-json",id:"node-reference/extract-json",title:"Extract JSON Node",description:"Extract JSON Node Screenshot",source:"@site/docs/node-reference/extract-json.mdx",sourceDirName:"node-reference",slug:"/node-reference/extract-json",permalink:"/docs/node-reference/extract-json",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/extract-json.mdx",tags:[],version:"current",frontMatter:{id:"extract-json",title:"Extract JSON Node",sidebar_label:"Extract JSON"},sidebar:"nodeReference",previous:{title:"RNG",permalink:"/docs/node-reference/RNG"},next:{title:"Extract Object Path",permalink:"/docs/node-reference/extract-object-path"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Algorithm",id:"algorithm",level:3},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Extract a JSON object from an LLM response",id:"example-1-extract-a-json-object-from-an-llm-response",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],d={toc:p},m="wrapper";function h(e){let{components:t,...i}=e;return(0,a.kt)(m,(0,r.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Extract JSON Node Screenshot",src:n(2578).Z,width:"412",height:"211"})),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"The Extract JSON node lets you extract an object from a string containing a JSON object or array. Data outside of the JSON object or array will be ignored."),(0,a.kt)("p",null,"Extract JSON is very useful to extract structured data from LLM responses. Ask the LLM to reply with a JSON object, and then use Extract JSON to extract that data from its response, ignoring any text around the JSON object."),(0,a.kt)("h3",{id:"algorithm"},"Algorithm"),(0,a.kt)("p",null,"The node finds the first instance of ",(0,a.kt)("inlineCode",{parentName:"p"},"{")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"["),", and the last instance of ",(0,a.kt)("inlineCode",{parentName:"p"},"}")," or ",(0,a.kt)("inlineCode",{parentName:"p"},"]")," in the string. It then extracts the substring between those two points, and attempts to parse it as JSON."),(0,a.kt)("p",null,"This process is not iterative at the moment, so if the parsing fails because the text contains, for example, two JSON objects, with text in between, the node will error. Use this node when you are sure that the string contains only one JSON object or array."),(0,a.kt)(o.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"inputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"inputs"},"Inputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Input"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:null},"The string that a JSON object or array will be extracted from."),(0,a.kt)("td",{parentName:"tr",align:null},"(required)"),(0,a.kt)("td",{parentName:"tr",align:null},"The input will be coerced into a string if it is not a string."))))),(0,a.kt)(l.Z,{value:"outputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"outputs"},"Outputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Output"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"object")),(0,a.kt)("td",{parentName:"tr",align:null},"The string or array that was extracted from the string."),(0,a.kt)("td",{parentName:"tr",align:null},"If there was no string or array found in the input string, then this port will not be ran.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"No Match"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:null},"If there was no string or object found in the input text, then this port will run, with the full contents of the input string."),(0,a.kt)("td",{parentName:"tr",align:null},"If there was a string or array found in the input string, this port will not be ran."))))),(0,a.kt)(l.Z,{value:"settings",mdxType:"TabItem"},(0,a.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,a.kt)("p",null,"This node has no configurable editor settings."))),(0,a.kt)("h2",{id:"example-1-extract-a-json-object-from-an-llm-response"},"Example 1: Extract a JSON object from an LLM response"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node"),", and ask the LLM to reply with JSON:",(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre"},"Please reply to this message with a JSON object.\n"))),(0,a.kt)("li",{parentName:"ol"},"Create a ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/chat"},"Chat Node"),", and connect the Text node to its ",(0,a.kt)("inlineCode",{parentName:"li"},"Prompt")," input."),(0,a.kt)("li",{parentName:"ol"},"Create an Extract JSON node, and connect the Chat node to its ",(0,a.kt)("inlineCode",{parentName:"li"},"Input")," input."),(0,a.kt)("li",{parentName:"ol"},"Run the graph, and note that you see the JSON object that you replied with in the Extract JSON node's output. The ",(0,a.kt)("inlineCode",{parentName:"li"},"No Match")," output is not ran, because there was a match.")),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"Extract JSON Example 1",src:n(9102).Z,width:"1089",height:"548"})),(0,a.kt)("h2",{id:"error-handling"},"Error Handling"),(0,a.kt)("p",null,"This node cannot error under normal circumstances. If the input fails to extract JSON, then the ",(0,a.kt)("inlineCode",{parentName:"p"},"No Match")," output will be executed instead of the ",(0,a.kt)("inlineCode",{parentName:"p"},"Result")," output."),(0,a.kt)("h2",{id:"faq"},"FAQ"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What if the string contains more than one JSON object?")),(0,a.kt)("p",null,"A: The node will error. Use this node when you are sure that the string contains only one JSON object or array. For more complex use-cases, you may want to use a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," to parse the string in a custom way."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What if I just want to call ",(0,a.kt)("inlineCode",{parentName:"strong"},"JSON.parse()"),"?")),(0,a.kt)("p",null,"A: You can use a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node-reference/code"},"Code Node")," that simply calls JSON.parse() on the input string."),(0,a.kt)("h2",{id:"see-also"},"See Also"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-yaml"},"Extract YAML Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-object-path"},"Extract Object Path Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/to-json"},"To JSON Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/extract-with-regex"},"Extract with Regex Node"))))}h.isMDXComponent=!0},9102:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/extract-json-node-example-01-084bcf9aa769af0151e1308d7c407bb9.png"},2578:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/extract-json-node-daae5a3dc6f25249a298b5db7455225d.png"}}]); \ No newline at end of file diff --git a/assets/js/faa5d0dd.5de918ec.js b/assets/js/faa5d0dd.5de918ec.js new file mode 100644 index 000000000..5e0d50b7f --- /dev/null +++ b/assets/js/faa5d0dd.5de918ec.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[219],{1042:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var r=n(3249);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=r.createContext({}),s=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=s(e.components);return r.createElement(u.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,u=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,f=d["".concat(u,".").concat(m)]||d[m]||p[m]||l;return n?r.createElement(f,o(o({ref:t},c),{},{components:n})):r.createElement(f,o({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[d]="string"==typeof e?e:a,o[1]=i;for(var s=2;s{n.d(t,{Z:()=>o});var r=n(3249),a=n(2689);const l={tabItem:"tabItem_o9Hs"};function o(e){let{children:t,hidden:n,className:o}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,o),hidden:n},t)}},2327:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(7396),a=n(3249),l=n(2689),o=n(5986),i=n(6659),u=n(4532),s=n(5821),c=n(3312);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function p(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??d(n);return function(e){const t=(0,s.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const r=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,l=p(e),[o,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,s]=f({queryString:n,groupId:r}),[d,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,c.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:r}),g=(()=>{const e=u??d;return m({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),s(e),h(e)}),[s,h,l]),tabValues:l}}var g=n(3072);const b={tabList:"tabList_Dwv5",tabItem:"tabItem_KiUr"};function k(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:s}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.o5)(),p=e=>{const t=e.currentTarget,n=c.indexOf(t),r=s[n].value;r!==i&&(d(t),u(r))},m=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},s.map((e=>{let{value:t,label:n,attributes:o}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:m,onClick:p},o,{className:(0,l.Z)("tabs__item",b.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:r}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function v(e){const t=h(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",b.tabList)},a.createElement(k,(0,r.Z)({},e,t)),a.createElement(N,(0,r.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return a.createElement(v,(0,r.Z)({key:String(t)},e))}},5949:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>u,default:()=>f,frontMatter:()=>i,metadata:()=>s,toc:()=>d});var r=n(7396),a=(n(3249),n(1042)),l=n(2327),o=n(5089);const i={id:"url-reference",title:"URL Reference Node",sidebar_label:"URL Reference"},u=void 0,s={unversionedId:"node-reference/url-reference",id:"node-reference/url-reference",title:"URL Reference Node",description:"URL Reference Node Screenshot",source:"@site/docs/node-reference/url-reference.mdx",sourceDirName:"node-reference",slug:"/node-reference/url-reference",permalink:"/docs/node-reference/url-reference",draft:!1,editUrl:"https://github.com/ironclad/rivet/tree/main/packages/docs/docs/node-reference/url-reference.mdx",tags:[],version:"current",frontMatter:{id:"url-reference",title:"URL Reference Node",sidebar_label:"URL Reference"},sidebar:"nodeReference",previous:{title:"Image",permalink:"/docs/node-reference/image"},next:{title:"Abort Graph",permalink:"/docs/node-reference/abort-graph"}},c={},d=[{value:"Overview",id:"overview",level:2},{value:"Inputs",id:"inputs",level:2},{value:"Outputs",id:"outputs",level:2},{value:"Editor Settings",id:"editor-settings",level:2},{value:"Example 1: Define a URL Reference",id:"example-1-define-a-url-reference",level:2},{value:"Example 2: Convert a String into a URL Reference",id:"example-2-convert-a-string-into-a-url-reference",level:2},{value:"Error Handling",id:"error-handling",level:2},{value:"FAQ",id:"faq",level:2},{value:"See Also",id:"see-also",level:2}],p={toc:d},m="wrapper";function f(e){let{components:t,...i}=e;return(0,a.kt)(m,(0,r.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"URL Reference Node Screenshot",src:n(2055).Z,width:"297",height:"155"})),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"The URL Reference Node is used to define a reference to a URL or convert a string into a URL reference. This node is particularly useful when used with the Assemble Message node to define URLs for attachments or images, allowing the LLM to download the image instead of having to upload the image with your chat request."),(0,a.kt)(l.Z,{defaultValue:"inputs",values:[{label:"Inputs",value:"inputs"},{label:"Outputs",value:"outputs"},{label:"Editor Settings",value:"settings"}],mdxType:"Tabs"},(0,a.kt)(o.Z,{value:"inputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"inputs"},"Inputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"URL"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:null},"The string to be converted into a URL reference."),(0,a.kt)("td",{parentName:"tr",align:null},"(empty)"),(0,a.kt)("td",{parentName:"tr",align:null},"This input is only available if the ",(0,a.kt)("inlineCode",{parentName:"td"},"Use URL Input")," setting is enabled."))))),(0,a.kt)(o.Z,{value:"outputs",mdxType:"TabItem"},(0,a.kt)("h2",{id:"outputs"},"Outputs"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Title"),(0,a.kt)("th",{parentName:"tr",align:null},"Data Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Notes"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"URL Reference"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"object")),(0,a.kt)("td",{parentName:"tr",align:null},"A reference to the specified URL."),(0,a.kt)("td",{parentName:"tr",align:null},"None"))))),(0,a.kt)(o.Z,{value:"settings",mdxType:"TabItem"},(0,a.kt)("h2",{id:"editor-settings"},"Editor Settings"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Setting"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Default Value"),(0,a.kt)("th",{parentName:"tr",align:null},"Use Input Toggle"),(0,a.kt)("th",{parentName:"tr",align:null},"Input Data Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"URL"),(0,a.kt)("td",{parentName:"tr",align:null},"The URL to be converted into a URL reference."),(0,a.kt)("td",{parentName:"tr",align:null},"(empty)"),(0,a.kt)("td",{parentName:"tr",align:null},"Yes"),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"string"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},"Use URL Input"),(0,a.kt)("td",{parentName:"tr",align:null},"If enabled, the URL can be provided via the URL input port."),(0,a.kt)("td",{parentName:"tr",align:null},"False"),(0,a.kt)("td",{parentName:"tr",align:null},"No"),(0,a.kt)("td",{parentName:"tr",align:null},"N/A")))))),(0,a.kt)("h2",{id:"example-1-define-a-url-reference"},"Example 1: Define a URL Reference"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a URL Reference Node."),(0,a.kt)("li",{parentName:"ol"},"Set the ",(0,a.kt)("inlineCode",{parentName:"li"},"URL")," setting to the URL you want to reference (e.g., ",(0,a.kt)("inlineCode",{parentName:"li"},"https://example.com/image.jpg"),")."),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,a.kt)("inlineCode",{parentName:"li"},"URL Reference")," output of the URL Reference Node should contain a reference to the specified URL.")),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"URL Reference Node Example 1",src:n(4245).Z,width:"778",height:"472"})),(0,a.kt)("h2",{id:"example-2-convert-a-string-into-a-url-reference"},"Example 2: Convert a String into a URL Reference"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Create a URL Reference Node and enable the ",(0,a.kt)("inlineCode",{parentName:"li"},"Use URL Input")," setting."),(0,a.kt)("li",{parentName:"ol"},"Create a ",(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")," and set the text to the URL you want to reference (e.g., ",(0,a.kt)("inlineCode",{parentName:"li"},"https://example.com/image.jpg"),")."),(0,a.kt)("li",{parentName:"ol"},"Connect the Text Node to the ",(0,a.kt)("inlineCode",{parentName:"li"},"URL")," input of the URL Reference Node."),(0,a.kt)("li",{parentName:"ol"},"Run the graph. The ",(0,a.kt)("inlineCode",{parentName:"li"},"URL Reference")," output of the URL Reference Node should contain a reference to the specified URL.")),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"URL Reference Node Example 2",src:n(749).Z,width:"1446",height:"500"})),(0,a.kt)("h2",{id:"error-handling"},"Error Handling"),(0,a.kt)("p",null,"The URL Reference Node cannot error under normal circumstances. If the ",(0,a.kt)("inlineCode",{parentName:"p"},"URL")," input is not provided, the node will use the URL specified in the settings."),(0,a.kt)("h2",{id:"faq"},"FAQ"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: Can I use the URL Reference Node to reference a file on my local machine?")),(0,a.kt)("p",null,"A: No, the URL Reference Node is intended for referencing URLs on the internet. If you want to reference a file on your local machine, you would need to upload the file to a web server and reference the URL of the uploaded file, or use the Image Node to load the image from your local machine."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Q: What happens if I provide an invalid URL?")),(0,a.kt)("p",null,"A: The URL Reference Node does not validate the URL. It simply creates a reference to the provided URL. If the URL is invalid, any nodes that use the URL reference may fail or behave unexpectedly."),(0,a.kt)("h2",{id:"see-also"},"See Also"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/assemble-message"},"Assemble Message Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/text"},"Text Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/http-call"},"HTTP Call Node")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"/docs/node-reference/image"},"Image Node"))))}f.isMDXComponent=!0},4245:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/url-reference-node-example-01-efa1b1b3ed1fbbc63648e57f00878345.png"},749:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/url-reference-node-example-02-ae8e7d34db944c246a0c711dd4926b9a.png"},2055:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/url-reference-node-fe811cbf87f2f39dd58c15063ca34d70.png"}}]); \ No newline at end of file diff --git a/assets/js/main.234660a3.js b/assets/js/main.234660a3.js deleted file mode 100644 index 77e563365..000000000 --- a/assets/js/main.234660a3.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.234660a3.js.LICENSE.txt */ -(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[179],{3352:(e,t,n)=>{"use strict";n.d(t,{_:()=>o,t:()=>a});var r=n(3249);const o=r.createContext(!1);function a(e){let{children:t}=e;const[n,a]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{a(!0)}),[]),r.createElement(o.Provider,{value:n},t)}},8961:(e,t,n)=>{"use strict";var r=n(3249),o=n(1638),a=n(1365),i=n(3133),l=n(8498);const s=[n(1505),n(506),n(2324),n(821),n(638)];var c=n(5102),u=n(6659),d=n(435);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(7396),m=n(2493),g=n(3506),h=n(2463),b=n(3046),v=n(8766),y=n(4789),w=n(8573),k=n(4917),E=n(5042),S=n(155);function x(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,g.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:o}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:o})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,g.Z)(),o=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,g.Z)(),{pathname:r}=(0,u.TH)();return e+(0,E.applyTrailingSlash)((0,h.Z)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:o;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:a}),r.createElement("link",{rel:"canonical",href:a}))}function C(){const{i18n:{currentLocale:e}}=(0,g.Z)(),{metadata:t,image:n}=(0,b.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(v.d,{image:n}),r.createElement(_,null),r.createElement(x,null),r.createElement(S.Z,{tag:k.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,p.Z)({key:t},e))))))}const T=new Map;function R(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var P=n(3352),L=n(3771);function A(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>o.forEach((e=>e?.()))}const N=function(e){let{children:t,location:n,previousLocation:o}=e;return(0,r.useLayoutEffect)((()=>{o!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,o=t.hash===n.hash,a=t.search===n.search;if(r&&o&&!a)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:o}),A("onRouteDidUpdate",{previousLocation:o,location:n}))}),[o,n]),t};function O(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class D extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?A("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=A("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),O(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(N,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const I=D,M="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",z="__docusaurus-base-url-issue-banner-suggestion-container",j="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${j}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${j}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${M}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{window[j]=!1}),[]),r.createElement(r.Fragment,null,!l.Z.canUseDOM&&r.createElement(m.Z,null,r.createElement("script",null,B(e))),r.createElement("div",{id:M}))}function U(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,g.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(G,null):null}function $(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:o,localeConfigs:a}}=(0,g.Z)(),i=(0,h.Z)(e),{htmlLang:l,direction:s}=a[o];return r.createElement(m.Z,null,r.createElement("html",{lang:l,dir:s}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:i}))}var H=n(2041),q=n(3072);function Z(){const e=(0,q.Z)();return r.createElement(m.Z,null,r.createElement("html",{"data-has-hydrated":e}))}function V(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement(H.Z,null,r.createElement(L.M,null,r.createElement(P.t,null,r.createElement(f,null,r.createElement($,null),r.createElement(C,null),r.createElement(U,null),r.createElement(I,{location:R(t)},e)),r.createElement(Z,null))))}var W=n(6887);const Y=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Q=n(4785);const K=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!K.has(e))(e))return!1;K.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(W).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Q.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Y(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),O(e))},te=Object.freeze(ee);if(l.Z.canUseDOM){window.docusaurus=te;const e=o.hydrate;O(window.location.pathname).then((()=>{e(r.createElement(i.B6,null,r.createElement(a.VK,null,r.createElement(V,null))),document.getElementById("__docusaurus"))}))}},3771:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(3249),o=n(6809);const a=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs/","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs/","mainDocId":"introduction","docs":[{"id":"api-reference","path":"/docs/api-reference","sidebar":"apiReference"},{"id":"api-reference/core/DataValue","path":"/docs/api-reference/core/DataValue","sidebar":"apiReference"},{"id":"api-reference/core/GraphProcessor","path":"/docs/api-reference/core/GraphProcessor","sidebar":"apiReference"},{"id":"api-reference/core/NodeGraph","path":"/docs/api-reference/core/NodeGraph","sidebar":"apiReference"},{"id":"api-reference/core/overview","path":"/docs/api-reference/core/overview","sidebar":"apiReference"},{"id":"api-reference/core/Project","path":"/docs/api-reference/core/Project","sidebar":"apiReference"},{"id":"api-reference/core/Settings","path":"/docs/api-reference/core/Settings","sidebar":"apiReference"},{"id":"api-reference/getting-started-integration","path":"/docs/api-reference/getting-started-integration","sidebar":"apiReference"},{"id":"api-reference/node/createProcessor","path":"/docs/api-reference/node/createProcessor","sidebar":"apiReference"},{"id":"api-reference/node/DebuggerEvents","path":"/docs/api-reference/node/DebuggerEvents","sidebar":"apiReference"},{"id":"api-reference/node/loadProjectFromFile","path":"/docs/api-reference/node/loadProjectFromFile","sidebar":"apiReference"},{"id":"api-reference/node/loadProjectFromString","path":"/docs/api-reference/node/loadProjectFromString","sidebar":"apiReference"},{"id":"api-reference/node/LooseDataValue","path":"/docs/api-reference/node/LooseDataValue","sidebar":"apiReference"},{"id":"api-reference/node/overview","path":"/docs/api-reference/node/overview","sidebar":"apiReference"},{"id":"api-reference/node/RivetDebuggerServer","path":"/docs/api-reference/node/RivetDebuggerServer","sidebar":"apiReference"},{"id":"api-reference/node/runGraph","path":"/docs/api-reference/node/runGraph","sidebar":"apiReference"},{"id":"api-reference/node/runGraphInFile","path":"/docs/api-reference/node/runGraphInFile","sidebar":"apiReference"},{"id":"api-reference/node/RunGraphOptions","path":"/docs/api-reference/node/RunGraphOptions","sidebar":"apiReference"},{"id":"api-reference/node/startDebuggerServer","path":"/docs/api-reference/node/startDebuggerServer","sidebar":"apiReference"},{"id":"api-reference/recording","path":"/docs/api-reference/recording"},{"id":"api-reference/remote-debugging","path":"/docs/api-reference/remote-debugging","sidebar":"apiReference"},{"id":"getting-started/first-ai-agent","path":"/docs/getting-started/first-ai-agent","sidebar":"userGuide"},{"id":"getting-started/installation","path":"/docs/getting-started/installation","sidebar":"userGuide"},{"id":"getting-started/setup","path":"/docs/getting-started/setup","sidebar":"userGuide"},{"id":"introduction","path":"/docs/","sidebar":"userGuide"},{"id":"node-reference","path":"/docs/node-reference","sidebar":"nodeReference"},{"id":"node-reference/abort-graph","path":"/docs/node-reference/abort-graph","sidebar":"nodeReference"},{"id":"node-reference/all-nodes","path":"/docs/node-reference/all-nodes","sidebar":"nodeReference"},{"id":"node-reference/append-to-dataset","path":"/docs/node-reference/append-to-dataset","sidebar":"nodeReference"},{"id":"node-reference/array","path":"/docs/node-reference/array","sidebar":"nodeReference"},{"id":"node-reference/assemble-prompt","path":"/docs/node-reference/assemble-prompt","sidebar":"nodeReference"},{"id":"node-reference/audio","path":"/docs/node-reference/audio","sidebar":"nodeReference"},{"id":"node-reference/bool","path":"/docs/node-reference/bool","sidebar":"nodeReference"},{"id":"node-reference/chat","path":"/docs/node-reference/chat","sidebar":"nodeReference"},{"id":"node-reference/chunk","path":"/docs/node-reference/chunk","sidebar":"nodeReference"},{"id":"node-reference/coalesce","path":"/docs/node-reference/coalesce","sidebar":"nodeReference"},{"id":"node-reference/code","path":"/docs/node-reference/code","sidebar":"nodeReference"},{"id":"node-reference/comment","path":"/docs/node-reference/comment","sidebar":"nodeReference"},{"id":"node-reference/compare","path":"/docs/node-reference/compare","sidebar":"nodeReference"},{"id":"node-reference/context","path":"/docs/node-reference/context","sidebar":"nodeReference"},{"id":"node-reference/create-dataset","path":"/docs/node-reference/create-dataset","sidebar":"nodeReference"},{"id":"node-reference/delay","path":"/docs/node-reference/delay","sidebar":"nodeReference"},{"id":"node-reference/evaluate","path":"/docs/node-reference/evaluate","sidebar":"nodeReference"},{"id":"node-reference/external-call","path":"/docs/node-reference/external-call","sidebar":"nodeReference"},{"id":"node-reference/extract-json","path":"/docs/node-reference/extract-json","sidebar":"nodeReference"},{"id":"node-reference/extract-markdown-code-blocks","path":"/docs/node-reference/extract-markdown-code-blocks","sidebar":"nodeReference"},{"id":"node-reference/extract-object-path","path":"/docs/node-reference/extract-object-path","sidebar":"nodeReference"},{"id":"node-reference/extract-with-regex","path":"/docs/node-reference/extract-with-regex","sidebar":"nodeReference"},{"id":"node-reference/extract-yaml","path":"/docs/node-reference/extract-yaml","sidebar":"nodeReference"},{"id":"node-reference/filter","path":"/docs/node-reference/filter","sidebar":"nodeReference"},{"id":"node-reference/get-all-datasets","path":"/docs/node-reference/get-all-datasets","sidebar":"nodeReference"},{"id":"node-reference/get-dataset-row","path":"/docs/node-reference/get-dataset-row","sidebar":"nodeReference"},{"id":"node-reference/get-embedding","path":"/docs/node-reference/get-embedding","sidebar":"nodeReference"},{"id":"node-reference/get-global","path":"/docs/node-reference/get-global","sidebar":"nodeReference"},{"id":"node-reference/gpt-function","path":"/docs/node-reference/gpt-function","sidebar":"nodeReference"},{"id":"node-reference/graph-input","path":"/docs/node-reference/graph-input","sidebar":"nodeReference"},{"id":"node-reference/graph-output","path":"/docs/node-reference/graph-output","sidebar":"nodeReference"},{"id":"node-reference/hash","path":"/docs/node-reference/hash","sidebar":"nodeReference"},{"id":"node-reference/http-call","path":"/docs/node-reference/http-call","sidebar":"nodeReference"},{"id":"node-reference/if","path":"/docs/node-reference/if","sidebar":"nodeReference"},{"id":"node-reference/if-else","path":"/docs/node-reference/if-else","sidebar":"nodeReference"},{"id":"node-reference/image","path":"/docs/node-reference/image","sidebar":"nodeReference"},{"id":"node-reference/join","path":"/docs/node-reference/join","sidebar":"nodeReference"},{"id":"node-reference/knn-dataset","path":"/docs/node-reference/knn-dataset","sidebar":"nodeReference"},{"id":"node-reference/load-dataset","path":"/docs/node-reference/load-dataset","sidebar":"nodeReference"},{"id":"node-reference/loop-controller","path":"/docs/node-reference/loop-controller","sidebar":"nodeReference"},{"id":"node-reference/match","path":"/docs/node-reference/match","sidebar":"nodeReference"},{"id":"node-reference/number","path":"/docs/node-reference/number","sidebar":"nodeReference"},{"id":"node-reference/object","path":"/docs/node-reference/object","sidebar":"nodeReference"},{"id":"node-reference/passthrough","path":"/docs/node-reference/passthrough","sidebar":"nodeReference"},{"id":"node-reference/pop","path":"/docs/node-reference/pop","sidebar":"nodeReference"},{"id":"node-reference/prompt","path":"/docs/node-reference/prompt","sidebar":"nodeReference"},{"id":"node-reference/race-inputs","path":"/docs/node-reference/race-inputs","sidebar":"nodeReference"},{"id":"node-reference/raise-event","path":"/docs/node-reference/raise-event","sidebar":"nodeReference"},{"id":"node-reference/read-directory","path":"/docs/node-reference/read-directory","sidebar":"nodeReference"},{"id":"node-reference/read-file","path":"/docs/node-reference/read-file","sidebar":"nodeReference"},{"id":"node-reference/RNG","path":"/docs/node-reference/RNG","sidebar":"nodeReference"},{"id":"node-reference/set-global","path":"/docs/node-reference/set-global","sidebar":"nodeReference"},{"id":"node-reference/shuffle","path":"/docs/node-reference/shuffle","sidebar":"nodeReference"},{"id":"node-reference/slice","path":"/docs/node-reference/slice","sidebar":"nodeReference"},{"id":"node-reference/split-text","path":"/docs/node-reference/split-text","sidebar":"nodeReference"},{"id":"node-reference/subgraph","path":"/docs/node-reference/subgraph","sidebar":"nodeReference"},{"id":"node-reference/text","path":"/docs/node-reference/text","sidebar":"nodeReference"},{"id":"node-reference/to-json","path":"/docs/node-reference/to-json","sidebar":"nodeReference"},{"id":"node-reference/to-yaml","path":"/docs/node-reference/to-yaml","sidebar":"nodeReference"},{"id":"node-reference/trim-chat-messages","path":"/docs/node-reference/trim-chat-messages","sidebar":"nodeReference"},{"id":"node-reference/user-input","path":"/docs/node-reference/user-input","sidebar":"nodeReference"},{"id":"node-reference/vector-knn","path":"/docs/node-reference/vector-knn","sidebar":"nodeReference"},{"id":"node-reference/vector-store","path":"/docs/node-reference/vector-store","sidebar":"nodeReference"},{"id":"node-reference/wait-for-event","path":"/docs/node-reference/wait-for-event","sidebar":"nodeReference"},{"id":"trivet","path":"/docs/trivet","sidebar":"userGuide"},{"id":"tutorial","path":"/docs/tutorial","sidebar":"tutorial"},{"id":"tutorial/installing-getting-started","path":"/docs/tutorial/installing-getting-started","sidebar":"tutorial"},{"id":"tutorial/interpolation-more-node-types","path":"/docs/tutorial/interpolation-more-node-types","sidebar":"tutorial"},{"id":"tutorial/loops","path":"/docs/tutorial/loops","sidebar":"tutorial"},{"id":"tutorial/matching-conditionals","path":"/docs/tutorial/matching-conditionals","sidebar":"tutorial"},{"id":"tutorial/simple-graph","path":"/docs/tutorial/simple-graph","sidebar":"tutorial"},{"id":"tutorial/splitting","path":"/docs/tutorial/splitting","sidebar":"tutorial"},{"id":"tutorial/subgraphs","path":"/docs/tutorial/subgraphs","sidebar":"tutorial"},{"id":"tutorial/testing-graphs","path":"/docs/tutorial/testing-graphs"},{"id":"tutorial/yaml","path":"/docs/tutorial/yaml","sidebar":"tutorial"},{"id":"user-guide/adding-connecting-nodes","path":"/docs/user-guide/adding-connecting-nodes","sidebar":"userGuide"},{"id":"user-guide/control-flow","path":"/docs/user-guide/control-flow","sidebar":"userGuide"},{"id":"user-guide/data-types","path":"/docs/user-guide/data-types","sidebar":"userGuide"},{"id":"user-guide/executing-ai-chains","path":"/docs/user-guide/executing-ai-chains","sidebar":"userGuide"},{"id":"user-guide/executors","path":"/docs/user-guide/executors","sidebar":"userGuide"},{"id":"user-guide/features/chat-viewer","path":"/docs/user-guide/features/chat-viewer","sidebar":"userGuide"},{"id":"user-guide/features/data-studio","path":"/docs/user-guide/features/data-studio","sidebar":"userGuide"},{"id":"user-guide/features/prompt-designer","path":"/docs/user-guide/features/prompt-designer","sidebar":"userGuide"},{"id":"user-guide/features/trivet-tests","path":"/docs/user-guide/features/trivet-tests","sidebar":"userGuide"},{"id":"user-guide/live-debugging","path":"/docs/user-guide/live-debugging","sidebar":"userGuide"},{"id":"user-guide/loops","path":"/docs/user-guide/loops","sidebar":"userGuide"},{"id":"user-guide/overview-of-interface","path":"/docs/user-guide/overview-of-interface","sidebar":"userGuide"},{"id":"user-guide/plugins","path":"/docs/user-guide/plugins","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/all","path":"/docs/user-guide/plugins/built-in/all","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/anthropic","path":"/docs/user-guide/plugins/built-in/anthropic","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/assemblyai","path":"/docs/user-guide/plugins/built-in/assemblyai","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/autoevals","path":"/docs/user-guide/plugins/built-in/autoevals","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/gentrace","path":"/docs/user-guide/plugins/built-in/gentrace","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/huggingface","path":"/docs/user-guide/plugins/built-in/huggingface","sidebar":"userGuide"},{"id":"user-guide/plugins/built-in/pinecone","path":"/docs/user-guide/plugins/built-in/pinecone","sidebar":"userGuide"},{"id":"user-guide/plugins/creating-plugins","path":"/docs/user-guide/plugins/creating-plugins","sidebar":"userGuide"},{"id":"user-guide/prompt-designer","path":"/docs/user-guide/prompt-designer"},{"id":"user-guide/recordings","path":"/docs/user-guide/recordings","sidebar":"userGuide"},{"id":"user-guide/remote-debugging","path":"/docs/user-guide/remote-debugging","sidebar":"userGuide"},{"id":"user-guide/splitting","path":"/docs/user-guide/splitting","sidebar":"userGuide"},{"id":"user-guide/subgraphs","path":"/docs/user-guide/subgraphs","sidebar":"userGuide"},{"id":"user-guide/trivet-getting-started","path":"/docs/user-guide/trivet-getting-started","sidebar":"userGuide"},{"id":"user-guide/trivet-library","path":"/docs/user-guide/trivet-library","sidebar":"userGuide"},{"id":"user-guide/trivet-tutorial","path":"/docs/user-guide/trivet-tutorial","sidebar":"userGuide"},{"id":"user-guide/trivet-validation-graphs","path":"/docs/user-guide/trivet-validation-graphs","sidebar":"userGuide"},{"id":"user-guide/working-with-graphs","path":"/docs/user-guide/working-with-graphs","sidebar":"userGuide"},{"id":"user-guide/working-with-projects","path":"/docs/user-guide/working-with-projects","sidebar":"userGuide"}],"draftIds":[],"sidebars":{"userGuide":{"link":{"path":"/docs/","label":"introduction"}},"tutorial":{"link":{"path":"/docs/tutorial","label":"tutorial"}},"apiReference":{"link":{"path":"/docs/api-reference","label":"api-reference"}},"nodeReference":{"link":{"path":"/docs/node-reference","label":"node-reference"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"2.4.3","siteVersion":"1.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.4.3"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.4.3"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.4.3"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.4.3"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.4.3"},"docusaurus-plugin-image-zoom":{"type":"package","name":"docusaurus-plugin-image-zoom","version":"1.0.1"}}}'),c={siteConfig:o.default,siteMetadata:s,globalData:a,i18n:i,codeTranslations:l},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},2041:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(3249),o=n(8498),a=n(2493),i=n(6011),l=n(5860);function s(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"}},r.createElement("h1",{style:{fontSize:"3rem"}},"This page crashed"),r.createElement("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"}},"Try again"),r.createElement(c,{error:t}))}function c(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{style:{whiteSpace:"pre-wrap"}},n)}function u(e){let{error:t,tryAgain:n}=e;return r.createElement(f,{fallback:()=>r.createElement(s,{error:t,tryAgain:n})},r.createElement(a.Z,null,r.createElement("title",null,"Page Error")),r.createElement(l.Z,null,r.createElement(s,{error:t,tryAgain:n})))}const d=e=>r.createElement(u,e);class f extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){o.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??d)(e)}return e??null}}},8498:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},2493:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3249),o=n(3133);function a(e){return r.createElement(o.ql,e)}},6998:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7396),o=n(3249),a=n(1365),i=n(6011),l=n(3506),s=n(7773),c=n(8498);const u=o.createContext({collectLink:()=>{}});var d=n(2463);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:m,isActive:g,"data-noBrokenLinkCheck":h,autoAddBaseUrl:b=!0,...v}=e;const{siteConfig:{trailingSlash:y,baseUrl:w}}=(0,l.Z)(),{withBaseUrl:k}=(0,d.C)(),E=(0,o.useContext)(u),S=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,(()=>S.current));const x=f||p;const _=(0,s.Z)(x),C=x?.replace("pathname://","");let T=void 0!==C?(R=C,b&&(e=>e.startsWith("/"))(R)?k(R):R):void 0;var R;T&&_&&(T=(0,i.applyTrailingSlash)(T,{trailingSlash:y,baseUrl:w}));const P=(0,o.useRef)(!1),L=n?a.OL:a.rU,A=c.Z.canUseIntersectionObserver,N=(0,o.useRef)(),O=()=>{P.current||null==T||(window.docusaurus.preload(T),P.current=!0)};(0,o.useEffect)((()=>(!A&&_&&null!=T&&window.docusaurus.prefetch(T),()=>{A&&N.current&&N.current.disconnect()})),[N,T,A,_]);const D=T?.startsWith("#")??!1,I=!T||!_||D;return I||h||E.collectLink(T),I?o.createElement("a",(0,r.Z)({ref:S,href:T},x&&!_&&{target:"_blank",rel:"noopener noreferrer"},v)):o.createElement(L,(0,r.Z)({},v,{onMouseEnter:O,onTouchStart:O,innerRef:e=>{S.current=e,A&&e&&_&&(N.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(N.current.unobserve(e),N.current.disconnect(),null!=T&&window.docusaurus.prefetch(T))}))})),N.current.observe(e))},to:T},n&&{isActive:g,activeClassName:m}))}const p=o.forwardRef(f)},3131:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=()=>null},1872:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s,I:()=>l});var r=n(3249);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var a=n(7529);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return a[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return o(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:a}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,o(l,a))}},4973:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},7773:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>o,b:()=>r})},2463:(e,t,n)=>{"use strict";n.d(t,{C:()=>i,Z:()=>l});var r=n(3249),o=n(3506),a=n(7773);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,o.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:o=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,a.b)(n))return n;if(o)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3506:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3249),o=n(3771);function a(){return(0,r.useContext)(o._)}},5606:(e,t,n)=>{"use strict";n.d(t,{OD:()=>a,eZ:()=>i});var r=n(3506),o=n(4973);function a(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,r.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}function i(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});const r=a(e),i=r?.[t];if(!i&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return i}},3072:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3249),o=n(3352);function a(){return(0,r.useContext)(o._)}},4785:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function o(e){const t={};return function e(n,o){Object.entries(n).forEach((n=>{let[a,i]=n;const l=o?`${o}.${a}`:a;r(i)?e(i,l):t[l]=i}))}(e),t}},4864:(e,t,n)=>{"use strict";n.d(t,{_:()=>o,z:()=>a});var r=n(3249);const o=r.createContext(null);function a(e){let{children:t,value:n}=e;const a=r.useContext(o),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:a,value:n})),[a,n]);return r.createElement(o.Provider,{value:i},t)}},3062:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>f,gA:()=>u,Jo:()=>p,gB:()=>d});var r=n(6659),o=n(5606);const a=e=>e.versions.find((e=>e.isLast));function i(e,t){const n=function(e,t){const n=a(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),o=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}const l={},s=()=>(0,o.OD)("docusaurus-plugin-content-docs")??l,c=e=>(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0});function u(e){void 0===e&&(e={});const t=s(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return a}(t,n,e)}function d(e){return c(e).versions}function f(e){const t=c(e),{pathname:n}=(0,r.TH)();return i(t,n)}function p(e){const t=c(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=a(e);return{latestDocSuggestion:i(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},8646:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>f,gA:()=>u,_r:()=>s,zh:()=>c,yW:()=>d});var r=n(6659),o=n(5606);const a=e=>e.versions.find((e=>e.isLast));function i(e,t){const n=function(e,t){const n=a(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),o=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}const l={},s=()=>(0,o.OD)("docusaurus-plugin-content-docs")??l,c=e=>(0,o.eZ)("docusaurus-plugin-content-docs",e,{failfast:!0});function u(e){void 0===e&&(e={});const t=s(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return a}(t,n,e)}function d(e){const t=c(e);return a(t)}function f(e){const t=c(e),{pathname:n}=(0,r.TH)();return i(t,n)}},2169:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(1238),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{o().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){o().done()}}},506:(e,t,n)=>{"use strict";n.r(t);var r=n(7421),o=n(6809);!function(e){const{themeConfig:{prism:t}}=o.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(9808)(`./prism-${e}`)})),delete globalThis.Prism}(r.Z)},349:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3249);const o={iconExternalLink:"iconExternalLink_YGOo"};function a(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:o.iconExternalLink},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},5860:(e,t,n)=>{"use strict";n.d(t,{Z:()=>dt});var r=n(3249),o=n(2689),a=n(2041),i=n(8766),l=n(7396),s=n(6659),c=n(1872),u=n(4850);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,s.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,u.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,c.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function g(e){const t=e.children??m,{containerRef:n,onClick:o}=p();return r.createElement("div",{ref:n,role:"region","aria-label":m},r.createElement("a",(0,l.Z)({},e,{href:`#${d}`,onClick:o}),t))}var h=n(9423),b=n(8573);const v={skipToContent:"skipToContent_QXLn"};function y(){return r.createElement(g,{className:v.skipToContent})}var w=n(3046),k=n(3420);function E(e){let{width:t=21,height:n=21,color:o="currentColor",strokeWidth:a=1.2,className:i,...s}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 15 15",width:t,height:n},s),r.createElement("g",{stroke:o,strokeWidth:a},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const S={closeButton:"closeButton_UYvV"};function x(e){return r.createElement("button",(0,l.Z)({type:"button","aria-label":(0,c.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,o.Z)("clean-btn close",S.closeButton,e.className)}),r.createElement(E,{width:14,height:14,strokeWidth:3.1}))}const _={content:"content_c02M"};function C(e){const{announcementBar:t}=(0,w.L)(),{content:n}=t;return r.createElement("div",(0,l.Z)({},e,{className:(0,o.Z)(_.content,e.className),dangerouslySetInnerHTML:{__html:n}}))}const T={announcementBar:"announcementBar_PRBf",announcementBarPlaceholder:"announcementBarPlaceholder__CIl",announcementBarClose:"announcementBarClose_g3lL",announcementBarContent:"announcementBarContent_O9dQ"};function R(){const{announcementBar:e}=(0,w.L)(),{isActive:t,close:n}=(0,k.nT)();if(!t)return null;const{backgroundColor:o,textColor:a,isCloseable:i}=e;return r.createElement("div",{className:T.announcementBar,style:{backgroundColor:o,color:a},role:"banner"},i&&r.createElement("div",{className:T.announcementBarPlaceholder}),r.createElement(C,{className:T.announcementBarContent}),i&&r.createElement(x,{onClick:n,className:T.announcementBarClose}))}var P=n(2867),L=n(5986);var A=n(3709),N=n(1406);const O=r.createContext(null);function D(e){let{children:t}=e;const n=function(){const e=(0,P.e)(),t=(0,N.HY)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,A.D9)(a);return(0,r.useEffect)((()=>{a&&!i&&o(!0)}),[a,i]),(0,r.useEffect)((()=>{a?e.shown||o(!0):o(!1)}),[e.shown,a]),(0,r.useMemo)((()=>[n,o]),[n])}();return r.createElement(O.Provider,{value:n},t)}function I(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function M(){const e=(0,r.useContext)(O);if(!e)throw new A.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)((()=>n(!1)),[n]),a=(0,N.HY)();return(0,r.useMemo)((()=>({shown:t,hide:o,content:I(a)})),[o,a,t])}function F(e){let{header:t,primaryMenu:n,secondaryMenu:a}=e;const{shown:i}=M();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,o.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},a)))}var z=n(1106),j=n(3072);function B(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function G(e){return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const U={toggle:"toggle_IDoG",toggleButton:"toggleButton_ettb",darkToggleIcon:"darkToggleIcon_Fn3x",lightToggleIcon:"lightToggleIcon_NRy2",toggleButtonDisabled:"toggleButtonDisabled_Ktf1"};function $(e){let{className:t,buttonClassName:n,value:a,onChange:i}=e;const l=(0,j.Z)(),s=(0,c.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===a?(0,c.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,o.Z)(U.toggle,t)},r.createElement("button",{className:(0,o.Z)("clean-btn",U.toggleButton,!l&&U.toggleButtonDisabled,n),type:"button",onClick:()=>i("dark"===a?"light":"dark"),disabled:!l,title:s,"aria-label":s,"aria-live":"polite"},r.createElement(B,{className:(0,o.Z)(U.toggleIcon,U.lightToggleIcon)}),r.createElement(G,{className:(0,o.Z)(U.toggleIcon,U.darkToggleIcon)})))}const H=r.memo($),q={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_bmce"};function Z(e){let{className:t}=e;const n=(0,w.L)().navbar.style,o=(0,w.L)().colorMode.disableSwitch,{colorMode:a,setColorMode:i}=(0,z.I)();return o?null:r.createElement(H,{className:t,buttonClassName:"dark"===n?q.darkNavbarColorModeToggle:void 0,value:a,onChange:i})}var V=n(1287);function W(){return r.createElement(V.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Y(){const e=(0,P.e)();return r.createElement("button",{type:"button","aria-label":(0,c.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(E,{color:"var(--ifm-color-emphasis-600)"}))}function Q(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(W,null),r.createElement(Z,{className:"margin-right--md"}),r.createElement(Y,null))}var K=n(6998),X=n(2463),J=n(7773);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(349);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:o,href:a,label:i,html:s,isDropdownLink:c,prependBaseUrlToHref:u,...d}=e;const f=(0,X.Z)(o),p=(0,X.Z)(t),m=(0,X.Z)(a,{forcePrependBaseUrl:!0}),g=i&&a&&!(0,J.Z)(a),h=s?{dangerouslySetInnerHTML:{__html:s}}:{children:r.createElement(r.Fragment,null,i,g&&r.createElement(te.Z,c&&{width:12,height:12}))};return a?r.createElement(K.Z,(0,l.Z)({href:u?m:a},d,h)):r.createElement(K.Z,(0,l.Z)({to:f,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},d,h))}function re(e){let{className:t,isDropdownItem:n=!1,...a}=e;const i=r.createElement(ne,(0,l.Z)({className:(0,o.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},a));return n?r.createElement("li",null,i):i}function oe(e){let{className:t,isDropdownItem:n,...a}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(ne,(0,l.Z)({className:(0,o.Z)("menu__link",t)},a)))}function ae(e){let{mobile:t=!1,position:n,...o}=e;const a=t?oe:re;return r.createElement(a,(0,l.Z)({},o,{activeClassName:o.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ie=n(4565),le=n(1303),se=n(3506);function ce(e,t){return e.some((e=>function(e,t){return!!(0,le.Mg)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function ue(e){let{items:t,position:n,className:a,onClick:i,...s}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[c]),r.createElement("div",{ref:c,className:(0,o.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u})},r.createElement(ne,(0,l.Z)({"aria-haspopup":"true","aria-expanded":u,role:"button",href:s.to?void 0:"#",className:(0,o.Z)("navbar__link",a)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))}}),s.children??s.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,t)=>r.createElement(xe,(0,l.Z)({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))))))}function de(e){let{items:t,className:n,position:a,onClick:i,...c}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,se.Z)(),{pathname:t}=(0,s.TH)();return t.replace(e,"/")}(),d=ce(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[u,d,m]),r.createElement("li",{className:(0,o.Z)("menu__list-item",{"menu__list-item--collapsed":f})},r.createElement(ne,(0,l.Z)({role:"button",className:(0,o.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},c,{onClick:e=>{e.preventDefault(),p()}}),c.children??c.label),r.createElement(ie.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:f},t.map(((e,t)=>r.createElement(xe,(0,l.Z)({mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active"},e,{key:t}))))))}function fe(e){let{mobile:t=!1,...n}=e;const o=t?de:ue;return r.createElement(o,n)}var pe=n(4789);function me(e){let{width:t=20,height:n=20,...o}=e;return r.createElement("svg",(0,l.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},o),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const ge="iconLanguage_OtLR";var he=n(3131);const be={searchBox:"searchBox_Tbn_"};function ve(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,o.Z)(n,be.searchBox)},t)}var ye=n(3062),we=n(6839);var ke=n(6242);const Ee=e=>e.docs.find((t=>t.id===e.mainDocId));const Se={default:ae,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:o,...a}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:d}}=(0,se.Z)(),f=(0,pe.l)(),{search:p,hash:m}=(0,s.TH)(),g=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...o],h=t?(0,c.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return r.createElement(fe,(0,l.Z)({},a,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(me,{className:ge}),h),items:g}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(ve,{className:n},r.createElement(he.Z,null))},dropdown:fe,html:function(e){let{value:t,className:n,mobile:a=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,o.Z)({navbar__item:!a&&!i,"menu__list-item":a},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:o,...a}=e;const{activeDoc:i}=(0,ye.Iw)(o),s=(0,we.vY)(t,o);return null===s?null:r.createElement(ae,(0,l.Z)({exact:!0},a,{isActive:()=>i?.path===s.path||!!i?.sidebar&&i.sidebar===s.sidebar,label:n??s.id,to:s.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:o,...a}=e;const{activeDoc:i}=(0,ye.Iw)(o),s=(0,we.oz)(t,o).link;if(!s)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(ae,(0,l.Z)({exact:!0},a,{isActive:()=>i?.sidebar===t,label:n??s.label,to:s.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:o,...a}=e;const i=(0,we.lO)(o)[0],s=t??i.label,c=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(i).path;return r.createElement(ae,(0,l.Z)({},a,{label:s,to:c}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:o,dropdownItemsBefore:a,dropdownItemsAfter:i,...u}=e;const{search:d,hash:f}=(0,s.TH)(),p=(0,ye.Iw)(n),m=(0,ye.gB)(n),{savePreferredVersionName:g}=(0,ke.J)(n),h=[...a,...m.map((e=>{const t=p.alternateDocVersions[e.name]??Ee(e);return{label:e.label,to:`${t.path}${d}${f}`,isActive:()=>e===p.activeVersion,onClick:()=>g(e.name)}})),...i],b=(0,we.lO)(n)[0],v=t&&h.length>1?(0,c.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):b.label,y=t&&h.length>1?void 0:Ee(b).path;return h.length<=1?r.createElement(ae,(0,l.Z)({},u,{mobile:t,label:v,to:y,isActive:o?()=>!1:void 0})):r.createElement(fe,(0,l.Z)({},u,{mobile:t,label:v,to:y,items:h,isActive:o?()=>!1:void 0}))}};function xe(e){let{type:t,...n}=e;const o=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=Se[o];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(a,n)}function _e(){const e=(0,P.e)(),t=(0,w.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(xe,(0,l.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function Ce(e){return r.createElement("button",(0,l.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Te(){const e=0===(0,w.L)().navbar.items.length,t=M();return r.createElement(r.Fragment,null,!e&&r.createElement(Ce,{onClick:()=>t.hide()}),t.content)}function Re(){const e=(0,P.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(F,{header:r.createElement(Q,null),primaryMenu:r.createElement(_e,null),secondaryMenu:r.createElement(Te,null)}):null}const Pe={navbarHideable:"navbarHideable_BBhz",navbarHidden:"navbarHidden_NiMI"};function Le(e){return r.createElement("div",(0,l.Z)({role:"presentation"},e,{className:(0,o.Z)("navbar-sidebar__backdrop",e.className)}))}function Ae(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:a}}=(0,w.L)(),i=(0,P.e)(),{navbarRef:l,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,L.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,"aria-label":(0,c.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.Z)("navbar","navbar--fixed-top",n&&[Pe.navbarHideable,!s&&Pe.navbarHidden],{"navbar--dark":"dark"===a,"navbar--primary":"primary"===a,"navbar-sidebar--show":i.shown})},t,r.createElement(Le,{onClick:i.toggle}),r.createElement(Re,null))}var Ne=n(6011);const Oe={errorBoundaryError:"errorBoundaryError_mVUP"};function De(e){return r.createElement("button",(0,l.Z)({type:"button"},e),r.createElement(c.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error"},"Try again"))}function Ie(e){let{error:t}=e;const n=(0,Ne.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{className:Oe.errorBoundaryError},n)}class Me extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const Fe="right";function ze(e){let{width:t=30,height:n=30,className:o,...a}=e;return r.createElement("svg",(0,l.Z)({className:o,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},a),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function je(){const{toggle:e,shown:t}=(0,P.e)();return r.createElement("button",{onClick:e,"aria-label":(0,c.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(ze,null))}const Be={colorModeToggle:"colorModeToggle_WRUd"};function Ge(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(Me,{key:t,onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t})},r.createElement(xe,e)))))}function Ue(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function $e(){const e=(0,P.e)(),t=(0,w.L)().navbar.items,[n,o]=function(e){function t(e){return"left"===(e.position??Fe)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return r.createElement(Ue,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(je,null),r.createElement(W,null),r.createElement(Ge,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(Ge,{items:o}),r.createElement(Z,{className:Be.colorModeToggle}),!a&&r.createElement(ve,null,r.createElement(he.Z,null)))})}function He(){return r.createElement(Ae,null,r.createElement($e,null))}function qe(e){let{item:t}=e;const{to:n,href:o,label:a,prependBaseUrlToHref:i,...s}=t,c=(0,X.Z)(n),u=(0,X.Z)(o,{forcePrependBaseUrl:!0});return r.createElement(K.Z,(0,l.Z)({className:"footer__link-item"},o?{href:i?u:o}:{to:c},s),a,o&&!(0,J.Z)(o)&&r.createElement(te.Z,null))}function Ze(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(qe,{item:t}))}function Ve(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(Ze,{key:t,item:e})))))}function We(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(Ve,{key:t,column:e}))))}function Ye(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function Qe(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(qe,{item:t})}function Ke(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(Qe,{item:e}),t.length!==n+1&&r.createElement(Ye,null))))))}function Xe(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(We,{columns:t}):r.createElement(Ke,{links:t})}var Je=n(1426);const et={footerLogoLink:"footerLogoLink_kz1O"};function tt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.C)(),a={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(Je.Z,{className:(0,o.Z)("footer__logo",t.className),alt:t.alt,sources:a,width:t.width,height:t.height,style:t.style})}function nt(e){let{logo:t}=e;return t.href?r.createElement(K.Z,{href:t.href,className:et.footerLogoLink,target:t.target},r.createElement(tt,{logo:t})):r.createElement(tt,{logo:t})}function rt(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:a,copyright:i}=e;return r.createElement("footer",{className:(0,o.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(a||i)&&r.createElement("div",{className:"footer__bottom text--center"},a&&r.createElement("div",{className:"margin-bottom--sm"},a),i)))}function at(){const{footer:e}=(0,w.L)();if(!e)return null;const{copyright:t,links:n,logo:o,style:a}=e;return r.createElement(ot,{style:a,links:n&&n.length>0&&r.createElement(Xe,{links:n}),logo:o&&r.createElement(nt,{logo:o}),copyright:t&&r.createElement(rt,{copyright:t})})}const it=r.memo(at),lt=(0,A.Qc)([z.S,k.pl,L.OC,ke.L5,i.VC,function(e){let{children:t}=e;return r.createElement(N.n2,null,r.createElement(P.M,null,r.createElement(D,null,t)))}]);function st(e){let{children:t}=e;return r.createElement(lt,null,t)}function ct(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("div",{className:"margin-vert--lg"},r.createElement(De,{onClick:n,className:"button button--primary shadow--lw"})),r.createElement("hr",null),r.createElement("div",{className:"margin-vert--md"},r.createElement(Ie,{error:t})))))}const ut={mainWrapper:"mainWrapper_B4Ie"};function dt(e){const{children:t,noFooter:n,wrapperClassName:l,title:s,description:c}=e;return(0,b.t)(),r.createElement(st,null,r.createElement(i.d,{title:s,description:c}),r.createElement(y,null),r.createElement(R,null),r.createElement(He,null),r.createElement("div",{id:d,className:(0,o.Z)(h.k.wrapper.main,ut.mainWrapper,l)},r.createElement(a.Z,{fallback:e=>r.createElement(ct,e)},t)),!n&&r.createElement(it,null))}},1287:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7396),o=n(3249),a=n(6998),i=n(2463),l=n(3506),s=n(3046),c=n(1426);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,i.Z)(t.src),dark:(0,i.Z)(t.srcDark||t.src)},l=o.createElement(c.Z,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?o.createElement("div",{className:r},l):l}function d(e){const{siteConfig:{title:t}}=(0,l.Z)(),{navbar:{title:n,logo:c}}=(0,s.L)(),{imageClassName:d,titleClassName:f,...p}=e,m=(0,i.Z)(c?.href||"/"),g=n?"":t,h=c?.alt??g;return o.createElement(a.Z,(0,r.Z)({to:m},p,c?.target&&{target:c.target}),c&&o.createElement(u,{logo:c,alt:h,imageClassName:d}),null!=n&&o.createElement("b",{className:f},n))}},155:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(3249),o=n(2493);function a(e){let{locale:t,version:n,tag:a}=e;const i=t;return r.createElement(o.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),a&&r.createElement("meta",{name:"docusaurus_tag",content:a}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),a&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:a}))}},1426:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7396),o=n(3249),a=n(2689),i=n(3072),l=n(1106);const s={themedImage:"themedImage_xd2l","themedImage--light":"themedImage--light_r6yD","themedImage--dark":"themedImage--dark_Wxbp"};function c(e){const t=(0,i.Z)(),{colorMode:n}=(0,l.I)(),{sources:c,className:u,alt:d,...f}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return o.createElement(o.Fragment,null,p.map((e=>o.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,a.Z)(s.themedImage,s[`themedImage--${e}`],u)},f)))))}},4565:(e,t,n)=>{"use strict";n.d(t,{u:()=>s,z:()=>h});var r=n(7396),o=n(3249),a=n(8498),i=n(9066);const l="ease-in-out";function s(e){let{initialState:t}=e;const[n,r]=(0,o.useState)(t??!1),a=(0,o.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:a}}const c={display:"none",overflow:"hidden",height:"0px"},u={display:"block",overflow:"visible",height:"auto"};function d(e,t){const n=t?c:u;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function f(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const a=(0,o.useRef)(!1);(0,o.useEffect)((()=>{const e=t.current;function o(){const t=e.scrollHeight,n=r?.duration??function(e){if((0,i.n)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${r?.easing??l}`,height:`${t}px`}}function s(){const t=o();e.style.transition=t.transition,e.style.height=t.height}if(!a.current)return d(e,n),void(a.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function p(e){if(!a.Z.canUseDOM)return e?c:u}function m(e){let{as:t="div",collapsed:n,children:r,animation:a,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const c=(0,o.useRef)(null);return f({collapsibleRef:c,collapsed:n,animation:a}),o.createElement(t,{ref:c,style:s?void 0:p(n),onTransitionEnd:e=>{"height"===e.propertyName&&(d(c.current,n),i?.(n))},className:l},r)}function g(e){let{collapsed:t,...n}=e;const[a,i]=(0,o.useState)(!t),[l,s]=(0,o.useState)(t);return(0,o.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,o.useLayoutEffect)((()=>{a&&s(t)}),[a,t]),a?o.createElement(m,(0,r.Z)({},n,{collapsed:l})):null}function h(e){let{lazy:t,...n}=e;const r=t?g:m;return o.createElement(r,n)}},3420:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>p});var r=n(3249),o=n(3072),a=n(3312),i=n(3709),l=n(3046);const s=(0,a.WA)("docusaurus.announcement.dismiss"),c=(0,a.WA)("docusaurus.announcement.id"),u=()=>"true"===s.get(),d=e=>s.set(String(e)),f=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.L)(),t=(0,o.Z)(),[n,a]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{a(u())}),[]);const i=(0,r.useCallback)((()=>{d(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(f.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},1106:(e,t,n)=>{"use strict";n.d(t,{I:()=>h,S:()=>g});var r=n(3249),o=n(8498),a=n(3709),i=n(3312),l=n(3046);const s=r.createContext(void 0),c="theme",u=(0,i.WA)(c),d={light:"light",dark:"dark"},f=e=>e===d.dark?d.dark:d.light,p=e=>o.Z.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{u.set(f(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.L)(),[o,a]=(0,r.useState)(p(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:o=!0}=r;t?(a(t),o&&m(t)):(a(n?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:i,get isDarkTheme(){return o===d.dark},setLightTheme(){i(d.light)},setDarkTheme(){i(d.dark)}})),[o,i])}();return r.createElement(s.Provider,{value:n},t)}function h(){const e=(0,r.useContext)(s);if(null==e)throw new a.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},6242:(e,t,n)=>{"use strict";n.d(t,{J:()=>v,L5:()=>h});var r=n(3249),o=n(8646),a=n(4973),i=n(3046),l=n(6839),s=n(3709),c=n(3312);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,c.WA)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.WA)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.WA)(u(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function m(){const e=(0,o._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[a,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function o(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,o(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[a,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=m();return r.createElement(p.Provider,{value:n},t)}function h(e){let{children:t}=e;return l.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function b(){const e=(0,r.useContext)(p);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=a.m);const t=(0,o.zh)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},2258:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,b:()=>l});var r=n(3249),o=n(3709);const a=Symbol("EmptyContext"),i=r.createContext(a);function l(e){let{children:t,name:n,items:o}=e;const a=(0,r.useMemo)((()=>n&&o?{name:n,items:o}:null),[n,o]);return r.createElement(i.Provider,{value:a},t)}function s(){const e=(0,r.useContext)(i);if(e===a)throw new o.i6("DocsSidebarProvider");return e}},2867:(e,t,n)=>{"use strict";n.d(t,{M:()=>d,e:()=>f});var r=n(3249),o=n(1406),a=n(8236),i=n(4532),l=n(3046),s=n(3709);const c=r.createContext(void 0);function u(){const e=function(){const e=(0,o.HY)(),{items:t}=(0,l.L)().navbar;return 0===t.length&&!e.component}(),t=(0,a.i)(),n=!e&&"mobile"===t,[s,c]=(0,r.useState)(!1);(0,i.Rb)((()=>{if(s)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:s})),[e,n,u,s])}function d(e){let{children:t}=e;const n=u();return r.createElement(c.Provider,{value:n},t)}function f(){const e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},1406:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>s,n2:()=>i});var r=n(3249),o=n(3709);const a=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(a.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(a);if(!e)throw new o.i6("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(a);if(!i)throw new o.i6("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(0,o.Ql)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},8573:(e,t,n)=>{"use strict";n.d(t,{h:()=>o,t:()=>a});var r=n(3249);const o="navigation-with-keyboard";function a(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},8236:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(3249),o=n(8498);const a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(){return o.Z.canUseDOM?window.innerWidth>i?a.desktop:a.mobile:a.ssr}const s=!1;function c(){const[e,t]=(0,r.useState)((()=>s?"ssr":l()));return(0,r.useEffect)((()=>{function e(){t(l())}const n=s?window.setTimeout(e,1e3):void 0;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(n)}}),[]),e}},9423:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},9066:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},6839:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>f,_F:()=>g,cE:()=>d,hI:()=>k,lO:()=>v,oz:()=>y,s1:()=>b,vY:()=>w});var r=n(3249),o=n(6659),a=n(435),i=n(8646),l=n(6242),s=n(2258),c=n(5821),u=n(1303);const d=!!i._r;function f(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=f(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.Mg)(e,t),m=(e,t)=>e.some((e=>g(e,t)));function g(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||m(e.items,t))}function h(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const o=[];return function e(t){for(const a of t)if("category"===a.type&&((0,u.Mg)(a.href,n)||e(a.items))||"link"===a.type&&(0,u.Mg)(a.href,n)){return r&&"category"!==a.type||o.unshift(a),!0}return!1}(t),o}function b(){const e=(0,s.V)(),{pathname:t}=(0,o.TH)(),n=(0,i.gA)()?.pluginData.breadcrumbs;return!1!==n&&e?h({sidebarItems:e.items,pathname:t}):null}function v(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,l.J)(e),o=(0,i.yW)(e);return(0,r.useMemo)((()=>(0,c.j)([t,n,o].filter(Boolean))),[t,n,o])}function y(e,t){const n=v(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function w(e,t){const n=v(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.j)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function k(e){let{route:t,versionMetadata:n}=e;const r=(0,o.TH)(),i=t.routes,l=i.find((e=>(0,o.LX)(r.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?n.docsSidebars[s]:void 0;return{docElement:(0,a.H)(i),sidebarName:s,sidebarItems:c}}},4532:(e,t,n)=>{"use strict";n.d(t,{Rb:()=>l,_X:()=>s});var r=n(3249),o=n(6659),a=n(4087),i=n(3709);function l(e){!function(e){const t=(0,o.k6)(),n=(0,i.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function s(e){return function(e){const t=(0,o.k6)();return(0,a.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},5821:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function o(e){return Array.from(new Set(e))}n.d(t,{j:()=>o,l:()=>r})},8766:(e,t,n)=>{"use strict";n.d(t,{FG:()=>f,d:()=>u,VC:()=>p});var r=n(3249),o=n(2689),a=n(2493),i=n(4864);function l(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(2463),c=n(3506);function u(e){let{title:t,description:n,keywords:o,image:i,children:l}=e;const u=function(e){const{siteConfig:t}=(0,c.Z)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.C)(),f=i?d(i,{absolute:!0}):void 0;return r.createElement(a.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),o&&r.createElement("meta",{name:"keywords",content:Array.isArray(o)?o.join(","):o}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),l)}const d=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,o.Z)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(a.Z,null,r.createElement("html",{className:l})),n)}function p(e){let{children:t}=e;const n=l(),a=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(f,{className:(0,o.Z)(a,i)},t)}},3709:(e,t,n)=>{"use strict";n.d(t,{D9:()=>i,Qc:()=>c,Ql:()=>s,i6:()=>l,zX:()=>a});var r=n(3249);const o=n(8498).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function a(e){const t=(0,r.useRef)(e);return o((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return o((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function s(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},1303:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(3249),o=n(5102),a=n(3506);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,a.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function o(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(o).flatMap((e=>e.routes??[])))}(n)}({routes:o.Z,baseUrl:e})),[e])}},5986:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>s,RF:()=>d,o5:()=>f});var r=n(3249),o=n(8498),a=n(3072),i=n(3709);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const u=()=>o.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),o=(0,r.useRef)(u()),a=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();a(e,o.current),o.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[a,n,...t])}function f(){const e=c(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),o=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,r.useLayoutEffect)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:o}}function p(){const e=(0,r.useRef)(null),t=(0,a.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const o=document.documentElement.scrollTop;(n&&o>e||!n&&ot&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},4917:(e,t,n)=>{"use strict";n.d(t,{HX:()=>r,os:()=>o});n(3506);const r="default";function o(e,t){return`docs-${e}-${t}`}},3312:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>d,WA:()=>u});var r=n(3249),o=n(4087);const a="localStorage";function i(e){let{key:t,oldValue:n,newValue:r,storage:o}=e;if(n===r)return;const a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}function l(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,s||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),s=!0),null}var t}let s=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=l(t?.persistence);return null===n?c:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),i({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),i({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),a=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,o.useSyncExternalStore)(a,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},4789:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(3506),o=n(6659),a=n(6011);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.Z)(),{pathname:s}=(0,o.TH)(),c=(0,a.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),u=l===i?e:e.replace(`/${l}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},4850:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(3249),o=n(6659),a=n(3709);function i(e){const t=(0,o.TH)(),n=(0,a.D9)(t),i=(0,a.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},3046:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(3506);function o(){return(0,r.Z)().siteConfig.themeConfig}},4463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[o]=e.split(/[#?]/),a="/"===o||o===r?o:(i=o,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(o,a)}},7757:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},5042:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var o=n(4463);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(o).default}});var a=n(7757);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return a.getErrorCausalChain}})},2528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[o]=e.split(/[#?]/),a="/"===o||o===r?o:(i=o,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(o,a)}},7641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},6011:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var o=n(2528);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(o).default}});var a=n(7641);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return a.getErrorCausalChain}})},638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5942),o=r.__importDefault(n(6809)),a=r.__importDefault(n(5271)),{themeConfig:i}=o.default;function l(e){var t,n;return document.querySelector('html[data-theme="dark"]')?(null===(t=e.background)||void 0===t?void 0:t.dark)||"rgb(50, 50, 50)":(null===(n=e.background)||void 0===n?void 0:n.light)||"rgb(255, 255, 255)"}t.default=function(){if("undefined"==typeof window)return null;let e;const{zoom:t}=i,{selector:n=".markdown img",config:r={}}=t||{};if(!t)return null;r.background=l(t);var o=new MutationObserver((function(){e&&e.update({background:l(t)})}));const s=document.querySelector("html");return o.observe(s,{attributes:!0,attributeFilter:["data-theme"]}),setTimeout((()=>{e&&e.detach(),e=(0,a.default)(n,r)}),1e3),{onRouteUpdate(){setTimeout((()=>{e&&e.detach(),e=(0,a.default)(n,r)}),1e3)}}}()},5102:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(3249),o=n(7396),a=n(2169),i=n.n(a),l=n(6887);const s={"03f59d18":[()=>n.e(6955).then(n.bind(n,2565)),"@site/docs/user-guide/features/data-studio.md",2565],"05893210":[()=>n.e(8798).then(n.bind(n,8658)),"@site/docs/tutorial/07-loops.md",8658],"12f5fcad":[()=>Promise.all([n.e(532),n.e(6828)]).then(n.bind(n,6285)),"@site/docs/node-reference/assemble-prompt.mdx",6285],"14e11cc2":[()=>Promise.all([n.e(532),n.e(4656)]).then(n.bind(n,8067)),"@site/docs/node-reference/external-call.mdx",8067],"170a3935":[()=>n.e(8167).then(n.bind(n,9937)),"@site/docs/user-guide/executing-ai-chains.md",9937],17896441:[()=>Promise.all([n.e(532),n.e(7918)]).then(n.bind(n,413)),"@theme/DocItem",413],"1817ea38":[()=>n.e(1905).then(n.bind(n,2609)),"@site/docs/user-guide/features/prompt-designer.md",2609],"1b6e407e":[()=>Promise.all([n.e(532),n.e(1695)]).then(n.bind(n,7545)),"@site/docs/node-reference/load-dataset.mdx",7545],"1be78505":[()=>Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,7799)),"@theme/DocPage",7799],"1c33c3df":[()=>n.e(2290).then(n.bind(n,8284)),"@site/docs/api-reference/core/Project.mdx",8284],"1c8789be":[()=>Promise.all([n.e(532),n.e(5494)]).then(n.bind(n,6153)),"@site/docs/node-reference/comment.mdx",6153],"1df93b7f":[()=>Promise.all([n.e(532),n.e(3237)]).then(n.bind(n,5612)),"@site/src/pages/index.tsx",5612],"1f541d16":[()=>Promise.all([n.e(532),n.e(8078)]).then(n.bind(n,791)),"@site/docs/node-reference/context.mdx",791],"2015b416":[()=>Promise.all([n.e(532),n.e(5842)]).then(n.bind(n,4714)),"@site/docs/node-reference/set-global.mdx",4714],"20469b49":[()=>n.e(4422).then(n.bind(n,1886)),"@site/docs/tutorial/08-testing-graphs.md",1886],"20ceafbc":[()=>Promise.all([n.e(532),n.e(6062)]).then(n.bind(n,3170)),"@site/docs/node-reference/passthrough.mdx",3170],"2215b464":[()=>Promise.all([n.e(532),n.e(6032)]).then(n.bind(n,1681)),"@site/docs/node-reference/object.mdx",1681],"28b38b6e":[()=>n.e(133).then(n.bind(n,4074)),"@site/docs/api-reference/node/loadProjectFromFile.mdx",4074],"2f317ae1":[()=>n.e(51).then(n.bind(n,7063)),"@site/docs/tutorial/04-yaml.md",7063],"2fc58f8a":[()=>n.e(6071).then(n.bind(n,1386)),"@site/docs/user-guide/trivet-validation-graphs.md",1386],"3089753f":[()=>n.e(8669).then(n.bind(n,959)),"@site/docs/tutorial/05-subgraphs.md",959],"3109fa04":[()=>Promise.all([n.e(532),n.e(2118)]).then(n.bind(n,4595)),"@site/docs/node-reference/rng.mdx",4595],"363646a7":[()=>Promise.all([n.e(532),n.e(1330)]).then(n.bind(n,596)),"@site/docs/node-reference/gpt-function.mdx",596],"37aab7a1":[()=>Promise.all([n.e(532),n.e(6530)]).then(n.bind(n,6109)),"@site/docs/node-reference/loop-controller.mdx",6109],"3cdfd61d":[()=>n.e(5092).then(n.bind(n,5239)),"@site/docs/node-reference/all-nodes.mdx",5239],"3d25049f":[()=>n.e(3528).then(n.bind(n,741)),"@site/docs/node-reference.md",741],"3e549f20":[()=>n.e(8706).then(n.bind(n,6498)),"@site/docs/user-guide/working-with-graphs.md",6498],"40c61cd8":[()=>n.e(4810).then(n.bind(n,1582)),"@site/docs/api-reference/recording.md",1582],"415655db":[()=>n.e(9751).then(n.bind(n,303)),"@site/docs/api-reference/core/Settings.mdx",303],"4183f1d2":[()=>n.e(8319).then(n.bind(n,4398)),"@site/docs/user-guide/plugins/built-in/anthropic.md",4398],"42734f45":[()=>n.e(412).then(n.bind(n,2733)),"@site/docs/user-guide/subgraphs.md",2733],"433c2729":[()=>Promise.all([n.e(532),n.e(3025)]).then(n.bind(n,9662)),"@site/docs/node-reference/race-inputs.mdx",9662],"4593fdd5":[()=>n.e(2331).then(n.bind(n,9579)),"@site/docs/trivet.md",9579],"4662cf78":[()=>n.e(5741).then(n.bind(n,8596)),"@site/docs/tutorial/00-installing-getting-started.md",8596],"4696d85b":[()=>n.e(6447).then(n.bind(n,8073)),"@site/docs/user-guide/recordings.md",8073],"481e9893":[()=>Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,4430)),"@site/docs/node-reference/audio.mdx",4430],"48e33d57":[()=>Promise.all([n.e(532),n.e(6083)]).then(n.bind(n,3421)),"@site/docs/node-reference/prompt.mdx",3421],"4de0f396":[()=>n.e(2483).then(n.bind(n,1692)),"@site/docs/api-reference/node/LooseDataValue.mdx",1692],"4f1d1e2c":[()=>n.e(5472).then(n.bind(n,9154)),"@site/docs/api-reference/node/createProcessor.mdx",9154],"4f4008be":[()=>Promise.all([n.e(532),n.e(6252)]).then(n.bind(n,2415)),"@site/docs/node-reference/if-else.mdx",2415],"50db6c44":[()=>n.e(1860).then(n.bind(n,5392)),"@site/docs/user-guide/trivet-tutorial.md",5392],"5134fa22":[()=>n.e(3758).then(n.bind(n,2599)),"@site/docs/tutorial/03-matching-conditionals.md",2599],"52dab8a8":[()=>Promise.all([n.e(532),n.e(8896)]).then(n.bind(n,8885)),"@site/docs/node-reference/raise-event.mdx",8885],"530ea7a0":[()=>n.e(459).then(n.bind(n,5001)),"@site/docs/getting-started/setup.md",5001],"533412c1":[()=>n.e(202).then(n.bind(n,6184)),"@site/docs/user-guide/trivet-getting-started.md",6184],"54f44165":[()=>n.e(152).then(n.bind(n,7849)),"@site/docs/getting-started/installation.md",7849],"5616506a":[()=>Promise.all([n.e(532),n.e(5529)]).then(n.bind(n,3256)),"@site/docs/node-reference/slice.mdx",3256],"58e75369":[()=>Promise.all([n.e(532),n.e(814)]).then(n.bind(n,903)),"@site/docs/node-reference/image.mdx",903],"58eb6e39":[()=>Promise.all([n.e(532),n.e(7628)]).then(n.bind(n,7631)),"@site/docs/node-reference/wait-for-event.mdx",7631],"5be6eeed":[()=>n.e(2201).then(n.bind(n,7554)),"@site/docs/user-guide/overview-of-interface.md",7554],"5ddf1108":[()=>Promise.all([n.e(532),n.e(8460)]).then(n.bind(n,8876)),"@site/docs/node-reference/bool.mdx",8876],"5e139446":[()=>n.e(5628).then(n.bind(n,7150)),"@site/docs/tutorial/02-interpolation-more-node-types.md",7150],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"5fd0304e":[()=>Promise.all([n.e(532),n.e(830)]).then(n.bind(n,9678)),"@site/docs/node-reference/extract-yaml.mdx",9678],"60875e34":[()=>n.e(4554).then(n.bind(n,6672)),"@site/docs/tutorial.md",6672],"6682fd99":[()=>n.e(1256).then(n.bind(n,4919)),"@site/docs/user-guide/plugins/built-in/huggingface.md",4919],"67fdae2e":[()=>n.e(3806).then(n.bind(n,6898)),"@site/docs/user-guide/plugins/creating-plugins.md",6898],"6929207c":[()=>Promise.all([n.e(532),n.e(4056)]).then(n.bind(n,1465)),"@site/docs/node-reference/to-json.mdx",1465],"69b97305":[()=>Promise.all([n.e(532),n.e(6403)]).then(n.bind(n,8909)),"@site/docs/node-reference/filter.mdx",8909],"6a925ead":[()=>Promise.all([n.e(532),n.e(4049)]).then(n.bind(n,6411)),"@site/docs/node-reference/number.mdx",6411],"6d65ed57":[()=>Promise.all([n.e(532),n.e(6635)]).then(n.bind(n,3808)),"@site/docs/node-reference/graph-output.mdx",3808],"6db4be41":[()=>n.e(4477).then(n.bind(n,629)),"@site/docs/user-guide/plugins/built-in/autoevals.md",629],"6ef8b9cf":[()=>n.e(2229).then(n.bind(n,4770)),"@site/docs/api-reference/node/runGraph.mdx",4770],"6f4f46aa":[()=>n.e(1478).then(n.bind(n,9428)),"@site/docs/user-guide/adding-connecting-nodes.md",9428],"700b9798":[()=>n.e(5225).then(n.bind(n,2585)),"@site/docs/api-reference/core/NodeGraph.mdx",2585],"72cbe275":[()=>n.e(4008).then(n.bind(n,4684)),"@site/docs/user-guide/splitting.md",4684],"78d5b433":[()=>n.e(8205).then(n.t.bind(n,5745,19)),"/Users/Shared/ironclad/rivet/packages/docs/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],"79dc2faa":[()=>n.e(4333).then(n.bind(n,6313)),"@site/docs/api-reference/node/DebuggerEvents.mdx",6313],"7a41925f":[()=>n.e(8650).then(n.bind(n,7614)),"@site/docs/api-reference/node/overview.mdx",7614],"7b9cf692":[()=>Promise.all([n.e(532),n.e(2525)]).then(n.bind(n,8126)),"@site/docs/node-reference/get-all-datasets.mdx",8126],"7fa4d008":[()=>Promise.all([n.e(532),n.e(4021)]).then(n.bind(n,1795)),"@site/docs/node-reference/subgraph.mdx",1795],"85b0010d":[()=>Promise.all([n.e(532),n.e(4380)]).then(n.bind(n,9704)),"@site/docs/node-reference/code.mdx",9704],"863dcfce":[()=>Promise.all([n.e(532),n.e(7594)]).then(n.bind(n,1967)),"@site/docs/node-reference/get-embedding.mdx",1967],"872df9f4":[()=>Promise.all([n.e(532),n.e(1422)]).then(n.bind(n,6579)),"@site/docs/node-reference/array.mdx",6579],"88d215e8":[()=>Promise.all([n.e(532),n.e(58)]).then(n.bind(n,8359)),"@site/docs/node-reference/http-call.mdx",8359],"8c232049":[()=>Promise.all([n.e(532),n.e(6069)]).then(n.bind(n,1070)),"@site/docs/node-reference/vector-knn.mdx",1070],"8d6d9d22":[()=>n.e(6604).then(n.bind(n,4149)),"@site/docs/api-reference/core/DataValue.mdx",4149],"8dd4158d":[()=>n.e(3577).then(n.bind(n,1357)),"@site/docs/user-guide/plugins/built-in/all.md",1357],"91facf36":[()=>n.e(321).then(n.bind(n,499)),"@site/docs/tutorial/06-splitting.md",499],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"95fece5a":[()=>n.e(7991).then(n.bind(n,6148)),"@site/docs/user-guide/features/trivet-tests.md",6148],"964ae018":[()=>n.e(8491).then(n.bind(n,8189)),"@site/docs/api-reference.md",8189],"98eb9da5":[()=>n.e(7705).then(n.bind(n,4151)),"@site/docs/user-guide/plugins/built-in/assemblyai.md",4151],"9b78301a":[()=>Promise.all([n.e(532),n.e(3456)]).then(n.bind(n,8466)),"@site/docs/node-reference/read-directory.mdx",8466],"9d910af5":[()=>Promise.all([n.e(532),n.e(2147)]).then(n.bind(n,3483)),"@site/docs/node-reference/trim-chat-messages.mdx",3483],a09c2993:[()=>n.e(4128).then(n.bind(n,4003)),"@site/docs/introduction.md",4003],a21a37d7:[()=>Promise.all([n.e(532),n.e(7243)]).then(n.bind(n,9494)),"@site/docs/node-reference/coalesce.mdx",9494],a362e43a:[()=>Promise.all([n.e(532),n.e(9721)]).then(n.bind(n,4997)),"@site/docs/node-reference/create-dataset.mdx",4997],a6819d35:[()=>n.e(4479).then(n.bind(n,2633)),"@site/docs/user-guide/features/chat-viewer.md",2633],a6838e53:[()=>Promise.all([n.e(532),n.e(3887)]).then(n.bind(n,4109)),"@site/docs/node-reference/user-input.mdx",4109],a7f4a72c:[()=>Promise.all([n.e(532),n.e(4170)]).then(n.bind(n,4929)),"@site/docs/node-reference/shuffle.mdx",4929],a813a620:[()=>Promise.all([n.e(532),n.e(5179)]).then(n.bind(n,1847)),"@site/docs/node-reference/if.mdx",1847],a89c46e1:[()=>n.e(7241).then(n.bind(n,5243)),"@site/docs/user-guide/control-flow.md",5243],aa600924:[()=>n.e(4368).then(n.bind(n,6897)),"@site/docs/tutorial/01-simple-graph.md",6897],ab17d5dc:[()=>n.e(8401).then(n.bind(n,7632)),"@site/docs/api-reference/remote-debugging.md",7632],aca96930:[()=>Promise.all([n.e(532),n.e(5797)]).then(n.bind(n,1272)),"@site/docs/node-reference/pop.mdx",1272],acacfcbf:[()=>Promise.all([n.e(532),n.e(7703)]).then(n.bind(n,3315)),"@site/docs/node-reference/abort-graph.mdx",3315],b2051425:[()=>Promise.all([n.e(532),n.e(336)]).then(n.bind(n,2286)),"@site/docs/node-reference/chat.mdx",2286],b48e6d03:[()=>n.e(2495).then(n.bind(n,6726)),"@site/docs/user-guide/prompt-designer.md",6726],b4f0f202:[()=>Promise.all([n.e(532),n.e(1415)]).then(n.bind(n,8969)),"@site/docs/node-reference/extract-object-path.mdx",8969],b6afd583:[()=>Promise.all([n.e(532),n.e(754)]).then(n.bind(n,1232)),"@site/docs/node-reference/hash.mdx",1232],b94eb337:[()=>Promise.all([n.e(532),n.e(2690)]).then(n.bind(n,5903)),"@site/docs/node-reference/chunk.mdx",5903],ba6db9dc:[()=>Promise.all([n.e(532),n.e(7501)]).then(n.bind(n,6991)),"@site/docs/node-reference/extract-with-regex.mdx",6991],bcfb61bc:[()=>Promise.all([n.e(532),n.e(4651)]).then(n.bind(n,1040)),"@site/docs/node-reference/knn-dataset.mdx",1040],bff5d10d:[()=>n.e(7987).then(n.bind(n,3819)),"@site/docs/api-reference/core/GraphProcessor.md",3819],c1d447ec:[()=>Promise.all([n.e(532),n.e(3294)]).then(n.bind(n,1389)),"@site/docs/node-reference/read-file.mdx",1389],c3b8082c:[()=>Promise.all([n.e(532),n.e(5913)]).then(n.bind(n,8804)),"@site/docs/node-reference/join.mdx",8804],c7de5a81:[()=>Promise.all([n.e(532),n.e(7777)]).then(n.bind(n,4922)),"@site/docs/node-reference/vector-store.mdx",4922],ca0ef5dd:[()=>n.e(270).then(n.bind(n,3259)),"@site/docs/user-guide/executors.md",3259],cc838d56:[()=>n.e(8858).then(n.bind(n,9003)),"@site/docs/user-guide/live-debugging.md",9003],ce3bb901:[()=>n.e(6437).then(n.bind(n,4509)),"@site/docs/api-reference/node/loadProjectFromString.mdx",4509],ce6dae4c:[()=>n.e(7047).then(n.bind(n,8771)),"@site/docs/user-guide/loops.md",8771],d003ba4d:[()=>Promise.all([n.e(532),n.e(8245)]).then(n.bind(n,7752)),"@site/docs/node-reference/append-to-dataset.mdx",7752],d4c976d4:[()=>n.e(2743).then(n.bind(n,3728)),"@site/docs/getting-started/first-ai-agent.md",3728],d96d9220:[()=>n.e(1089).then(n.bind(n,2740)),"@site/docs/user-guide/trivet-library.md",2740],d9a4306c:[()=>Promise.all([n.e(532),n.e(1066)]).then(n.bind(n,1530)),"@site/docs/node-reference/extract-markdown-code-blocks.mdx",1530],da1d9a3b:[()=>n.e(8899).then(n.bind(n,3544)),"@site/docs/api-reference/node/RunGraphOptions.mdx",3544],da4d435d:[()=>Promise.all([n.e(532),n.e(1588)]).then(n.bind(n,34)),"@site/docs/node-reference/match.mdx",34],db43bf8f:[()=>n.e(8224).then(n.bind(n,8985)),"@site/docs/user-guide/remote-debugging.md",8985],dc3b85c0:[()=>Promise.all([n.e(532),n.e(5280)]).then(n.bind(n,4838)),"@site/docs/node-reference/evaluate.mdx",4838],dde8420f:[()=>n.e(4748).then(n.bind(n,5159)),"@site/docs/api-reference/node/startDebuggerServer.mdx",5159],df424e68:[()=>Promise.all([n.e(532),n.e(3771)]).then(n.bind(n,8305)),"@site/docs/node-reference/get-global.mdx",8305],e1bbbaad:[()=>Promise.all([n.e(532),n.e(7433)]).then(n.bind(n,9094)),"@site/docs/node-reference/compare.mdx",9094],e250005b:[()=>n.e(3287).then(n.t.bind(n,9822,19)),"/Users/Shared/ironclad/rivet/packages/docs/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",9822],e2d72022:[()=>n.e(881).then(n.bind(n,3448)),"@site/docs/api-reference/node/RivetDebuggerServer.mdx",3448],e44794b9:[()=>Promise.all([n.e(532),n.e(7843)]).then(n.bind(n,1867)),"@site/docs/node-reference/extract-json.mdx",1867],eae5179a:[()=>Promise.all([n.e(532),n.e(3980)]).then(n.bind(n,3434)),"@site/docs/node-reference/get-dataset-row.mdx",3434],ec8a29ae:[()=>Promise.all([n.e(532),n.e(7410)]).then(n.bind(n,1820)),"@site/docs/node-reference/split-text.mdx",1820],f1c10c23:[()=>Promise.all([n.e(532),n.e(3300)]).then(n.bind(n,4071)),"@site/docs/node-reference/text.mdx",4071],f2480b45:[()=>Promise.all([n.e(532),n.e(5653)]).then(n.bind(n,4188)),"@site/docs/node-reference/delay.mdx",4188],f5262abe:[()=>n.e(7915).then(n.bind(n,1673)),"@site/docs/api-reference/node/runGraphInFile.mdx",1673],f5c7df53:[()=>n.e(3888).then(n.bind(n,3557)),"@site/docs/user-guide/working-with-projects.md",3557],f78d6e65:[()=>Promise.all([n.e(532),n.e(2542)]).then(n.bind(n,938)),"@site/docs/node-reference/to-yaml.mdx",938],f7d5c2fe:[()=>Promise.all([n.e(532),n.e(774)]).then(n.bind(n,5885)),"@site/src/pages/social-card.tsx",5885],f7f13176:[()=>n.e(4363).then(n.bind(n,9191)),"@site/docs/user-guide/plugins.md",9191],f8728646:[()=>Promise.all([n.e(532),n.e(2617)]).then(n.bind(n,5954)),"@site/docs/node-reference/graph-input.mdx",5954],f88f89ea:[()=>n.e(7638).then(n.bind(n,4076)),"@site/docs/user-guide/data-types.md",4076],f891ad32:[()=>Promise.all([n.e(532),n.e(4823)]).then(n.bind(n,400)),"@site/docs/api-reference/getting-started-integration.mdx",400],f9960f4d:[()=>n.e(1747).then(n.bind(n,1074)),"@site/docs/api-reference/core/overview.mdx",1074],f99e2ae4:[()=>Promise.all([n.e(532),n.e(5799)]).then(n.bind(n,2533)),"@site/src/pages/logo-banner.tsx",2533],f9a8793e:[()=>n.e(5856).then(n.bind(n,6393)),"@site/docs/user-guide/plugins/built-in/pinecone.md",6393],fc83dfb0:[()=>n.e(6503).then(n.bind(n,7123)),"@site/docs/user-guide/plugins/built-in/gentrace.md",7123]};function c(e){let{error:t,retry:n,pastDelay:o}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):o?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(4785),d=n(4864);function f(e,t){if("*"===e)return i()({loading:c,loader:()=>n.e(2389).then(n.bind(n,2389)),modules:["@theme/NotFound"],webpack:()=>[2389],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const a=l[`${e}-${t}`],f={},p=[],m=[],g=(0,u.Z)(a);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:c,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(a));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let a=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{a=a[e]})),a[l[l.length-1]]=o}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,o.Z)({},i,n)))}})}const p=[{path:"/logo-banner",component:f("/logo-banner","fe2"),exact:!0},{path:"/social-card",component:f("/social-card","044"),exact:!0},{path:"/docs",component:f("/docs","904"),routes:[{path:"/docs",component:f("/docs","c64"),exact:!0,sidebar:"userGuide"},{path:"/docs/api-reference",component:f("/docs/api-reference","965"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/DataValue",component:f("/docs/api-reference/core/DataValue","97d"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/GraphProcessor",component:f("/docs/api-reference/core/GraphProcessor","14b"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/NodeGraph",component:f("/docs/api-reference/core/NodeGraph","d6a"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/overview",component:f("/docs/api-reference/core/overview","602"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/Project",component:f("/docs/api-reference/core/Project","424"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/core/Settings",component:f("/docs/api-reference/core/Settings","066"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/getting-started-integration",component:f("/docs/api-reference/getting-started-integration","cdc"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/createProcessor",component:f("/docs/api-reference/node/createProcessor","28b"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/DebuggerEvents",component:f("/docs/api-reference/node/DebuggerEvents","8f9"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/loadProjectFromFile",component:f("/docs/api-reference/node/loadProjectFromFile","abb"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/loadProjectFromString",component:f("/docs/api-reference/node/loadProjectFromString","e94"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/LooseDataValue",component:f("/docs/api-reference/node/LooseDataValue","cc7"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/overview",component:f("/docs/api-reference/node/overview","718"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/RivetDebuggerServer",component:f("/docs/api-reference/node/RivetDebuggerServer","812"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/runGraph",component:f("/docs/api-reference/node/runGraph","dfe"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/runGraphInFile",component:f("/docs/api-reference/node/runGraphInFile","cbd"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/RunGraphOptions",component:f("/docs/api-reference/node/RunGraphOptions","33d"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/node/startDebuggerServer",component:f("/docs/api-reference/node/startDebuggerServer","b0d"),exact:!0,sidebar:"apiReference"},{path:"/docs/api-reference/recording",component:f("/docs/api-reference/recording","528"),exact:!0},{path:"/docs/api-reference/remote-debugging",component:f("/docs/api-reference/remote-debugging","78e"),exact:!0,sidebar:"apiReference"},{path:"/docs/getting-started/first-ai-agent",component:f("/docs/getting-started/first-ai-agent","569"),exact:!0,sidebar:"userGuide"},{path:"/docs/getting-started/installation",component:f("/docs/getting-started/installation","ac6"),exact:!0,sidebar:"userGuide"},{path:"/docs/getting-started/setup",component:f("/docs/getting-started/setup","b83"),exact:!0,sidebar:"userGuide"},{path:"/docs/node-reference",component:f("/docs/node-reference","c46"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/abort-graph",component:f("/docs/node-reference/abort-graph","94f"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/all-nodes",component:f("/docs/node-reference/all-nodes","b65"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/append-to-dataset",component:f("/docs/node-reference/append-to-dataset","636"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/array",component:f("/docs/node-reference/array","198"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/assemble-prompt",component:f("/docs/node-reference/assemble-prompt","7f0"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/audio",component:f("/docs/node-reference/audio","544"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/bool",component:f("/docs/node-reference/bool","340"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/chat",component:f("/docs/node-reference/chat","ea2"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/chunk",component:f("/docs/node-reference/chunk","686"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/coalesce",component:f("/docs/node-reference/coalesce","a2e"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/code",component:f("/docs/node-reference/code","c2d"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/comment",component:f("/docs/node-reference/comment","60c"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/compare",component:f("/docs/node-reference/compare","1a3"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/context",component:f("/docs/node-reference/context","b3b"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/create-dataset",component:f("/docs/node-reference/create-dataset","77d"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/delay",component:f("/docs/node-reference/delay","998"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/evaluate",component:f("/docs/node-reference/evaluate","565"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/external-call",component:f("/docs/node-reference/external-call","95b"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/extract-json",component:f("/docs/node-reference/extract-json","dcd"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/extract-markdown-code-blocks",component:f("/docs/node-reference/extract-markdown-code-blocks","8d8"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/extract-object-path",component:f("/docs/node-reference/extract-object-path","780"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/extract-with-regex",component:f("/docs/node-reference/extract-with-regex","664"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/extract-yaml",component:f("/docs/node-reference/extract-yaml","651"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/filter",component:f("/docs/node-reference/filter","edf"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/get-all-datasets",component:f("/docs/node-reference/get-all-datasets","a15"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/get-dataset-row",component:f("/docs/node-reference/get-dataset-row","bae"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/get-embedding",component:f("/docs/node-reference/get-embedding","056"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/get-global",component:f("/docs/node-reference/get-global","8d7"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/gpt-function",component:f("/docs/node-reference/gpt-function","098"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/graph-input",component:f("/docs/node-reference/graph-input","44f"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/graph-output",component:f("/docs/node-reference/graph-output","e88"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/hash",component:f("/docs/node-reference/hash","e72"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/http-call",component:f("/docs/node-reference/http-call","e03"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/if",component:f("/docs/node-reference/if","989"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/if-else",component:f("/docs/node-reference/if-else","94b"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/image",component:f("/docs/node-reference/image","ddf"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/join",component:f("/docs/node-reference/join","405"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/knn-dataset",component:f("/docs/node-reference/knn-dataset","5e2"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/load-dataset",component:f("/docs/node-reference/load-dataset","1dc"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/loop-controller",component:f("/docs/node-reference/loop-controller","4ea"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/match",component:f("/docs/node-reference/match","5ab"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/number",component:f("/docs/node-reference/number","453"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/object",component:f("/docs/node-reference/object","04d"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/passthrough",component:f("/docs/node-reference/passthrough","d0a"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/pop",component:f("/docs/node-reference/pop","2e4"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/prompt",component:f("/docs/node-reference/prompt","e21"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/race-inputs",component:f("/docs/node-reference/race-inputs","661"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/raise-event",component:f("/docs/node-reference/raise-event","c8e"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/read-directory",component:f("/docs/node-reference/read-directory","b52"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/read-file",component:f("/docs/node-reference/read-file","af5"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/RNG",component:f("/docs/node-reference/RNG","3f7"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/set-global",component:f("/docs/node-reference/set-global","bf2"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/shuffle",component:f("/docs/node-reference/shuffle","6d8"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/slice",component:f("/docs/node-reference/slice","a04"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/split-text",component:f("/docs/node-reference/split-text","ba8"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/subgraph",component:f("/docs/node-reference/subgraph","8bb"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/text",component:f("/docs/node-reference/text","ca8"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/to-json",component:f("/docs/node-reference/to-json","68e"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/to-yaml",component:f("/docs/node-reference/to-yaml","758"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/trim-chat-messages",component:f("/docs/node-reference/trim-chat-messages","2a3"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/user-input",component:f("/docs/node-reference/user-input","a86"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/vector-knn",component:f("/docs/node-reference/vector-knn","ebc"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/vector-store",component:f("/docs/node-reference/vector-store","2ac"),exact:!0,sidebar:"nodeReference"},{path:"/docs/node-reference/wait-for-event",component:f("/docs/node-reference/wait-for-event","443"),exact:!0,sidebar:"nodeReference"},{path:"/docs/trivet",component:f("/docs/trivet","ef4"),exact:!0,sidebar:"userGuide"},{path:"/docs/tutorial",component:f("/docs/tutorial","f9f"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/installing-getting-started",component:f("/docs/tutorial/installing-getting-started","f4e"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/interpolation-more-node-types",component:f("/docs/tutorial/interpolation-more-node-types","2da"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/loops",component:f("/docs/tutorial/loops","6b0"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/matching-conditionals",component:f("/docs/tutorial/matching-conditionals","d82"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/simple-graph",component:f("/docs/tutorial/simple-graph","894"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/splitting",component:f("/docs/tutorial/splitting","264"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/subgraphs",component:f("/docs/tutorial/subgraphs","35e"),exact:!0,sidebar:"tutorial"},{path:"/docs/tutorial/testing-graphs",component:f("/docs/tutorial/testing-graphs","7d3"),exact:!0},{path:"/docs/tutorial/yaml",component:f("/docs/tutorial/yaml","6e6"),exact:!0,sidebar:"tutorial"},{path:"/docs/user-guide/adding-connecting-nodes",component:f("/docs/user-guide/adding-connecting-nodes","852"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/control-flow",component:f("/docs/user-guide/control-flow","5b8"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/data-types",component:f("/docs/user-guide/data-types","e1d"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/executing-ai-chains",component:f("/docs/user-guide/executing-ai-chains","add"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/executors",component:f("/docs/user-guide/executors","acb"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/features/chat-viewer",component:f("/docs/user-guide/features/chat-viewer","55d"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/features/data-studio",component:f("/docs/user-guide/features/data-studio","77c"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/features/prompt-designer",component:f("/docs/user-guide/features/prompt-designer","eb2"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/features/trivet-tests",component:f("/docs/user-guide/features/trivet-tests","b24"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/live-debugging",component:f("/docs/user-guide/live-debugging","958"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/loops",component:f("/docs/user-guide/loops","4fb"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/overview-of-interface",component:f("/docs/user-guide/overview-of-interface","e25"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins",component:f("/docs/user-guide/plugins","418"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/all",component:f("/docs/user-guide/plugins/built-in/all","973"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/anthropic",component:f("/docs/user-guide/plugins/built-in/anthropic","d33"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/assemblyai",component:f("/docs/user-guide/plugins/built-in/assemblyai","620"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/autoevals",component:f("/docs/user-guide/plugins/built-in/autoevals","34c"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/gentrace",component:f("/docs/user-guide/plugins/built-in/gentrace","b20"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/huggingface",component:f("/docs/user-guide/plugins/built-in/huggingface","11b"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/built-in/pinecone",component:f("/docs/user-guide/plugins/built-in/pinecone","bfd"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/plugins/creating-plugins",component:f("/docs/user-guide/plugins/creating-plugins","553"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/prompt-designer",component:f("/docs/user-guide/prompt-designer","119"),exact:!0},{path:"/docs/user-guide/recordings",component:f("/docs/user-guide/recordings","6cc"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/remote-debugging",component:f("/docs/user-guide/remote-debugging","22a"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/splitting",component:f("/docs/user-guide/splitting","220"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/subgraphs",component:f("/docs/user-guide/subgraphs","4ad"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/trivet-getting-started",component:f("/docs/user-guide/trivet-getting-started","c6a"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/trivet-library",component:f("/docs/user-guide/trivet-library","d37"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/trivet-tutorial",component:f("/docs/user-guide/trivet-tutorial","ed9"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/trivet-validation-graphs",component:f("/docs/user-guide/trivet-validation-graphs","5c0"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/working-with-graphs",component:f("/docs/user-guide/working-with-graphs","660"),exact:!0,sidebar:"userGuide"},{path:"/docs/user-guide/working-with-projects",component:f("/docs/user-guide/working-with-projects","59b"),exact:!0,sidebar:"userGuide"}]},{path:"/",component:f("/","5bf"),exact:!0},{path:"*",component:f("*")}]},1505:(e,t,n)=>{"use strict";n.r(t)},821:(e,t,n)=>{"use strict";n.r(t)},7421:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);S+=E.value.length,E=E.next){var x=E.value;if(t.length>e.length)return;if(!(x instanceof o)){var _,C=1;if(v){if(!(_=a(k,S,e,b))||_.index>=e.length)break;var T=_.index,R=_.index+_[0].length,P=S;for(P+=E.value.length;T>=P;)P+=(E=E.next).value.length;if(S=P-=E.value.length,E.value instanceof o)continue;for(var L=E;L!==t.tail&&(Pd.reach&&(d.reach=D);var I=E.prev;if(N&&(I=s(t,I,N),S+=N.length),c(t,I,C),E=s(t,I,new o(f,h?r.tokenize(A,h):A,y,A)),O&&s(t,E,O),C>1){var M={cause:f+","+m,reach:D};i(e,t,n,E.prev,S,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o"+a.content+""},r}(),o=r;r.default=r,o.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},o.languages.markup.tag.inside["attr-value"].inside.entity=o.languages.markup.entity,o.languages.markup.doctype.inside["internal-subset"].inside=o.languages.markup,o.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(o.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:o.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:o.languages[t]};var a={};a[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},o.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(o.languages.markup.tag,"addAttribute",{value:function(e,t){o.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:o.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),o.languages.html=o.languages.markup,o.languages.mathml=o.languages.markup,o.languages.svg=o.languages.markup,o.languages.xml=o.languages.extend("markup",{}),o.languages.ssml=o.languages.xml,o.languages.atom=o.languages.xml,o.languages.rss=o.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,i=0;i]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},o.languages.c=o.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),o.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),o.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},o.languages.c.string],char:o.languages.c.char,comment:o.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:o.languages.c}}}}),o.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete o.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(o),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(o),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},o={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:o,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:o})}(o),o.languages.javascript=o.languages.extend("clike",{"class-name":[o.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),o.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,o.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:o.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:o.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:o.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:o.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:o.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),o.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:o.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),o.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),o.languages.markup&&(o.languages.markup.tag.addInlined("script","javascript"),o.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),o.languages.js=o.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(o),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+o+"|"+a+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(a),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(o),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(o),o.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:o.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},o.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function c(t){var n={};n["interpolation-punctuation"]=o;var a=e.tokenize(t,n);if(3===a.length){var i=[1,1];i.push.apply(i,s(a[1],e.languages.javascript,"javascript")),a.splice.apply(a,i)}return new e.Token("interpolation",a,r.alias,t)}function u(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),i=0,u={},d=s(o.map((function(e){if("string"==typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=o,n})).join(""),n,r),f=Object.keys(u);return i=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var o=f[i],a="string"==typeof r?r:r.content,l=a.indexOf(o);if(-1!==l){++i;var s=a.substring(0,l),d=c(u[o]),p=a.substring(l+o.length),m=[];if(s&&m.push(s),m.push(d),p){var g=[p];e(g),m.push.apply(m,g)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var h=r.content;Array.isArray(h)?e(h):e([h])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(o),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function a(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return o})),RegExp(e,t)}o=a(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===i(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:i(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:a=!0),(a||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(o);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}o.content&&"string"!=typeof o.content&&l(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(o),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(o),o.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},o.languages.go=o.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),o.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete o.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,l=i.length;-1!==n.code.indexOf(o=t(r,l));)++l;return i[l]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=a.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++o;var g=f.substring(0,m),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),v=[];g&&v.push.apply(v,i([g])),v.push(h),b&&v.push.apply(v,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(o),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(o),o.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},o.languages.webmanifest=o.languages.json,o.languages.less=o.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),o.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),o.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},o.languages.objectivec=o.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete o.languages.objectivec["class-name"],o.languages.objc=o.languages.objectivec,o.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},o.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},o.languages.python["string-interpolation"].inside.interpolation.inside.rest=o.languages.python,o.languages.py=o.languages.python,o.languages.reason=o.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),o.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete o.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(o),o.languages.scss=o.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),o.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),o.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),o.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),o.languages.scss.atrule.inside.rest=o.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(o),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(o),o.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const a=o},8639:(e,t,n)=>{"use strict";var r=n(3249),o=n(4096);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n