import{f as m,j as o,e as a,I as i,F as x}from"./main-few-lands-burn.js";import{a as A}from"./useflows-BpG3C9m1.js";import{M as n}from"./mixinput-CX5xeb4d.js";import{S as l}from"./select-D5cwRnoD.js";import{T as c}from"./textarea-CmCz4s17.js";import{c as S}from"./mutative-C6xjlr6O.js";import{A as d}from"./appheade-BErcWjPn.js";import{M as b}from"./index-DLjoOpJs.js";import{T as y}from"./index-ubWv-fhI.js";import"./lodash-YpNkAOPN.js";import"./index-Budcgb8A.js";import"./index-CyNIBchZ.js";import"./usedebou-9GKFiQAC.js";import"./utilscss-IoKwGUy7.js";import"./tabpanel-DvU0ks7q.js";import"./index-BcDJZYeX.js";import"./index-CB2KTxNj.js";import"./useclosa-m-cf8k_D.js";import"./context-Ba3TiTex.js";import"./index-DAhFlZRY.js";import"./index-28_Ul1Wv.js";import"./usebreak-DJkppNCB.js";import"./index-CTlEl9RP.js";import"./index-Cj8-kItB.js";import"./index-wzUEm29P.js";import"./isobject-D8hieKPs.js";import"./index-Vx_YZd5N.js";import"./index-XyHDR-91.js";import"./index-btcdg7gz.js";import"./flowstat-BxuW8LT8.js";import"./useflows-BbAh-zeS.js";import"./import-Cn4VUyaV.js";import"./paginati-DuhDnQhP.js";import"./index-DkD03DCM.js";const v=`{
	"type": "object",
	"properties": {
		"name": {
			"type": "string"
		},
		"hobbies": {
			"type": "array",
			"items": {
				"type": "string"
			}
		}
	}
}`,j=`{
	"name": "John Doe",
	"hobbies": ["reading", "traveling", "playing"]
}`,h=[{type:"string",value:"10"}];function se({nodeId:p}){const[t,u]=A(p),s=(e,g)=>{u(f=>S(f,r=>{r.states||(r.states={components:[]}),r.states?.aiAgent||(r.states.aiAgent={maxIterations:h,prompt:[],promptSource:"prompt",responseFormat:"text",systemPrompt:[]}),e==="responseFormat"&&delete r.states.aiAgent.responseJsonSchema,r.states.aiAgent[e]=g}))};return m(x,{children:[o(d,{nodeId:p}),o(l,{defaultValue:"prompt",label:"Source for Prompt",onChange:e=>s("promptSource",e),options:[{label:a("Define Prompt"),value:"prompt"}],placeholder:"Source for Prompt",style:{width:"100%"},value:t?.states?.aiAgent?.promptSource||"prompt"}),(!t?.states?.aiAgent?.promptSource||t?.states?.aiAgent?.promptSource==="prompt")&&o(n,{className:"!min-h-14",helperText:a("Enter the main instruction or question you want your AI Agent to use for generating responses. You can use variables from previous steps or conversation."),label:"Prompt",onChange:e=>s("prompt",e),value:t?.states?.aiAgent?.prompt}),o(n,{className:"!min-h-20",helperText:a("Provides additional rules, context, or background information for the AI Agent. For example, use this field to specify the agent’s role, style, or important restrictions."),label:"System Prompt",onChange:e=>s("systemPrompt",e),value:t?.states?.aiAgent?.systemPrompt}),o(n,{label:"Max Iterations",onChange:e=>s("maxIterations",e),placeholder:"10",value:t?.states?.aiAgent?.maxIterations||h}),o(l,{defaultValue:"text",helperText:a("Specifies the format of the AI response."),label:"Response Format",onChange:e=>s("responseFormat",e),options:[{label:a("Text"),value:"text"},{label:a("JSON Object"),value:"json_object"},{label:a("Generate From JSON Example"),value:"json_example"},{label:a("Define using JSON Schema"),value:"json_schema"}],placeholder:"Select Response Format",style:{width:"100%"},value:t?.states?.aiAgent?.responseFormat||"text"}),o(i,{conditions:t?.states?.aiAgent?.responseFormat==="json_example",children:o(c,{defaultValue:j,helperText:a("Generate a schema from example JSON object"),label:"JSON Example",onChange:e=>s("responseJsonSchema",e.target.value),rows:6,value:t?.states?.aiAgent?.responseJsonSchema})}),m(i,{conditions:t?.states?.aiAgent?.responseFormat==="json_schema",children:[o(c,{defaultValue:v,label:"JSON Schema",onChange:e=>s("responseJsonSchema",e.target.value),rows:10,value:t?.states?.aiAgent?.responseJsonSchema}),o(y.Text,{type:"secondary",children:o(b,{className:"[&_a]:text-orange-500 [&_p]:text-sm",children:a("Define [Json Schema](https://json-schema.org/learn/miscellaneous-examples#basic) manually.")})})]})]})}export{se as default};
