import{b as r,i}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as E}from"./machine.-BRuqPpdF.js";import{h as p,a as n,c as s}from"./commonut-Cw694c5t.js";import{f as m}from"./machineh-DqJ7QH-i.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const N=r(({helpers:a})=>({states:{components:[s(a),{componentName:a.componentName.select,helperText:e("Choose the gemini model to use here."),id:"model-id",label:e("Model"),onChange:"SELECT_MODEL",onRefetch:"REFETCH_MODEL",optionFilterProp:"label",options:[],path:"model",placeholder:e("Select a Model"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{addItemButtonLabel:"Add Message",componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Role"),name:"role",options:[{label:e("User"),value:"user"},{label:e("Model"),value:"model"}],showSearch:!0,style:{width:120},value:""},{componentName:a.componentName.mixInput,label:e("Message"),name:"value",value:[],wrapperClassName:"w-100"}],id:"message-field-properties",label:e("Messages"),onChange:"SET_MESSAGE_FIELD",path:"messageFieldProperties",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.switch,fieldType:"config",id:"show-advance-feature",label:e("Show Advance Feature"),onChange:"SET_FEATURE",render:"IF_CONNECTION_SELECTED",value:!1},{componentName:a.componentName.mixInput,helperText:e("Enter the The maximum number of tokens to include in an output. Default is 1024."),id:"max-token",label:e("Max Token"),onChange:"SET_MAX_TOKEN",path:"max_token",placeholder:e("Enter the token value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e(" Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. "),id:"temperature-val",path:"temperature",label:e("Temperatures"),onChange:"SET_TEMPERATURE",placeholder:e("Enter temperature value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("The maximum cumulative probability of tokens to consider when sampling. Enter the sampling value between 0.0 to 1.0"),id:"topP-val",path:"topP",label:e("topP Sampling Value"),onChange:"SET_TOP_P",placeholder:e("Enter topP value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("The maximum number of tokens to consider when sampling. Enter the sampling value between 1 to 100"),id:"topK-val",path:"topK",label:e("topK Sampling Value"),onChange:"SET_TOP_K",placeholder:e("Enter topK value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:a.componentName.mixInput,helperText:e("The set of character sequence that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence."),path:"stop_sequence",id:"stop-sequence",label:e("Stop Sequence"),onChange:"SET_STOP_SEQUENCE",placeholder:e("Enter stop sequences"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0}]},actions:{IF_ADVANCE_FEATURE_SELECTED:({$:o})=>o.getComponent("show-advance-feature")?.value===!0,IF_CONNECTION_SELECTED:({$:o})=>i(o.getComponent("connection-id")?.value),ON_MACHINE_LOAD:async({$:o})=>{E(o,[{db:"connectionId",id:"connection-id"},{db:"modelId",id:"model-id"},{db:"maxToken",id:"max-token"},{db:"temperatureVal",id:"temperature-val"},{db:"topPVal",id:"topP-val"},{db:"topKVal",id:"topK-val"},{db:"messageFieldProperties",id:"message-field-properties"},{db:"showAdvanceFeature",id:"show-advance-feature"},{db:"stopSequence",id:"stop-sequence"}]),await m(o)},REFETCH_MODEL:async({$:o})=>{await m(o)},SELECT_MODEL:n("modelId"),SET_MAX_TOKEN:n("maxToken"),SET_MESSAGE_FIELD:n("messageFieldProperties"),SET_STOP_SEQUENCE:n("stopSequence"),SET_TEMPERATURE:n("temperatureVal"),SET_TOP_K:n("topKVal"),SET_TOP_P:n("topPVal"),SET_CONNECTION:async({$:o,e:l})=>{o.setThisComponent(t=>{t.value=l}),o.setDb(t=>{t.connectionId=l}),await m(o)},SET_FEATURE:async({$:o,e:l})=>{o.setThisComponent(t=>{t.value=l}),o.setDb(t=>{t.showAdvanceFeature=l})},CONNECTION_ADD_CHANGE:p}}));export{N as default};
