mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import type { Var } from './types'
|
||||
import { BlockEnum, VarType } from './types'
|
||||
|
||||
export const MAX_ITERATION_PARALLEL_NUM = 10
|
||||
export const MIN_ITERATION_PARALLEL_NUM = 1
|
||||
export const DEFAULT_ITER_TIMES = 1
|
||||
@ -42,16 +43,18 @@ export const isInWorkflowPage = () => {
|
||||
export const getGlobalVars = (isChatMode: boolean): Var[] => {
|
||||
const isInWorkflow = isInWorkflowPage()
|
||||
const vars: Var[] = [
|
||||
...(isChatMode ? [
|
||||
{
|
||||
variable: 'sys.dialogue_count',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'sys.conversation_id',
|
||||
type: VarType.string,
|
||||
},
|
||||
] : []),
|
||||
...(isChatMode
|
||||
? [
|
||||
{
|
||||
variable: 'sys.dialogue_count',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'sys.conversation_id',
|
||||
type: VarType.string,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
variable: 'sys.user_id',
|
||||
type: VarType.string,
|
||||
@ -68,12 +71,14 @@ export const getGlobalVars = (isChatMode: boolean): Var[] => {
|
||||
variable: 'sys.workflow_run_id',
|
||||
type: VarType.string,
|
||||
},
|
||||
...((isInWorkflow && !isChatMode) ? [
|
||||
{
|
||||
variable: 'sys.timestamp',
|
||||
type: VarType.number,
|
||||
},
|
||||
] : []),
|
||||
...((isInWorkflow && !isChatMode)
|
||||
? [
|
||||
{
|
||||
variable: 'sys.timestamp',
|
||||
type: VarType.number,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
]
|
||||
return vars
|
||||
}
|
||||
@ -104,11 +109,25 @@ export const RETRIEVAL_OUTPUT_STRUCT = `{
|
||||
}`
|
||||
|
||||
export const SUPPORT_OUTPUT_VARS_NODE = [
|
||||
BlockEnum.Start, BlockEnum.TriggerWebhook, BlockEnum.TriggerPlugin, BlockEnum.LLM, BlockEnum.KnowledgeRetrieval, BlockEnum.Code, BlockEnum.TemplateTransform,
|
||||
BlockEnum.HttpRequest, BlockEnum.Tool, BlockEnum.VariableAssigner, BlockEnum.VariableAggregator, BlockEnum.QuestionClassifier,
|
||||
BlockEnum.ParameterExtractor, BlockEnum.Iteration, BlockEnum.Loop,
|
||||
BlockEnum.DocExtractor, BlockEnum.ListFilter,
|
||||
BlockEnum.Agent, BlockEnum.DataSource,
|
||||
BlockEnum.Start,
|
||||
BlockEnum.TriggerWebhook,
|
||||
BlockEnum.TriggerPlugin,
|
||||
BlockEnum.LLM,
|
||||
BlockEnum.KnowledgeRetrieval,
|
||||
BlockEnum.Code,
|
||||
BlockEnum.TemplateTransform,
|
||||
BlockEnum.HttpRequest,
|
||||
BlockEnum.Tool,
|
||||
BlockEnum.VariableAssigner,
|
||||
BlockEnum.VariableAggregator,
|
||||
BlockEnum.QuestionClassifier,
|
||||
BlockEnum.ParameterExtractor,
|
||||
BlockEnum.Iteration,
|
||||
BlockEnum.Loop,
|
||||
BlockEnum.DocExtractor,
|
||||
BlockEnum.ListFilter,
|
||||
BlockEnum.Agent,
|
||||
BlockEnum.DataSource,
|
||||
]
|
||||
|
||||
export const AGENT_OUTPUT_STRUCT: Var[] = [
|
||||
|
||||
Reference in New Issue
Block a user