mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-23 01:00:22 +03:00
8ebc4dcfd5
* add langgraph * datasource: initial commit * datasource: datasource details and chunks * datasource: Document Store Node * more changes * Document Store - Base functionality * Document Store Loader Component * Document Store Loader Component * before merging the modularity PR * after merging the modularity PR * preview mode * initial draft PR * fixes * minor updates and fixes * preview with loader and splitter * preview with credential * show stored chunks * preview update... * edit config * save, preview and other changes * save, preview and other changes * save, process and other changes * save, process and other changes * alpha1 - for internal testing * rerouting urls * bug fix on new leader create * pagination support for chunks * delete document store * Update pnpm-lock.yaml * doc store card view * Update store files to use updated storage functions, Document Store Table View and other changes * ui changes * add expanded chunk dialog, improve ui * change throw Error to InternalError * Bug Fixes and removal of subFolder, adding of view chunks for store * lint fixes * merge changes * DocumentStoreStatus component * ui changes for doc store * add remove metadata key field, add custom document loader * add chatflows used doc store chips * add types/interfaces to DocumentStore Services * document loader list dialog title bar color change * update interfaces * Whereused Chatflow Name and Added chunkNo to retain order of created chunks. * use typeorm order chunkNo, ui changes * update tabler icons react * cleanup agents * add pysandbox tool * add abort functionality, loading next agent * add empty view svg * update chatflow tool with chatId * rename to agentflows * update worker for prompt input values * update dashboard to agentflows, agentcanvas * fix marketplace use template * add agentflow templates * resolve merge conflict * update baseURL --------- Co-authored-by: vinodkiran <vinodkiran@usa.net> Co-authored-by: Vinod Paidimarry <vinodkiran@outlook.in>
265 lines
4.9 KiB
TypeScript
265 lines
4.9 KiB
TypeScript
import { ICommonObject, IFileUpload, INode, INodeData as INodeDataFromComponent, INodeParams } from 'flowise-components'
|
|
|
|
export type MessageType = 'apiMessage' | 'userMessage'
|
|
|
|
export type ChatflowType = 'CHATFLOW' | 'MULTIAGENT'
|
|
|
|
export enum chatType {
|
|
INTERNAL = 'INTERNAL',
|
|
EXTERNAL = 'EXTERNAL'
|
|
}
|
|
|
|
export enum ChatMessageRatingType {
|
|
THUMBS_UP = 'THUMBS_UP',
|
|
THUMBS_DOWN = 'THUMBS_DOWN'
|
|
}
|
|
/**
|
|
* Databases
|
|
*/
|
|
export interface IChatFlow {
|
|
id: string
|
|
name: string
|
|
flowData: string
|
|
updatedDate: Date
|
|
createdDate: Date
|
|
deployed?: boolean
|
|
isPublic?: boolean
|
|
apikeyid?: string
|
|
analytic?: string
|
|
chatbotConfig?: string
|
|
apiConfig?: string
|
|
category?: string
|
|
type?: ChatflowType
|
|
}
|
|
|
|
export interface IChatMessage {
|
|
id: string
|
|
role: MessageType
|
|
content: string
|
|
chatflowid: string
|
|
sourceDocuments?: string
|
|
usedTools?: string
|
|
fileAnnotations?: string
|
|
agentReasoning?: string
|
|
fileUploads?: string
|
|
chatType: string
|
|
chatId: string
|
|
memoryType?: string
|
|
sessionId?: string
|
|
createdDate: Date
|
|
leadEmail?: string
|
|
}
|
|
|
|
export interface IChatMessageFeedback {
|
|
id: string
|
|
content?: string
|
|
chatflowid: string
|
|
chatId: string
|
|
messageId: string
|
|
rating: ChatMessageRatingType
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface ITool {
|
|
id: string
|
|
name: string
|
|
description: string
|
|
color: string
|
|
iconSrc?: string
|
|
schema?: string
|
|
func?: string
|
|
updatedDate: Date
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface IAssistant {
|
|
id: string
|
|
details: string
|
|
credential: string
|
|
iconSrc?: string
|
|
updatedDate: Date
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface ICredential {
|
|
id: string
|
|
name: string
|
|
credentialName: string
|
|
encryptedData: string
|
|
updatedDate: Date
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface IVariable {
|
|
id: string
|
|
name: string
|
|
value: string
|
|
type: string
|
|
updatedDate: Date
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface ILead {
|
|
id: string
|
|
name?: string
|
|
email?: string
|
|
phone?: string
|
|
chatflowid: string
|
|
chatId: string
|
|
createdDate: Date
|
|
}
|
|
|
|
export interface IUpsertHistory {
|
|
id: string
|
|
chatflowid: string
|
|
result: string
|
|
flowData: string
|
|
date: Date
|
|
}
|
|
|
|
export interface IComponentNodes {
|
|
[key: string]: INode
|
|
}
|
|
|
|
export interface IComponentCredentials {
|
|
[key: string]: INode
|
|
}
|
|
|
|
export interface IVariableDict {
|
|
[key: string]: string
|
|
}
|
|
|
|
export interface INodeDependencies {
|
|
[key: string]: number
|
|
}
|
|
|
|
export interface INodeDirectedGraph {
|
|
[key: string]: string[]
|
|
}
|
|
|
|
export interface INodeData extends INodeDataFromComponent {
|
|
inputAnchors: INodeParams[]
|
|
inputParams: INodeParams[]
|
|
outputAnchors: INodeParams[]
|
|
}
|
|
|
|
export interface IReactFlowNode {
|
|
id: string
|
|
position: {
|
|
x: number
|
|
y: number
|
|
}
|
|
type: string
|
|
data: INodeData
|
|
positionAbsolute: {
|
|
x: number
|
|
y: number
|
|
}
|
|
z: number
|
|
handleBounds: {
|
|
source: any
|
|
target: any
|
|
}
|
|
width: number
|
|
height: number
|
|
selected: boolean
|
|
dragging: boolean
|
|
}
|
|
|
|
export interface IReactFlowEdge {
|
|
source: string
|
|
sourceHandle: string
|
|
target: string
|
|
targetHandle: string
|
|
type: string
|
|
id: string
|
|
data: {
|
|
label: string
|
|
}
|
|
}
|
|
|
|
export interface IReactFlowObject {
|
|
nodes: IReactFlowNode[]
|
|
edges: IReactFlowEdge[]
|
|
viewport: {
|
|
x: number
|
|
y: number
|
|
zoom: number
|
|
}
|
|
}
|
|
|
|
export interface IExploredNode {
|
|
[key: string]: {
|
|
remainingLoop: number
|
|
lastSeenDepth: number
|
|
}
|
|
}
|
|
|
|
export interface INodeQueue {
|
|
nodeId: string
|
|
depth: number
|
|
}
|
|
|
|
export interface IDepthQueue {
|
|
[key: string]: number
|
|
}
|
|
|
|
export interface IMessage {
|
|
message: string
|
|
type: MessageType
|
|
}
|
|
|
|
export interface IncomingInput {
|
|
question: string
|
|
overrideConfig?: ICommonObject
|
|
socketIOClientId?: string
|
|
chatId?: string
|
|
stopNodeId?: string
|
|
uploads?: IFileUpload[]
|
|
leadEmail?: string
|
|
history?: IMessage[]
|
|
}
|
|
|
|
export interface IActiveChatflows {
|
|
[key: string]: {
|
|
startingNodes: IReactFlowNode[]
|
|
endingNodeData?: INodeData
|
|
inSync: boolean
|
|
overrideConfig?: ICommonObject
|
|
}
|
|
}
|
|
|
|
export interface IActiveCache {
|
|
[key: string]: Map<any, any>
|
|
}
|
|
|
|
export interface IOverrideConfig {
|
|
node: string
|
|
nodeId: string
|
|
label: string
|
|
name: string
|
|
type: string
|
|
}
|
|
|
|
export type ICredentialDataDecrypted = ICommonObject
|
|
|
|
// Plain credential object sent to server
|
|
export interface ICredentialReqBody {
|
|
name: string
|
|
credentialName: string
|
|
plainDataObj: ICredentialDataDecrypted
|
|
}
|
|
|
|
// Decrypted credential object sent back to client
|
|
export interface ICredentialReturnResponse extends ICredential {
|
|
plainDataObj: ICredentialDataDecrypted
|
|
}
|
|
|
|
export interface IUploadFileSizeAndTypes {
|
|
fileTypes: string[]
|
|
maxUploadSize: number
|
|
}
|
|
|
|
// DocumentStore related
|
|
export * from './Interface.DocumentStore'
|