Flowise

Форк
0
/
Interface.ts 
258 строк · 4.8 Кб
1
import { ICommonObject, IFileUpload, INode, INodeData as INodeDataFromComponent, INodeParams } from 'flowise-components'
2

3
export type MessageType = 'apiMessage' | 'userMessage'
4

5
export enum chatType {
6
    INTERNAL = 'INTERNAL',
7
    EXTERNAL = 'EXTERNAL'
8
}
9

10
export enum ChatMessageRatingType {
11
    THUMBS_UP = 'THUMBS_UP',
12
    THUMBS_DOWN = 'THUMBS_DOWN'
13
}
14
/**
15
 * Databases
16
 */
17
export interface IChatFlow {
18
    id: string
19
    name: string
20
    flowData: string
21
    updatedDate: Date
22
    createdDate: Date
23
    deployed?: boolean
24
    isPublic?: boolean
25
    apikeyid?: string
26
    analytic?: string
27
    chatbotConfig?: string
28
    apiConfig?: any
29
}
30

31
export interface IChatMessage {
32
    id: string
33
    role: MessageType
34
    content: string
35
    chatflowid: string
36
    sourceDocuments?: string
37
    usedTools?: string
38
    fileAnnotations?: string
39
    fileUploads?: string
40
    chatType: string
41
    chatId: string
42
    memoryType?: string
43
    sessionId?: string
44
    createdDate: Date
45
    leadEmail?: string
46
}
47

48
export interface IChatMessageFeedback {
49
    id: string
50
    content?: string
51
    chatflowid: string
52
    chatId: string
53
    messageId: string
54
    rating: ChatMessageRatingType
55
    createdDate: Date
56
}
57

58
export interface ITool {
59
    id: string
60
    name: string
61
    description: string
62
    color: string
63
    iconSrc?: string
64
    schema?: string
65
    func?: string
66
    updatedDate: Date
67
    createdDate: Date
68
}
69

70
export interface IAssistant {
71
    id: string
72
    details: string
73
    credential: string
74
    iconSrc?: string
75
    updatedDate: Date
76
    createdDate: Date
77
}
78

79
export interface ICredential {
80
    id: string
81
    name: string
82
    credentialName: string
83
    encryptedData: string
84
    updatedDate: Date
85
    createdDate: Date
86
}
87

88
export interface IVariable {
89
    id: string
90
    name: string
91
    value: string
92
    type: string
93
    updatedDate: Date
94
    createdDate: Date
95
}
96

97
export interface ILead {
98
    id: string
99
    name?: string
100
    email?: string
101
    phone?: string
102
    chatflowid: string
103
    chatId: string
104
    createdDate: Date
105
}
106

107
export interface IUpsertHistory {
108
    id: string
109
    chatflowid: string
110
    result: string
111
    flowData: string
112
    date: Date
113
}
114

115
export interface IComponentNodes {
116
    [key: string]: INode
117
}
118

119
export interface IComponentCredentials {
120
    [key: string]: INode
121
}
122

123
export interface IVariableDict {
124
    [key: string]: string
125
}
126

127
export interface INodeDependencies {
128
    [key: string]: number
129
}
130

131
export interface INodeDirectedGraph {
132
    [key: string]: string[]
133
}
134

135
export interface INodeData extends INodeDataFromComponent {
136
    inputAnchors: INodeParams[]
137
    inputParams: INodeParams[]
138
    outputAnchors: INodeParams[]
139
}
140

141
export interface IReactFlowNode {
142
    id: string
143
    position: {
144
        x: number
145
        y: number
146
    }
147
    type: string
148
    data: INodeData
149
    positionAbsolute: {
150
        x: number
151
        y: number
152
    }
153
    z: number
154
    handleBounds: {
155
        source: any
156
        target: any
157
    }
158
    width: number
159
    height: number
160
    selected: boolean
161
    dragging: boolean
162
}
163

164
export interface IReactFlowEdge {
165
    source: string
166
    sourceHandle: string
167
    target: string
168
    targetHandle: string
169
    type: string
170
    id: string
171
    data: {
172
        label: string
173
    }
174
}
175

176
export interface IReactFlowObject {
177
    nodes: IReactFlowNode[]
178
    edges: IReactFlowEdge[]
179
    viewport: {
180
        x: number
181
        y: number
182
        zoom: number
183
    }
184
}
185

186
export interface IExploredNode {
187
    [key: string]: {
188
        remainingLoop: number
189
        lastSeenDepth: number
190
    }
191
}
192

193
export interface INodeQueue {
194
    nodeId: string
195
    depth: number
196
}
197

198
export interface IDepthQueue {
199
    [key: string]: number
200
}
201

202
export interface IMessage {
203
    message: string
204
    type: MessageType
205
}
206

207
export interface IncomingInput {
208
    question: string
209
    overrideConfig?: ICommonObject
210
    socketIOClientId?: string
211
    chatId?: string
212
    stopNodeId?: string
213
    uploads?: IFileUpload[]
214
    leadEmail?: string
215
}
216

217
export interface IActiveChatflows {
218
    [key: string]: {
219
        startingNodes: IReactFlowNode[]
220
        endingNodeData?: INodeData
221
        inSync: boolean
222
        overrideConfig?: ICommonObject
223
    }
224
}
225

226
export interface IActiveCache {
227
    [key: string]: Map<any, any>
228
}
229

230
export interface IOverrideConfig {
231
    node: string
232
    nodeId: string
233
    label: string
234
    name: string
235
    type: string
236
}
237

238
export type ICredentialDataDecrypted = ICommonObject
239

240
// Plain credential object sent to server
241
export interface ICredentialReqBody {
242
    name: string
243
    credentialName: string
244
    plainDataObj: ICredentialDataDecrypted
245
}
246

247
// Decrypted credential object sent back to client
248
export interface ICredentialReturnResponse extends ICredential {
249
    plainDataObj: ICredentialDataDecrypted
250
}
251

252
export interface IUploadFileSizeAndTypes {
253
    fileTypes: string[]
254
    maxUploadSize: number
255
}
256

257
// DocumentStore related
258
export * from './Interface.DocumentStore'
259

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.