import{aa as m,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{s as r}from"./machine.-tangy-colts-beg-869.js";import{h as i,c as E}from"./commonut-tangy-colts-beg-30.js";import{f as s}from"./machineh-tangy-colts-beg-366.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const u=m(({helpers:n})=>({states:{components:[E(n),{componentName:n.componentName.select,helperText:o("Choose the deepseek model to use here. E.g. Deepseek Chat."),id:"model-id",label:o("Model"),onChange:"SELECT_MODEL",onRefetch:"REFETCH_MODEL",optionFilterProp:"label",options:[],path:"model",placeholder:o("Select a Model"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{componentName:n.componentName.mixInput,helperText:o("Enter the maximum number of tokens that can be generated in the chat completion here. E.g. 2048."),id:"max-tokens",label:o("Max Tokens"),onChange:"HANDLE_MAX_TOKEN",path:"max_tokens",placeholder:o("Enter the token value"),render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:n.componentName.mixInput,helperText:o("Enter the temperature <= 2 here. E.g. 1."),id:"temperature-val",label:o("Temperatures"),onChange:"HANDLE_TEMPERATURE",path:"temperature",placeholder:o("Enter temperature value"),render:"IF_CONNECTION_SELECTED",value:void 0},{addItemButtonLabel:"Add Message",componentName:n.componentName.repeaterField,fieldsMetaData:[{componentName:n.componentName.select,label:o("Role"),name:"role",options:[{label:o("User"),value:"user"},{label:o("Assistant"),value:"assistant"},{label:o("System"),value:"system"}],showSearch:!0,style:{width:120},value:""},{componentName:n.componentName.mixInput,label:o("Message"),name:"content",value:[],wrapperClassName:"w-100"}],id:"message-field-properties",label:o("Messages"),onChange:"ON_CHANGE_MESSAGE_FIELD",path:"messageFieldProperties",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var a;return l((a=e.getComponent("connection-id"))==null?void 0:a.value)},ON_CHANGE_MESSAGE_FIELD:({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.messageFieldProperties=a})},ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"},{db:"modelId",id:"model-id"},{db:"maxTokens",id:"max-tokens"},{db:"temperatureVal",id:"temperature-val"},{db:"messageFieldProperties",id:"message-field-properties"}]),await s(e)},REFETCH_MODEL:async({$:e})=>{await s(e)},SELECT_MODEL:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.modelId=a})},HANDLE_MAX_TOKEN:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.maxTokens=a})},HANDLE_TEMPERATURE:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.temperatureVal=a})},SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.connectionId=a}),await s(e)},CONNECTION_ADD_CHANGE:i}}));export{u as default};
