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

Function fetchModelsList

frontend/src/components/modelComponent/index.tsx:50–71  ·  view source on GitHub ↗
(value?: any, type?: string)

Source from the content-addressed store, hash-verified

48 setModelOne(false)
49 }
50 const fetchModelsList = async (value?: any, type?: string) => {
51 if (type) {
52 dispatch(fetchModelsData(20) as any);
53 }
54 const params = {
55 limit: modelLimit || 20,
56 ...value
57 }
58 try {
59 const res: any = await getModelsList(params, 'chat_completion')
60 const data = res.data.map((item: any) => {
61 return {
62 ...item,
63 key: item.model_id
64 }
65 })
66 setOptions(data)
67 setHasModelMore(res.has_more)
68 } catch (error) {
69 console.log(error)
70 }
71 }
72 const handleModalClose = () => {
73 props.handleCloseModal()
74 }

Callers 2

ModelComponentFunction · 0.70
handleChildModelEventFunction · 0.70

Calls 2

fetchModelsDataFunction · 0.90
getModelsListFunction · 0.90

Tested by

no test coverage detected