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

Function getModelsList

frontend/src/axios/models.ts:20–46  ·  view source on GitHub ↗
(
    params: T,
    type?: string
)

Source from the content-addressed store, hash-verified

18 return await request.get(`${url}/model_schemas/get?model_schema_id=${modelSchemaId}`)
19}
20const getModelsList = async <T extends Record<string, string | number>>(
21 params: T,
22 type?: string
23) => {
24 const project_base_url = `api/v1`
25 let str = ''
26 const data = params
27 if (data.hasOwnProperty('name_search')) {
28 str += `prefix_filter={"name":"${data.name_search}"}&`
29 delete data.name_search
30 } else if (data.hasOwnProperty('id_search')) {
31 str += `prefix_filter={"model_id":"${data.id_search}"}&`
32 delete data.id_search
33 }
34 if (data) {
35 Object.keys(data).forEach(key => {
36 str += `${key}=${data[key]}&`
37 })
38 str = str.substring(0, str.length - 1)
39 }
40
41 if (type) {
42 return await request.get(`${project_base_url}/models?${str}&equal_filter={"type": "${type}"}`)
43 } else {
44 return await request.get(`${project_base_url}/models?${str}`)
45 }
46}
47const updateModels = async (model_id: string, params: object) => {
48 const project_base_url = `api/v1`
49 return await request.post(`${project_base_url}/models/${model_id}`, params)

Callers 6

fetchDataFunction · 0.90
fetchModelsListFunction · 0.90
fetchModelsListFunction · 0.90
fetchModelsListFunction · 0.90
fetchModelsListFunction · 0.90
fetchModelsListFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected