(value?: any, type?: string)
| 48 | setModelOne(false) |
| 49 | } |
| 50 | const fetchModelsList = async (value?: any, type?: string) => { |
| 51 | if (type) { |
| 52 | dispatch(fetchModelsData(20) as any); |
| 53 | } |
| 54 | const params = { |
| 55 | limit: modelLimit || 20, |
| 56 | ...value |
| 57 | } |
| 58 | try { |
| 59 | const res: any = await getModelsList(params, 'chat_completion') |
| 60 | const data = res.data.map((item: any) => { |
| 61 | return { |
| 62 | ...item, |
| 63 | key: item.model_id |
| 64 | } |
| 65 | }) |
| 66 | setOptions(data) |
| 67 | setHasModelMore(res.has_more) |
| 68 | } catch (error) { |
| 69 | console.log(error) |
| 70 | } |
| 71 | } |
| 72 | const handleModalClose = () => { |
| 73 | props.handleCloseModal() |
| 74 | } |
no test coverage detected