MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / handleModalConfirm

Function handleModalConfirm

frontend/src/components/playgroundModel/index.tsx:167–190  ·  view source on GitHub ↗
(detailData: any)

Source from the content-addressed store, hash-verified

165 return hasError ? null : generateData
166 }
167 const handleModalConfirm = async (detailData: any) => {
168 setLoading(true)
169 setSelectedModel([{
170 id: detailData.model_id,
171 name: detailData.name
172 }])
173 const res = await getModelSchema(detailData.model_schema_id)
174 console.log(res)
175 localStorage.setItem('modelSchemaId', detailData.model_schema_id)
176 setModelSchemaId(detailData.model_schema_id)
177 setProviderId(detailData.provider_id)
178 localStorage.setItem('providerId', detailData.provider_id)
179 const res1 = await getModelsForm(detailData.model_id)
180 setOpen(false)
181
182 localStorage.setItem('streaming', JSON.stringify(res1.data.properties.streaming))
183 localStorage.setItem('allowedConfigs', JSON.stringify(res.data.allowed_configs))
184 setStreamShow(res1.data.properties.streaming)
185 setAllowedConfigs(res.data.allowed_configs || [])
186 dispatch(setPlaygroundModelId(detailData.model_id))
187 dispatch(setPlaygroundModelName(detailData.name))
188 navigation(`${pathname}?model_id=${detailData.model_id}&model_name=${detailData.name}`)
189 setLoading(false)
190 }
191 const handleGenerate = async () => {
192 const message = contentList.every((item) => {
193 return item.content === ''

Callers

nothing calls this directly

Calls 5

getModelSchemaFunction · 0.90
getModelsFormFunction · 0.90
setPlaygroundModelIdFunction · 0.90
setPlaygroundModelNameFunction · 0.90
setLoadingFunction · 0.85

Tested by

no test coverage detected