wwf
2025-05-20 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import type {
  ModelConfig,
  VisionSettings,
} from '@/types/app'
import type { IChatItem } from '@/app/components/base/chat/chat/type'
import type { NodeTracing } from '@/types/workflow'
import type { WorkflowRunningStatus } from '@/app/components/workflow/types'
import type { FileEntity } from '@/app/components/base/file-uploader/types'
 
export type { VisionFile } from '@/types/app'
export { TransferMethod } from '@/types/app'
export type {
  Inputs,
  PromptVariable,
} from '@/models/debug'
 
export type UserInputForm = {
  default: string
  label: string
  required: boolean
  variable: string
}
 
export type UserInputFormTextInput = {
  'text-input': UserInputForm & {
    max_length: number
  }
}
 
export type UserInputFormSelect = {
  select: UserInputForm & {
    options: string[]
  }
}
 
export type UserInputFormParagraph = {
  paragraph: UserInputForm
}
 
export type VisionConfig = VisionSettings
 
export type EnableType = {
  enabled: boolean
}
 
export type ChatConfig = Omit<ModelConfig, 'model'> & {
  supportAnnotation?: boolean
  appId?: string
  questionEditEnable?: boolean
  supportFeedback?: boolean
  supportCitationHitInfo?: boolean
}
 
export type WorkflowProcess = {
  status: WorkflowRunningStatus
  tracing: NodeTracing[]
  expand?: boolean // for UI
  resultText?: string
  files?: FileEntity[]
}
 
export type ChatItem = IChatItem & {
  isError?: boolean
  workflowProcess?: WorkflowProcess
  conversationId?: string
  allFiles?: FileEntity[]
}
 
export type ChatItemInTree = {
  children?: ChatItemInTree[]
} & ChatItem
 
export type OnSend = {
  (message: string, files?: FileEntity[]): void
  (message: string, files: FileEntity[] | undefined, isRegenerate: boolean, lastAnswer?: ChatItem | null): void
}
 
export type OnRegenerate = (chatItem: ChatItem) => void
 
export type Callback = {
  onSuccess: () => void
}
 
export type Feedback = {
  rating: 'like' | 'dislike' | null
}