@ -13,7 +13,7 @@ import I18n from '@/context/i18n'
import Button from '@/app/components/base/button'
import Button from '@/app/components/base/button'
import Loading from '@/app/components/base/loading'
import Loading from '@/app/components/base/loading'
import { DiagonalDividingLine } from '@/app/components/base/icons/src/public/common'
import { DiagonalDividingLine } from '@/app/components/base/icons/src/public/common'
import { getModelRuntimeSupported } from '@/utils/language'
type Props = {
type Props = {
collection : Collection
collection : Collection
toolName : string
toolName : string
@ -32,6 +32,7 @@ const SettingBuiltInTool: FC<Props> = ({
onSave ,
onSave ,
} ) = > {
} ) = > {
const { locale } = useContext ( I18n )
const { locale } = useContext ( I18n )
const language = getModelRuntimeSupported ( locale )
const { t } = useTranslation ( )
const { t } = useTranslation ( )
const [ isLoading , setIsLoading ] = useState ( true )
const [ isLoading , setIsLoading ] = useState ( true )
@ -83,7 +84,7 @@ const SettingBuiltInTool: FC<Props> = ({
{ t ( 'tools.setBuiltInTools.toolDescription' ) }
{ t ( 'tools.setBuiltInTools.toolDescription' ) }
< / div >
< / div >
< div className = 'mt-1 leading-[18px] text-xs font-normal text-gray-600' >
< div className = 'mt-1 leading-[18px] text-xs font-normal text-gray-600' >
{ currTool ? . description [ l ocale === 'en' ? 'en_US' : 'zh_Hans' ] }
{ currTool ? . description [ l anguage ] }
< / div >
< / div >
{ infoSchemas . length > 0 && (
{ infoSchemas . length > 0 && (
@ -96,7 +97,7 @@ const SettingBuiltInTool: FC<Props> = ({
{ infoSchemas . map ( ( item : any , index ) = > (
{ infoSchemas . map ( ( item : any , index ) = > (
< div key = { index } >
< div key = { index } >
< div className = 'flex items-center space-x-2 leading-[18px]' >
< div className = 'flex items-center space-x-2 leading-[18px]' >
< div className = 'text-[13px] font-semibold text-gray-900' > { item . label [ l ocale === 'en' ? 'en_US' : 'zh_Hans' ] } < / div >
< div className = 'text-[13px] font-semibold text-gray-900' > { item . label [ l anguage ] } < / div >
< div className = 'text-xs font-medium text-gray-500' > { item . type === 'number-input' ? t ( 'tools.setBuiltInTools.number' ) : t ( 'tools.setBuiltInTools.string' ) } < / div >
< div className = 'text-xs font-medium text-gray-500' > { item . type === 'number-input' ? t ( 'tools.setBuiltInTools.number' ) : t ( 'tools.setBuiltInTools.string' ) } < / div >
{ item . required && (
{ item . required && (
< div className = 'text-xs font-medium text-[#EC4A0A]' > { t ( 'tools.setBuiltInTools.required' ) } < / div >
< div className = 'text-xs font-medium text-[#EC4A0A]' > { t ( 'tools.setBuiltInTools.required' ) } < / div >
@ -104,7 +105,7 @@ const SettingBuiltInTool: FC<Props> = ({
< / div >
< / div >
{ item . human_description && (
{ item . human_description && (
< div className = 'mt-1 leading-[18px] text-xs font-normal text-gray-600' >
< div className = 'mt-1 leading-[18px] text-xs font-normal text-gray-600' >
{ item . human_description ? . [ l ocale === 'en' ? 'en_US' : 'zh_Hans' ] }
{ item . human_description ? . [ l anguage ] }
< / div >
< / div >
) }
) }
< / div >
< / div >
@ -140,7 +141,7 @@ const SettingBuiltInTool: FC<Props> = ({
backgroundImage : ` url( ${ collection . icon } ) ` ,
backgroundImage : ` url( ${ collection . icon } ) ` ,
} }
} }
> < / div >
> < / div >
< div className = 'ml-2 leading-6 text-base font-semibold text-gray-900' > { currTool ? . label [ l ocale === 'en' ? 'en_US' : 'zh_Hans' ] } < / div >
< div className = 'ml-2 leading-6 text-base font-semibold text-gray-900' > { currTool ? . label [ l anguage ] } < / div >
{ ( hasSetting && ! readonly ) && ( < >
{ ( hasSetting && ! readonly ) && ( < >
< DiagonalDividingLine className = 'mx-4' / >
< DiagonalDividingLine className = 'mx-4' / >
< div className = 'flex space-x-6' >
< div className = 'flex space-x-6' >