MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / fetchModels

Function fetchModels

web/src/pages/Channel/EditChannel.js:313–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311 };
312
313 const fetchModels = async () => {
314 try {
315 let res = await API.get(`/api/channel/models`);
316 const localModelOptions = res.data.data.map((model) => {
317 const id = (model.id || '').trim();
318 return {
319 key: id,
320 label: id,
321 value: id,
322 };
323 });
324 setOriginModelOptions(localModelOptions);
325 setFullModels(res.data.data.map((model) => model.id));
326 setBasicModels(
327 res.data.data
328 .filter((model) => {
329 return model.id.startsWith('gpt-') || model.id.startsWith('text-');
330 })
331 .map((model) => model.id),
332 );
333 } catch (error) {
334 showError(error.message);
335 }
336 };
337
338 const fetchGroups = async () => {
339 try {

Callers 1

EditChannel.jsFile · 0.70

Calls 1

showErrorFunction · 0.90

Tested by

no test coverage detected