mirror of
https://github.com/langgenius/dify.git
synced 2026-03-20 05:57:59 +08:00
fix: skill always same
This commit is contained in:
@ -45,23 +45,24 @@ const useConfig = (id: string, payload: LLMNodeType) => {
|
||||
})
|
||||
}
|
||||
|
||||
// set skill=true for sandbox
|
||||
// sandbox engine
|
||||
if (isSupportSandbox) {
|
||||
if (Array.isArray(newPayload.prompt_template) && newPayload.prompt_template.find(item => !item.skill)) {
|
||||
const isSupportSkill = !!newPayload.computer_use
|
||||
if (Array.isArray(newPayload.prompt_template)) {
|
||||
newPayload = produce(newPayload, (draft) => {
|
||||
draft.prompt_template = (draft.prompt_template as PromptItem[]).map((item) => {
|
||||
return {
|
||||
...item,
|
||||
skill: true,
|
||||
skill: isSupportSkill,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
else if (!Array.isArray(newPayload.prompt_template) && !newPayload.prompt_template.skill) {
|
||||
else {
|
||||
newPayload = produce(newPayload, (draft) => {
|
||||
draft.prompt_template = {
|
||||
...draft.prompt_template,
|
||||
skill: true,
|
||||
skill: isSupportSkill,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user