mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Feature/agentflow v2 (#4298)
* agent flow v2 * chat message background * conditon agent flow * add sticky note * update human input dynamic prompt * add HTTP node * add default tool icon * fix export duplicate agentflow v2 * add agentflow v2 marketplaces * refractor memoization, add iteration nodes * add agentflow v2 templates * add agentflow generator * add migration scripts for mysql, mariadb, posrgres and fix date filters for executions * update agentflow chat history config * fix get all flows error after deletion and rename * add previous nodes from parent node * update generator prompt * update run time state when using iteration nodes * prevent looping connection, prevent duplication of start node, add executeflow node, add nodes agentflow, chat history variable * update embed * convert form input to string * bump openai version * add react rewards * add prompt generator to prediction queue * add array schema to overrideconfig * UI touchup * update embedded chat version * fix node info dialog * update start node and loop default iteration * update UI fixes for agentflow v2 * fix async drop down * add export import to agentflowsv2, executions, fix UI bugs * add default empty object to flowlisttable * add ability to share trace link publicly, allow MCP tool use for Agent and Assistant * add runtime message length to variable, display conditions on UI * fix array validation * add ability to add knowledge from vector store and embeddings for agent * add agent tool require human input * add ephemeral memory to start node * update agent flow node to show vs and embeddings icons * feat: add import chat data functionality for AgentFlowV2 * feat: set chatMessage.executionId to null if not found in import JSON file or database * fix: MariaDB execution migration script to utf8mb4_unicode_520_ci --------- Co-authored-by: Ong Chung Yau <33013947+chungyau97@users.noreply.github.com> Co-authored-by: chungyau97 <chungyau97@gmail.com>
This commit is contained in:
@@ -2,8 +2,10 @@ import {
|
||||
IAction,
|
||||
ICommonObject,
|
||||
IFileUpload,
|
||||
IHumanInput,
|
||||
INode,
|
||||
INodeData as INodeDataFromComponent,
|
||||
INodeExecutionData,
|
||||
INodeParams,
|
||||
IServerSideEventStreamer
|
||||
} from 'flowise-components'
|
||||
@@ -13,10 +15,12 @@ import { Telemetry } from './utils/telemetry'
|
||||
|
||||
export type MessageType = 'apiMessage' | 'userMessage'
|
||||
|
||||
export type ChatflowType = 'CHATFLOW' | 'MULTIAGENT' | 'ASSISTANT'
|
||||
export type ChatflowType = 'CHATFLOW' | 'MULTIAGENT' | 'ASSISTANT' | 'AGENTFLOW'
|
||||
|
||||
export type AssistantType = 'CUSTOM' | 'OPENAI' | 'AZURE'
|
||||
|
||||
export type ExecutionState = 'INPROGRESS' | 'FINISHED' | 'ERROR' | 'TERMINATED' | 'TIMEOUT' | 'STOPPED'
|
||||
|
||||
export enum MODE {
|
||||
QUEUE = 'queue',
|
||||
MAIN = 'main'
|
||||
@@ -57,6 +61,7 @@ export interface IChatMessage {
|
||||
role: MessageType
|
||||
content: string
|
||||
chatflowid: string
|
||||
executionId?: string
|
||||
sourceDocuments?: string
|
||||
usedTools?: string
|
||||
fileAnnotations?: string
|
||||
@@ -140,6 +145,19 @@ export interface IUpsertHistory {
|
||||
date: Date
|
||||
}
|
||||
|
||||
export interface IExecution {
|
||||
id: string
|
||||
executionData: string
|
||||
state: ExecutionState
|
||||
agentflowId: string
|
||||
sessionId: string
|
||||
isPublic?: boolean
|
||||
action?: string
|
||||
createdDate: Date
|
||||
updatedDate: Date
|
||||
stoppedDate: Date
|
||||
}
|
||||
|
||||
export interface IComponentNodes {
|
||||
[key: string]: INode
|
||||
}
|
||||
@@ -187,6 +205,8 @@ export interface IReactFlowNode {
|
||||
height: number
|
||||
selected: boolean
|
||||
dragging: boolean
|
||||
parentNode?: string
|
||||
extent?: string
|
||||
}
|
||||
|
||||
export interface IReactFlowEdge {
|
||||
@@ -227,6 +247,14 @@ export interface IDepthQueue {
|
||||
[key: string]: number
|
||||
}
|
||||
|
||||
export interface IAgentflowExecutedData {
|
||||
nodeLabel: string
|
||||
nodeId: string
|
||||
data: INodeExecutionData
|
||||
previousNodeIds: string[]
|
||||
status?: ExecutionState
|
||||
}
|
||||
|
||||
export interface IMessage {
|
||||
message: string
|
||||
type: MessageType
|
||||
@@ -238,6 +266,7 @@ export interface IncomingInput {
|
||||
question: string
|
||||
overrideConfig?: ICommonObject
|
||||
chatId?: string
|
||||
sessionId?: string
|
||||
stopNodeId?: string
|
||||
uploads?: IFileUpload[]
|
||||
leadEmail?: string
|
||||
@@ -246,6 +275,12 @@ export interface IncomingInput {
|
||||
streaming?: boolean
|
||||
}
|
||||
|
||||
export interface IncomingAgentflowInput extends Omit<IncomingInput, 'question'> {
|
||||
question?: string
|
||||
form?: Record<string, any>
|
||||
humanInput?: IHumanInput
|
||||
}
|
||||
|
||||
export interface IActiveChatflows {
|
||||
[key: string]: {
|
||||
startingNodes: IReactFlowNode[]
|
||||
@@ -266,6 +301,7 @@ export interface IOverrideConfig {
|
||||
label: string
|
||||
name: string
|
||||
type: string
|
||||
schema?: ICommonObject[]
|
||||
}
|
||||
|
||||
export type ICredentialDataDecrypted = ICommonObject
|
||||
@@ -315,6 +351,8 @@ export interface IFlowConfig {
|
||||
chatHistory: IMessage[]
|
||||
apiMessageId: string
|
||||
overrideConfig?: ICommonObject
|
||||
state?: ICommonObject
|
||||
runtimeChatHistoryLength?: number
|
||||
}
|
||||
|
||||
export interface IPredictionQueueAppServer {
|
||||
@@ -333,7 +371,13 @@ export interface IExecuteFlowParams extends IPredictionQueueAppServer {
|
||||
isInternal: boolean
|
||||
signal?: AbortController
|
||||
files?: Express.Multer.File[]
|
||||
fileUploads?: IFileUpload[]
|
||||
uploadedFilesContent?: string
|
||||
isUpsert?: boolean
|
||||
isRecursive?: boolean
|
||||
parentExecutionId?: string
|
||||
iterationContext?: ICommonObject
|
||||
isTool?: boolean
|
||||
}
|
||||
|
||||
export interface INodeOverrides {
|
||||
|
||||
Reference in New Issue
Block a user