(value?: any, type?: string)
| 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) |
no test coverage detected