mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat: new runtime options
This commit is contained in:
@ -71,6 +71,7 @@ export const useNodesSyncDraft = () => {
|
||||
retriever_resource: features.citation,
|
||||
sensitive_word_avoidance: features.moderation,
|
||||
file_upload: features.file,
|
||||
runtime: features.runtime,
|
||||
},
|
||||
environment_variables: environmentVariables,
|
||||
conversation_variables: conversationVariables,
|
||||
|
||||
@ -85,6 +85,11 @@ export const useWorkflowInit = () => {
|
||||
const nodesData = isAdvancedChat ? nodesTemplate : []
|
||||
const edgesData = isAdvancedChat ? edgesTemplate : []
|
||||
|
||||
const runtimeStorageKey = `workflow:sandbox-runtime:${appDetail.id}`
|
||||
const enableSandboxRuntime = localStorage.getItem(runtimeStorageKey) === '1'
|
||||
if (enableSandboxRuntime)
|
||||
localStorage.removeItem(runtimeStorageKey)
|
||||
|
||||
syncWorkflowDraft({
|
||||
url: `/apps/${appDetail.id}/workflows/draft`,
|
||||
params: {
|
||||
@ -94,6 +99,7 @@ export const useWorkflowInit = () => {
|
||||
},
|
||||
features: {
|
||||
retriever_resource: { enabled: true },
|
||||
runtime: { enabled: enableSandboxRuntime },
|
||||
},
|
||||
environment_variables: [],
|
||||
conversation_variables: [],
|
||||
|
||||
@ -748,6 +748,7 @@ export const useWorkflowRun = () => {
|
||||
citation: publishedWorkflow.features.retriever_resource,
|
||||
moderation: publishedWorkflow.features.sensitive_word_avoidance,
|
||||
file: publishedWorkflow.features.file_upload,
|
||||
runtime: publishedWorkflow.features.runtime || { enabled: false },
|
||||
}
|
||||
|
||||
featuresStore?.setState({ features: mappedFeatures })
|
||||
|
||||
Reference in New Issue
Block a user