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

Function fetchAiModelsList

frontend/src/components/modelModal/index.tsx:87–107  ·  view source on GitHub ↗
(offset: number, providerId: string)

Source from the content-addressed store, hash-verified

85 }
86 const resourceListOrder = ['taskingai_documentation_url', 'official_site_url', 'official_credentials_url', 'official_pricing_url']
87 const fetchAiModelsList = async (offset: number, providerId: string) => {
88 try {
89 console.log(props.modelType)
90 const res: any = await getAiModelsList(offset, 100, providerId, props.modelType as string,)
91 if (res.data.length !== 0) {
92 setPromptList(res.data)
93 setSelectedOneId(res.data[0].model_schema_id)
94 setName(res.data[0].name)
95 setType(res.data[0].type)
96 setProperties(res.data[0].properties)
97 setDescription(res.data[0].description)
98 setProviderId(res.data[0].provider_id)
99 }
100
101 } catch (e) {
102 console.log(e)
103
104 } finally {
105 setCenterLoading(false)
106 }
107 }
108 const handleClickModel = (item: projectIdType) => () => {
109 setName(item.name)
110 setSelectedOneId(item.model_schema_id)

Callers 1

fetchModelProviderListFunction · 0.85

Calls 1

getAiModelsListFunction · 0.90

Tested by

no test coverage detected