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

Function fetchModelsList

frontend/src/components/createCollection/index.tsx:46–63  ·  view source on GitHub ↗
(params: Record<string, string | number>,type?: string)

Source from the content-addressed store, hash-verified

44 }, []);
45 const [modalTableOpen, setModalTableOpen] = useState(false)
46 const fetchModelsList = async (params: Record<string, string | number>,type?: string) => {
47 if(type) {
48 dispatch(fetchModelsData(20) as any);
49 }
50 try {
51 const res: any = await getModelsList(params, 'text_embedding')
52 const data = res.data.map((item: any) => {
53 return {
54 ...item,
55 key: item.model_id,
56 }
57 })
58 setModelHasMore(res.has_more)
59 setOptions(data)
60 } catch (error) {
61 console.log(error)
62 }
63 }
64 const handleCancel = () => {
65 handleModalCloseOrOpen(false)
66 setDrawerName('')

Callers 2

CreateCollectionFunction · 0.70
handleChildModelEventFunction · 0.70

Calls 2

fetchModelsDataFunction · 0.90
getModelsListFunction · 0.90

Tested by

no test coverage detected