import{aa as r,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{s as p}from"./machine.-tangy-colts-beg-869.js";import{h as E,c as l}from"./commonut-tangy-colts-beg-826.js";import{f as m}from"./machineh-tangy-colts-beg-656.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,e){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,e),e)}};const h=r(({helpers:a})=>({states:{components:[l(a),{componentName:a.componentName.select,helperText:o("Choose the Groq vision model to use here. E.g. llama-3.2-11b-vision-preview."),id:"model-id",label:o("Model"),onChange:"SELECT_MODEL",onRefetch:"REFETCH_MODEL",optionFilterProp:"label",options:[],path:"model",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:""},{componentName:a.componentName.mixInput,helperText:o("Enter the URL of the image you want to analyze."),id:"image-url",label:o("Image URL"),onChange:"HANDLE_IMAGE_URL",path:"image_url",render:"IF_MODEL_SELECTED",required:!0,value:[]},{componentName:a.componentName.mixInput,helperText:o("Enter the prompt to guide the image analysis."),id:"prompt",label:o("Prompt"),onChange:"HANDLE_PROMPT",path:"prompt",render:"IF_MODEL_SELECTED",required:!0,value:[]},{componentName:a.componentName.mixInput,helperText:o("The maximum number of tokens that can be generated in the response."),id:"max-tokens",label:o("Max Tokens Returned"),onChange:"HANDLE_MAX_TOKEN",path:"max_tokens",render:"IF_MODEL_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:o("Controls randomness in the response. Range: 0-2, Default: 1."),id:"temperature",label:o("Temperature"),onChange:"SET_TEMPERATURE",path:"temperature",render:"IF_MODEL_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:o("An alternative to temperature for controlling randomness. Range: 0-1, Default: 1."),id:"top-p",label:o("Top P"),onChange:"SET_TOP_P",path:"top_p",render:"IF_MODEL_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:o("Positive values penalize tokens based on their frequency so far. Range: -2.0 to 2.0, Default: 0."),id:"frequency-penalty",label:o("Frequency Penalty"),onChange:"SET_FREQUENCY_PENALTY",path:"frequency_penalty",render:"IF_MODEL_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:o("If specified, the system will attempt to sample deterministically."),id:"seed",label:o("Seed"),onChange:"SET_SEED",path:"seed",render:"IF_MODEL_SELECTED",value:[]}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var n;return i((n=e.getComponent("connection-id"))==null?void 0:n.value)},IF_MODEL_SELECTED:({$:e})=>{var n,t;return i((n=e.getComponent("connection-id"))==null?void 0:n.value)&&((t=e.getComponent("model-id"))==null?void 0:t.value)!==""},ON_MACHINE_LOAD:async({$:e})=>{var n;p(e,[{db:"connectionId",id:"connection-id"},{db:"modelId",id:"model-id"},{db:"imageUrl",id:"image-url"},{db:"prompt",id:"prompt"},{db:"maxTokens",id:"max-tokens"},{db:"temperature",id:"temperature"},{db:"topP",id:"top-p"},{db:"frequencyPenalty",id:"frequency-penalty"},{db:"seed",id:"seed"}]),(n=e.db)!=null&&n.connectionId&&await m(e)},REFETCH_MODEL:async({$:e})=>{await m(e)},SELECT_MODEL:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.modelId=n})},HANDLE_IMAGE_URL:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.imageUrl=n})},HANDLE_PROMPT:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.prompt=n})},HANDLE_MAX_TOKEN:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.maxTokens=n})},SET_TEMPERATURE:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.temperature=n})},SET_TOP_P:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.topP=n})},SET_FREQUENCY_PENALTY:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.frequencyPenalty=n})},SET_SEED:({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.seed=n})},SET_CONNECTION:async({$:e,e:n})=>{e.setThisComponent(t=>{t.value=n}),e.setDb(t=>{t.connectionId=n}),await m(e)},CONNECTION_ADD_CHANGE:E}}));export{h as default};
