MCPcopy Create free account
hub / github.com/TaskingAI/TaskingAI / fetchModelsList

Function fetchModelsList

frontend/src/components/assistants/index.tsx:499–520  ·  view source on GitHub ↗
(value?: any, type?: string)

Source from the content-addressed store, hash-verified

497 }
498
499 const fetchModelsList = async (value?: any, type?: string) => {
500 if (type) {
501 dispatch(fetchModelsData(20) as any);
502 }
503 const params = {
504 limit: modelLimit || 20,
505 ...value
506 }
507 try {
508 const res: any = await getModelsList(params, 'chat_completion')
509 const data = res.data.map((item: any) => {
510 return {
511 ...item,
512 key: item.model_id
513 }
514 })
515 setOptions(data)
516 setHasModelMore(res.has_more)
517 } catch (error) {
518 console.log(error)
519 }
520 }
521 const handleCancel = () => {
522 setOpenDrawer(false)
523 setIsVisible(true)

Callers 3

AssistantFunction · 0.70
handleCreateModelIdFunction · 0.70
handleChildModelEventFunction · 0.70

Calls 2

fetchModelsDataFunction · 0.90
getModelsListFunction · 0.90

Tested by

no test coverage detected