(params: Record<string, any>, type?: string)
| 187 | setLoading(false); |
| 188 | }; |
| 189 | const fetchModelsList = async (params: Record<string, any>, type?: string) => { |
| 190 | if (type) { |
| 191 | dispatch(fetchModelsData(20) as any) |
| 192 | } |
| 193 | try { |
| 194 | const res: any = await getModelsList(params, 'text_embedding') |
| 195 | const data = res.data.map((item: any) => { |
| 196 | return { |
| 197 | ...item, |
| 198 | key: item.model_id, |
| 199 | } |
| 200 | }) |
| 201 | setModelHasMore(res.has_more) |
| 202 | setOptions(data) |
| 203 | } catch (error) { |
| 204 | console.log(error) |
| 205 | } |
| 206 | } |
| 207 | const handleCreatePrompt = () => { |
| 208 | setDrawerTitle('Create Collection') |
| 209 | setDrawerName(undefined) |
no test coverage detected