import{aa as r,ab as E}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{s as i}from"./machine.-tangy-colts-beg-869.js";import{h as p,a as s,c as m,f as l}from"./machineh-tangy-colts-beg-255.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,t){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,t),t)}};const T=r(({helpers:o})=>({states:{components:[m(o),{componentName:o.componentName.select,helperText:e("Choose the claude model to use here."),id:"model",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},{componentName:o.componentName.mixInput,helperText:e("Write the message"),id:"message",label:e("Message"),onChange:"SELECT_MESSAGE",path:"message",placeholder:e("Enter message"),render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:o.componentName.switch,fieldType:"config",id:"show-advance-feature",label:e("Show Advance Feature"),onChange:"SET_FEATURE",render:"IF_CONNECTION_SELECTED",value:!1},{componentName:o.componentName.mixInput,helperText:e("Enter the maximum token limit, though models may stop before reaching it; varies across models."),id:"max-token",label:e("Max Token"),onChange:"SET_MAX_TOKEN",path:"max_tokens",placeholder:e("Enter the token value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:o.componentName.mixInput,helperText:e("Enter temperature to tune response randomness (0.0 to 1.0): 0.0 for analytical, 1.0 for creative tasks. Note: Full determinism is not guaranteed even at 0.0."),id:"temperature-val",label:e("Temperatures"),onChange:"SET_TEMPERATURE",path:"temperature",placeholder:e("Enter temperature value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:o.componentName.mixInput,helperText:e("Enter nucleus sampling with top_p for probability cutoff. Adjust temperature or top_p, not both. Temperature is usually sufficient, controlling randomness, while top_p manages content diversity, ideal for advanced scenarios like creative writing. E.g. 1."),id:"topP-val",label:e("topP Sampling Value"),onChange:"SET_TOP_P",path:"top_p",placeholder:e("Enter topP value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:o.componentName.mixInput,helperText:e('Enter only a sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. Recommended for advanced use cases only. You usually only need to use temperature.'),id:"topK-val",label:e("topK Sampling Value"),onChange:"SET_TOP_K",path:"top_k",placeholder:e("Enter topK value"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0},{componentName:o.componentName.mixInput,helperText:e(`Define custom stop sequences to interrupt the model's generation. By using the stop_sequences parameter, the model will halt when it encounters specified text strings, with the response stop_reason as "stop_sequence" and the matched sequence in stop_sequence value.`),id:"stop-sequence",label:e("Stop Sequence"),onChange:"SET_STOP_SEQUENCE",path:"stop_sequences",placeholder:e("Enter stop sequences"),render:"IF_ADVANCE_FEATURE_SELECTED",value:void 0}]},actions:{IF_ADVANCE_FEATURE_SELECTED:({$:t})=>{var a;return((a=t.getComponent("show-advance-feature"))==null?void 0:a.value)===!0},IF_CONNECTION_SELECTED:({$:t})=>{var a;return E((a=t.getComponent("connection-id"))==null?void 0:a.value)},ON_MACHINE_LOAD:async({$:t})=>{i(t,[{db:"connectionId",id:"connection-id"},{db:"modelId",id:"model"},{db:"maxToken",id:"max-token"},{db:"temperatureVal",id:"temperature-val"},{db:"topPVal",id:"topP-val"},{db:"topKVal",id:"topK-val"},{db:"stopSequence",id:"stop-sequence"},{db:"showAdvanceFeature",id:"show-advance-feature"},{db:"messageId",id:"message"}]),await l(t)},REFETCH_MODEL:async({$:t})=>{await l(t)},SELECT_MESSAGE:s("messageId"),SELECT_MODEL:s("modelId"),SET_MAX_TOKEN:s("maxToken"),SET_STOP_SEQUENCE:s("stopSequence"),SET_TEMPERATURE:s("temperatureVal"),SET_TOP_K:s("topKVal"),SET_TOP_P:s("topPVal"),SET_FEATURE:async({$:t,e:a})=>{t.setThisComponent(n=>{n.value=a}),t.setDb(n=>{n.showAdvanceFeature=a})},SET_CONNECTION:async({$:t,e:a})=>{t.setThisComponent(n=>{n.value=a}),t.setDb(n=>{n.connectionId=a}),await l(t)},CONNECTION_ADD_CHANGE:p}}));export{T as default};
