@@ -12,7 +12,6 @@ import MistralAI from '@/assets/img/MistralAI.svg?react'
1212
1313import NoModel from '../../assets/img/NO_MODEL.svg?react'
1414import CohereIcon from '../../assets/img/cohereIcon.svg?react'
15- import CustomError from '../../contant/index.ts'
1615import { Modal , Pagination , Button , Spin , Input , Form } from 'antd'
1716import { getAiModelsList , createModels , getAiModelsForm , getModelProviderList } from '../../axios/models'
1817import { toast } from 'react-toastify'
@@ -104,16 +103,15 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
104103 const imgReverse = ( providerId : string ) => {
105104 if ( providerId === 'openai' ) {
106105 return < ModelProvider width = '16px' height = '16px' />
107- }
108- else if ( providerId === 'anthropic' ) {
106+ } else if ( providerId === 'anthropic' ) {
109107 return < Anthropic width = '16px' height = '16px' />
110108 } else if ( providerId === 'azure_openai' ) {
111109 return < Frame width = '16px' height = '16px' />
112110 } else if ( providerId === 'google_gemini' ) {
113111 return < GoogleIcon width = '16px' height = '16px' />
114112 } else if ( providerId === 'cohere' ) {
115113 return < CohereIcon width = '16px' height = '16px' />
116- } else if ( providerId === 'mistralai' ) {
114+ } else if ( providerId === 'mistralai' ) {
117115 return < MistralAI width = '16px' height = '16px' />
118116 }
119117 }
@@ -134,10 +132,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
134132 props . getOptionsList ( { limit : 20 } , props . modelType as string )
135133 props . handleSetModelConfirmOne ( false )
136134 } catch ( e ) {
137- console . log ( e )
138- if ( e instanceof CustomError ) {
139- toast . error ( e . response . data . error . message )
140- }
135+ toast . error ( e . response . data . error . message )
141136 } finally {
142137 setConfirmLoading ( false )
143138 }
@@ -326,7 +321,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
326321 ] }
327322 >
328323 < div >
329- < div className = 'description' > { ( property as { description : string } ) . description } </ div >
324+ < div className = 'description' > { ( property as { description : string } ) . description } </ div >
330325
331326 < Input placeholder = { `Enter ${ key } ` } className = 'input' />
332327 </ div >
0 commit comments