(params: Record<string, any>)
| 463 | } |
| 464 | } |
| 465 | const fetchModelsList = async (params: Record<string, any>) => { |
| 466 | |
| 467 | try { |
| 468 | const res: any = await getModelsList(params, 'chat_completion') |
| 469 | const data = res.data.map((item: any) => { |
| 470 | return { |
| 471 | ...item, |
| 472 | key: item.model_id |
| 473 | } |
| 474 | }) |
| 475 | setOptions(data) |
| 476 | setHasModelMore(res.has_more) |
| 477 | } catch (error) { |
| 478 | console.log(error) |
| 479 | const apiResponse = error as ApiErrorResponse |
| 480 | const message = apiResponse.response.data.error.message |
| 481 | toast.error(message) |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | const handleEditAssistant = async () => { |
| 486 | setLoading(true) |
no test coverage detected