mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
Feat/zhipuai function calling (#2199)
Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
@@ -229,7 +229,7 @@ const Answer: FC<IAnswerProps> = ({
|
||||
<Thought
|
||||
thought={item}
|
||||
allToolIcons={allToolIcons || {}}
|
||||
isFinished={!!item.observation}
|
||||
isFinished={!!item.observation || !isResponsing}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import { fetchDatasets } from '@/service/datasets'
|
||||
import { useProviderContext } from '@/context/provider-context'
|
||||
import { AgentStrategy, AppType, ModelModeType, RETRIEVE_TYPE, Resolution, TransferMethod } from '@/types/app'
|
||||
import { PromptMode } from '@/models/debug'
|
||||
import { ANNOTATION_DEFAULT, DEFAULT_AGENT_SETTING, DEFAULT_CHAT_PROMPT_CONFIG, DEFAULT_COMPLETION_PROMPT_CONFIG } from '@/config'
|
||||
import { ANNOTATION_DEFAULT, DEFAULT_AGENT_SETTING, DEFAULT_CHAT_PROMPT_CONFIG, DEFAULT_COMPLETION_PROMPT_CONFIG, supportFunctionCallModels } from '@/config'
|
||||
import SelectDataSet from '@/app/components/app/configuration/dataset-config/select-dataset'
|
||||
import I18n from '@/context/i18n'
|
||||
import { useModalContext } from '@/context/modal-context'
|
||||
@@ -163,8 +163,7 @@ const Configuration: FC = () => {
|
||||
doSetModelConfig(newModelConfig)
|
||||
}
|
||||
const isOpenAI = modelConfig.provider === 'openai'
|
||||
const isFunctionCall = isOpenAI && modelConfig.mode === ModelModeType.chat
|
||||
|
||||
const isFunctionCall = (isOpenAI && modelConfig.mode === ModelModeType.chat) || supportFunctionCallModels.includes(modelConfig.model_id)
|
||||
const [collectionList, setCollectionList] = useState<Collection[]>([])
|
||||
useEffect(() => {
|
||||
|
||||
|
||||
@@ -160,6 +160,8 @@ export const DEFAULT_AGENT_SETTING = {
|
||||
tools: [],
|
||||
}
|
||||
|
||||
export const supportFunctionCallModels = ['glm-3-turbo', 'glm-4']
|
||||
|
||||
export const DEFAULT_AGENT_PROMPT = {
|
||||
chat: `Respond to the human as helpfully and accurately as possible.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user