mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-16 06:16:53 +08:00
feat: add api-based extension & external data tool & moderation (#1459)
This commit is contained in:
@@ -19,7 +19,7 @@ import { useProviderContext } from '@/context/provider-context'
|
||||
import ModelModeTypeLabel from '@/app/components/app/configuration/config-model/model-mode-type-label'
|
||||
import type { ModelModeType } from '@/types/app'
|
||||
import { CubeOutline } from '@/app/components/base/icons/src/vender/line/shapes'
|
||||
import AccountSetting from '@/app/components/header/account-setting'
|
||||
import { useModalContext } from '@/context/modal-context'
|
||||
|
||||
type Props = {
|
||||
value: {
|
||||
@@ -59,6 +59,7 @@ const ModelSelector: FC<Props> = ({
|
||||
triggerIconSmall,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const { setShowAccountSettingModal } = useModalContext()
|
||||
const { textGenerationModelList, embeddingsModelList, speech2textModelList, agentThoughtModelList } = useProviderContext()
|
||||
const [search, setSearch] = useState('')
|
||||
const modelList = supportAgentThought
|
||||
@@ -112,8 +113,6 @@ const ModelSelector: FC<Props> = ({
|
||||
return res
|
||||
})()
|
||||
|
||||
const [showSettingModal, setShowSettingModal] = useState(false)
|
||||
|
||||
return (
|
||||
<div className=''>
|
||||
<Popover className='relative'>
|
||||
@@ -248,9 +247,7 @@ const ModelSelector: FC<Props> = ({
|
||||
style={{
|
||||
borderColor: 'rgba(0, 0, 0, 0.05)',
|
||||
}}
|
||||
onClick={() => {
|
||||
setShowSettingModal(true)
|
||||
}}
|
||||
onClick={() => setShowAccountSettingModal({ payload: 'provider' })}
|
||||
>
|
||||
<CubeOutline className='w-4 h-4 mr-2' />
|
||||
<div>{t('common.model.addMoreModel')}</div>
|
||||
@@ -260,14 +257,6 @@ const ModelSelector: FC<Props> = ({
|
||||
</Transition>
|
||||
)}
|
||||
</Popover>
|
||||
|
||||
{
|
||||
showSettingModal && (
|
||||
<AccountSetting activeTab="provider" onCancel={async () => {
|
||||
setShowSettingModal(false)
|
||||
}} />
|
||||
)
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user