diff --git a/packages/components/credentials/ChatflowApi.credential.ts b/packages/components/credentials/ChatflowApi.credential.ts new file mode 100644 index 00000000..28c4aaec --- /dev/null +++ b/packages/components/credentials/ChatflowApi.credential.ts @@ -0,0 +1,23 @@ +import { INodeParams, INodeCredential } from '../src/Interface' + +class ChatflowApi implements INodeCredential { + label: string + name: string + version: number + inputs: INodeParams[] + + constructor() { + this.label = 'Chatflow API' + this.name = 'chatflowApi' + this.version = 1.0 + this.inputs = [ + { + label: 'Chatflow Api Key', + name: 'chatflowApiKey', + type: 'password' + } + ] + } +} + +module.exports = { credClass: ChatflowApi } diff --git a/packages/components/credentials/E2B.credential.ts b/packages/components/credentials/E2B.credential.ts new file mode 100644 index 00000000..9228c6cb --- /dev/null +++ b/packages/components/credentials/E2B.credential.ts @@ -0,0 +1,26 @@ +/* +* TODO: Implement codeInterpreter column to chat_message table +import { INodeParams, INodeCredential } from '../src/Interface' + +class E2BApi implements INodeCredential { + label: string + name: string + version: number + inputs: INodeParams[] + + constructor() { + this.label = 'E2B API' + this.name = 'E2BApi' + this.version = 1.0 + this.inputs = [ + { + label: 'E2B Api Key', + name: 'e2bApiKey', + type: 'password' + } + ] + } +} + +module.exports = { credClass: E2BApi } +*/ diff --git a/packages/components/nodes/agents/ToolAgent/ToolAgent.ts b/packages/components/nodes/agents/ToolAgent/ToolAgent.ts index 66b3802c..6d7dc03b 100644 --- a/packages/components/nodes/agents/ToolAgent/ToolAgent.ts +++ b/packages/components/nodes/agents/ToolAgent/ToolAgent.ts @@ -54,7 +54,7 @@ class ToolAgent_Agents implements INode { name: 'model', type: 'BaseChatModel', description: - 'Only compatible with models that are capable of function calling. ChatOpenAI, ChatMistral, ChatAnthropic, ChatVertexAI' + 'Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat' }, { label: 'System Message', diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts index 47425ed2..89981e87 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts @@ -206,7 +206,8 @@ class LangchainChatGoogleGenerativeAI extends BaseChatModel implements GoogleGen options: this['ParsedCallOptions'], runManager?: CallbackManagerForLLMRun ): Promise { - const prompt = convertBaseMessagesToContent(messages, this._isMultimodalModel) + let prompt = convertBaseMessagesToContent(messages, this._isMultimodalModel) + prompt = checkIfEmptyContentAndSameRole(prompt) // Handle streaming if (this.streaming) { @@ -235,7 +236,9 @@ class LangchainChatGoogleGenerativeAI extends BaseChatModel implements GoogleGen options: this['ParsedCallOptions'], runManager?: CallbackManagerForLLMRun ): AsyncGenerator { - const prompt = convertBaseMessagesToContent(messages, this._isMultimodalModel) + let prompt = convertBaseMessagesToContent(messages, this._isMultimodalModel) + prompt = checkIfEmptyContentAndSameRole(prompt) + //@ts-ignore if (options.tools !== undefined && options.tools.length > 0) { const result = await this._generateNonStreaming(prompt, options, runManager) @@ -333,7 +336,9 @@ function convertAuthorToRole(author: string) { case 'tool': return 'function' default: - throw new Error(`Unknown / unsupported author: ${author}`) + // Instead of throwing, we return model + // throw new Error(`Unknown / unsupported author: ${author}`) + return 'model' } } @@ -396,6 +401,25 @@ function convertMessageContentToParts(content: MessageContent, isMultimodalModel }) } +/* + * This is a dedicated logic for Multi Agent Supervisor to handle the case where the content is empty, and the role is the same + */ + +function checkIfEmptyContentAndSameRole(contents: Content[]) { + let prevRole = '' + const removedContents: Content[] = [] + for (const content of contents) { + const role = content.role + if (content.parts.length && content.parts[0].text === '' && role === prevRole) { + removedContents.push(content) + } + + prevRole = role + } + + return contents.filter((content) => !removedContents.includes(content)) +} + function convertBaseMessagesToContent(messages: BaseMessage[], isMultimodalModel: boolean) { return messages.reduce<{ content: Content[] diff --git a/packages/components/nodes/documentloaders/Csv/Csv.ts b/packages/components/nodes/documentloaders/Csv/Csv.ts index c9322aba..2f74e1c6 100644 --- a/packages/components/nodes/documentloaders/Csv/Csv.ts +++ b/packages/components/nodes/documentloaders/Csv/Csv.ts @@ -1,8 +1,8 @@ import { omit } from 'lodash' -import { ICommonObject, IDocument, INode, INodeData, INodeParams } from '../../../src/Interface' +import { ICommonObject, IDocument, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface' import { TextSplitter } from 'langchain/text_splitter' import { CSVLoader } from 'langchain/document_loaders/fs/csv' -import { getFileFromStorage } from '../../../src' +import { getFileFromStorage, handleEscapeCharacters } from '../../../src' class Csv_DocumentLoaders implements INode { label: string @@ -14,11 +14,12 @@ class Csv_DocumentLoaders implements INode { category: string baseClasses: string[] inputs: INodeParams[] + outputs: INodeOutputsValue[] constructor() { this.label = 'Csv File' this.name = 'csvFile' - this.version = 1.0 + this.version = 2.0 this.type = 'Document' this.icon = 'csv.svg' this.category = 'Document Loaders' @@ -65,6 +66,20 @@ class Csv_DocumentLoaders implements INode { additionalParams: true } ] + this.outputs = [ + { + label: 'Document', + name: 'document', + description: 'Array of document objects containing metadata and pageContent', + baseClasses: [...this.baseClasses, 'json'] + }, + { + label: 'Text', + name: 'text', + description: 'Concatenated string from pageContent of documents', + baseClasses: ['string', 'json'] + } + ] } async init(nodeData: INodeData, _: string, options: ICommonObject): Promise { @@ -72,6 +87,7 @@ class Csv_DocumentLoaders implements INode { const csvFileBase64 = nodeData.inputs?.csvFile as string const columnName = nodeData.inputs?.columnName as string const metadata = nodeData.inputs?.metadata + const output = nodeData.outputs?.output as string const _omitMetadataKeys = nodeData.inputs?.omitMetadataKeys as string let omitMetadataKeys: string[] = [] @@ -156,7 +172,15 @@ class Csv_DocumentLoaders implements INode { })) } - return docs + if (output === 'document') { + return docs + } else { + let finaltext = '' + for (const doc of docs) { + finaltext += `${doc.pageContent}\n` + } + return handleEscapeCharacters(finaltext, false) + } } } diff --git a/packages/components/nodes/multiagents/Supervisor/Supervisor.ts b/packages/components/nodes/multiagents/Supervisor/Supervisor.ts new file mode 100644 index 00000000..0a799d9a --- /dev/null +++ b/packages/components/nodes/multiagents/Supervisor/Supervisor.ts @@ -0,0 +1,454 @@ +import { flatten } from 'lodash' +import { BaseChatModel } from '@langchain/core/language_models/chat_models' +import { Runnable, RunnableConfig } from '@langchain/core/runnables' +import { ChatPromptTemplate, MessagesPlaceholder, HumanMessagePromptTemplate } from '@langchain/core/prompts' +import { + ICommonObject, + IMultiAgentNode, + INode, + INodeData, + INodeParams, + ITeamState, + IVisionChatModal, + MessageContentImageUrl +} from '../../../src/Interface' +import { Moderation } from '../../moderation/Moderation' +import { z } from 'zod' +import { StructuredTool } from '@langchain/core/tools' +import { AgentExecutor, JsonOutputToolsParser, ToolCallingAgentOutputParser } from '../../../src/agents' +import { ChatMistralAI } from '@langchain/mistralai' +import { ChatOpenAI } from '../../chatmodels/ChatOpenAI/FlowiseChatOpenAI' +import { ChatAnthropic } from '../../chatmodels/ChatAnthropic/FlowiseChatAnthropic' +import { ChatGoogleGenerativeAI } from '../../chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI' +import { addImagesToMessages, llmSupportsVision } from '../../../src/multiModalUtils' + +const sysPrompt = `You are a supervisor tasked with managing a conversation between the following workers: {team_members}. +Given the following user request, respond with the worker to act next. +Each worker will perform a task and respond with their results and status. +When finished, respond with FINISH. +Select strategically to minimize the number of steps taken.` + +const routerToolName = 'route' + +class Supervisor_MultiAgents implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + credential: INodeParams + inputs?: INodeParams[] + badge?: string + + constructor() { + this.label = 'Supervisor' + this.name = 'supervisor' + this.version = 1.0 + this.type = 'Supervisor' + this.icon = 'supervisor.svg' + this.category = 'Multi Agents' + this.baseClasses = [this.type] + this.inputs = [ + { + label: 'Supervisor Name', + name: 'supervisorName', + type: 'string', + placeholder: 'Supervisor', + default: 'Supervisor' + }, + { + label: 'Supervisor Prompt', + name: 'supervisorPrompt', + type: 'string', + description: 'Prompt must contains {team_members}', + rows: 4, + default: sysPrompt, + additionalParams: true + }, + { + label: 'Tool Calling Chat Model', + name: 'model', + type: 'BaseChatModel', + description: `Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model` + }, + { + label: 'Recursion Limit', + name: 'recursionLimit', + type: 'number', + description: 'Maximum number of times a call can recurse. If not provided, defaults to 100.', + default: 100, + additionalParams: true + }, + { + label: 'Input Moderation', + description: 'Detect text that could generate harmful output and prevent it from being sent to the language model', + name: 'inputModeration', + type: 'Moderation', + optional: true, + list: true + } + ] + } + + async init(nodeData: INodeData, _: string, options: ICommonObject): Promise { + const llm = nodeData.inputs?.model as BaseChatModel + const supervisorPrompt = nodeData.inputs?.supervisorPrompt as string + const supervisorLabel = nodeData.inputs?.supervisorName as string + const _recursionLimit = nodeData.inputs?.recursionLimit as string + const recursionLimit = _recursionLimit ? parseFloat(_recursionLimit) : 100 + const moderations = (nodeData.inputs?.inputModeration as Moderation[]) ?? [] + + const abortControllerSignal = options.signal as AbortController + + const workersNodes: IMultiAgentNode[] = + nodeData.inputs?.workerNodes && nodeData.inputs?.workerNodes.length ? flatten(nodeData.inputs?.workerNodes) : [] + const workersNodeNames = workersNodes.map((node: IMultiAgentNode) => node.name) + + if (!supervisorLabel) throw new Error('Supervisor name is required!') + + const supervisorName = supervisorLabel.toLowerCase().replace(/\s/g, '_').trim() + + let multiModalMessageContent: MessageContentImageUrl[] = [] + + async function createTeamSupervisor(llm: BaseChatModel, systemPrompt: string, members: string[]): Promise { + const memberOptions = ['FINISH', ...members] + + systemPrompt = systemPrompt.replaceAll('{team_members}', members.join(', ')) + + let userPrompt = `Given the conversation above, who should act next? Or should we FINISH? Select one of: ${memberOptions.join( + ', ' + )}` + + const tool = new RouteTool({ + schema: z.object({ + reasoning: z.string(), + next: z.enum(['FINISH', ...members]), + instructions: z.string().describe('The specific instructions of the sub-task the next role should accomplish.') + }) + }) + + let supervisor + + if (llm instanceof ChatMistralAI) { + let prompt = ChatPromptTemplate.fromMessages([ + ['system', systemPrompt], + new MessagesPlaceholder('messages'), + ['human', userPrompt] + ]) + + const messages = await processImageMessage(1, llm, prompt, nodeData, options) + prompt = messages.prompt + multiModalMessageContent = messages.multiModalMessageContent + + // Force Mistral to use tool + const modelWithTool = llm.bind({ + tools: [tool], + tool_choice: 'any', + signal: abortControllerSignal ? abortControllerSignal.signal : undefined + }) + + const outputParser = new JsonOutputToolsParser() + + supervisor = prompt + .pipe(modelWithTool) + .pipe(outputParser) + .pipe((x) => { + if (Array.isArray(x) && x.length) { + const toolAgentAction = x[0] + return { + next: Object.keys(toolAgentAction.args).length ? toolAgentAction.args.next : 'FINISH', + instructions: Object.keys(toolAgentAction.args).length + ? toolAgentAction.args.instructions + : 'Conversation finished', + team_members: members.join(', ') + } + } else { + return { + next: 'FINISH', + instructions: 'Conversation finished', + team_members: members.join(', ') + } + } + }) + } else if (llm instanceof ChatAnthropic) { + // Force Anthropic to use tool : https://docs.anthropic.com/claude/docs/tool-use#forcing-tool-use + userPrompt = `Given the conversation above, who should act next? Or should we FINISH? Select one of: ${memberOptions.join( + ', ' + )}. Use the ${routerToolName} tool in your response.` + + let prompt = ChatPromptTemplate.fromMessages([ + ['system', systemPrompt], + new MessagesPlaceholder('messages'), + ['human', userPrompt] + ]) + + const messages = await processImageMessage(1, llm, prompt, nodeData, options) + prompt = messages.prompt + multiModalMessageContent = messages.multiModalMessageContent + + if (llm.bindTools === undefined) { + throw new Error(`This agent only compatible with function calling models.`) + } + + const modelWithTool = llm.bindTools([tool]) + + const outputParser = new ToolCallingAgentOutputParser() + + supervisor = prompt + .pipe(modelWithTool) + .pipe(outputParser) + .pipe((x) => { + if (Array.isArray(x) && x.length) { + const toolAgentAction = x[0] as any + return { + next: toolAgentAction.toolInput.next, + instructions: toolAgentAction.toolInput.instructions, + team_members: members.join(', ') + } + } else if (typeof x === 'object' && 'returnValues' in x) { + return { + next: 'FINISH', + instructions: x.returnValues?.output, + team_members: members.join(', ') + } + } else { + return { + next: 'FINISH', + instructions: 'Conversation finished', + team_members: members.join(', ') + } + } + }) + } else if (llm instanceof ChatOpenAI) { + let prompt = ChatPromptTemplate.fromMessages([ + ['system', systemPrompt], + new MessagesPlaceholder('messages'), + ['human', userPrompt] + ]) + + const messages = await processImageMessage(1, llm, prompt, nodeData, options) + prompt = messages.prompt + multiModalMessageContent = messages.multiModalMessageContent + + // Force OpenAI to use tool + const modelWithTool = llm.bind({ + tools: [tool], + tool_choice: { type: 'function', function: { name: routerToolName } }, + signal: abortControllerSignal ? abortControllerSignal.signal : undefined + }) + + const outputParser = new ToolCallingAgentOutputParser() + + supervisor = prompt + .pipe(modelWithTool) + .pipe(outputParser) + .pipe((x) => { + if (Array.isArray(x) && x.length) { + const toolAgentAction = x[0] as any + return { + next: toolAgentAction.toolInput.next, + instructions: toolAgentAction.toolInput.instructions, + team_members: members.join(', ') + } + } else if (typeof x === 'object' && 'returnValues' in x) { + return { + next: 'FINISH', + instructions: x.returnValues?.output, + team_members: members.join(', ') + } + } else { + return { + next: 'FINISH', + instructions: 'Conversation finished', + team_members: members.join(', ') + } + } + }) + } else if (llm instanceof ChatGoogleGenerativeAI) { + /* + * Gemini doesn't have system message and messages have to be alternate between model and user + * So we have to place the system + human prompt at last + */ + let prompt = ChatPromptTemplate.fromMessages([ + ['human', systemPrompt], + ['ai', ''], + new MessagesPlaceholder('messages'), + ['ai', ''], + ['human', userPrompt] + ]) + + const messages = await processImageMessage(2, llm, prompt, nodeData, options) + prompt = messages.prompt + multiModalMessageContent = messages.multiModalMessageContent + + if (llm.bindTools === undefined) { + throw new Error(`This agent only compatible with function calling models.`) + } + const modelWithTool = llm.bindTools([tool]) + + const outputParser = new ToolCallingAgentOutputParser() + + supervisor = prompt + .pipe(modelWithTool) + .pipe(outputParser) + .pipe((x) => { + if (Array.isArray(x) && x.length) { + const toolAgentAction = x[0] as any + return { + next: toolAgentAction.toolInput.next, + instructions: toolAgentAction.toolInput.instructions, + team_members: members.join(', ') + } + } else if (typeof x === 'object' && 'returnValues' in x) { + return { + next: 'FINISH', + instructions: x.returnValues?.output, + team_members: members.join(', ') + } + } else { + return { + next: 'FINISH', + instructions: 'Conversation finished', + team_members: members.join(', ') + } + } + }) + } else { + let prompt = ChatPromptTemplate.fromMessages([ + ['system', systemPrompt], + new MessagesPlaceholder('messages'), + ['human', userPrompt] + ]) + + const messages = await processImageMessage(1, llm, prompt, nodeData, options) + prompt = messages.prompt + multiModalMessageContent = messages.multiModalMessageContent + + if (llm.bindTools === undefined) { + throw new Error(`This agent only compatible with function calling models.`) + } + const modelWithTool = llm.bindTools([tool]) + + const outputParser = new ToolCallingAgentOutputParser() + + supervisor = prompt + .pipe(modelWithTool) + .pipe(outputParser) + .pipe((x) => { + if (Array.isArray(x) && x.length) { + const toolAgentAction = x[0] as any + return { + next: toolAgentAction.toolInput.next, + instructions: toolAgentAction.toolInput.instructions, + team_members: members.join(', ') + } + } else if (typeof x === 'object' && 'returnValues' in x) { + return { + next: 'FINISH', + instructions: x.returnValues?.output, + team_members: members.join(', ') + } + } else { + return { + next: 'FINISH', + instructions: 'Conversation finished', + team_members: members.join(', ') + } + } + }) + } + + return supervisor + } + + const supervisorAgent = await createTeamSupervisor(llm, supervisorPrompt ? supervisorPrompt : sysPrompt, workersNodeNames) + + const supervisorNode = async (state: ITeamState, config: RunnableConfig) => + await agentNode( + { + state, + agent: supervisorAgent, + abortControllerSignal + }, + config + ) + + const returnOutput: IMultiAgentNode = { + node: supervisorNode, + name: supervisorName ?? 'supervisor', + label: supervisorLabel ?? 'Supervisor', + type: 'supervisor', + workers: workersNodeNames, + recursionLimit, + llm, + moderations, + multiModalMessageContent + } + + return returnOutput + } +} + +async function agentNode( + { state, agent, abortControllerSignal }: { state: ITeamState; agent: AgentExecutor | Runnable; abortControllerSignal: AbortController }, + config: RunnableConfig +) { + try { + if (abortControllerSignal.signal.aborted) { + throw new Error('Aborted!') + } + const result = await agent.invoke({ ...state, signal: abortControllerSignal.signal }, config) + return result + } catch (error) { + throw new Error('Aborted!') + } +} + +const processImageMessage = async ( + index: number, + llm: BaseChatModel, + prompt: ChatPromptTemplate, + nodeData: INodeData, + options: ICommonObject +) => { + let multiModalMessageContent: MessageContentImageUrl[] = [] + + if (llmSupportsVision(llm)) { + const visionChatModel = llm as IVisionChatModal + multiModalMessageContent = await addImagesToMessages(nodeData, options, llm.multiModalOption) + + if (multiModalMessageContent?.length) { + visionChatModel.setVisionModel() + + const msg = HumanMessagePromptTemplate.fromTemplate([...multiModalMessageContent]) + + prompt.promptMessages.splice(index, 0, msg) + } else { + visionChatModel.revertToOriginalModel() + } + } + + return { prompt, multiModalMessageContent } +} + +class RouteTool extends StructuredTool { + name = routerToolName + + description = 'Select the worker to act next' + + schema + + constructor(fields: ICommonObject) { + super() + this.schema = fields.schema + } + + async _call(input: any) { + return JSON.stringify(input) + } +} + +module.exports = { nodeClass: Supervisor_MultiAgents } diff --git a/packages/components/nodes/multiagents/Supervisor/supervisor.svg b/packages/components/nodes/multiagents/Supervisor/supervisor.svg new file mode 100644 index 00000000..66ade206 --- /dev/null +++ b/packages/components/nodes/multiagents/Supervisor/supervisor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/nodes/multiagents/Worker/Worker.ts b/packages/components/nodes/multiagents/Worker/Worker.ts new file mode 100644 index 00000000..ffa45695 --- /dev/null +++ b/packages/components/nodes/multiagents/Worker/Worker.ts @@ -0,0 +1,291 @@ +import { flatten } from 'lodash' +import { RunnableSequence, RunnablePassthrough, RunnableConfig } from '@langchain/core/runnables' +import { ChatPromptTemplate, MessagesPlaceholder, HumanMessagePromptTemplate } from '@langchain/core/prompts' +import { BaseChatModel } from '@langchain/core/language_models/chat_models' +import { HumanMessage } from '@langchain/core/messages' +import { formatToOpenAIToolMessages } from 'langchain/agents/format_scratchpad/openai_tools' +import { type ToolsAgentStep } from 'langchain/agents/openai/output_parser' +import { INode, INodeData, INodeParams, IMultiAgentNode, ITeamState, ICommonObject, MessageContentImageUrl } from '../../../src/Interface' +import { ToolCallingAgentOutputParser, AgentExecutor } from '../../../src/agents' +import { StringOutputParser } from '@langchain/core/output_parsers' +import { getInputVariables, handleEscapeCharacters } from '../../../src/utils' + +const examplePrompt = 'You are a research assistant who can search for up-to-date info using search engine.' + +class Worker_MultiAgents implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + inputs?: INodeParams[] + badge?: string + + constructor() { + this.label = 'Worker' + this.name = 'worker' + this.version = 1.0 + this.type = 'Worker' + this.icon = 'worker.svg' + this.category = 'Multi Agents' + this.baseClasses = [this.type] + this.inputs = [ + { + label: 'Worker Name', + name: 'workerName', + type: 'string', + placeholder: 'Worker' + }, + { + label: 'Worker Prompt', + name: 'workerPrompt', + type: 'string', + rows: 4, + default: examplePrompt + }, + { + label: 'Tools', + name: 'tools', + type: 'Tool', + list: true, + optional: true + }, + { + label: 'Supervisor', + name: 'supervisor', + type: 'Supervisor' + }, + { + label: 'Tool Calling Chat Model', + name: 'model', + type: 'BaseChatModel', + optional: true, + description: `Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used` + }, + { + label: 'Format Prompt Values', + name: 'promptValues', + type: 'json', + optional: true, + acceptVariable: true, + list: true + }, + { + label: 'Max Iterations', + name: 'maxIterations', + type: 'number', + optional: true + } + ] + } + + async init(nodeData: INodeData, input: string, options: ICommonObject): Promise { + let tools = nodeData.inputs?.tools + tools = flatten(tools) + let workerPrompt = nodeData.inputs?.workerPrompt as string + const workerLabel = nodeData.inputs?.workerName as string + const supervisor = nodeData.inputs?.supervisor as IMultiAgentNode + const maxIterations = nodeData.inputs?.maxIterations as string + const model = nodeData.inputs?.model as BaseChatModel + const promptValuesStr = nodeData.inputs?.promptValues + + if (!workerLabel) throw new Error('Worker name is required!') + const workerName = workerLabel.toLowerCase().replace(/\s/g, '_').trim() + + if (!workerPrompt) throw new Error('Worker prompt is required!') + + let workerInputVariablesValues: ICommonObject = {} + if (promptValuesStr) { + try { + workerInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr) + } catch (exception) { + throw new Error("Invalid JSON in the Worker's Prompt Input Values: " + exception) + } + } + workerInputVariablesValues = handleEscapeCharacters(workerInputVariablesValues, true) + + const llm = model || (supervisor.llm as BaseChatModel) + const multiModalMessageContent = supervisor?.multiModalMessageContent || [] + + const abortControllerSignal = options.signal as AbortController + const workerInputVariables = getInputVariables(workerPrompt) + + if (!workerInputVariables.every((element) => Object.keys(workerInputVariablesValues).includes(element))) { + throw new Error('Worker input variables values are not provided!') + } + + const agent = await createAgent( + llm, + [...tools], + workerPrompt, + multiModalMessageContent, + workerInputVariablesValues, + maxIterations, + { + sessionId: options.sessionId, + chatId: options.chatId, + input + } + ) + + const workerNode = async (state: ITeamState, config: RunnableConfig) => + await agentNode( + { + state, + agent: agent, + name: workerName, + abortControllerSignal + }, + config + ) + + const returnOutput: IMultiAgentNode = { + node: workerNode, + name: workerName, + label: workerLabel, + type: 'worker', + workerPrompt, + workerInputVariables, + parentSupervisorName: supervisor.name ?? 'supervisor' + } + + return returnOutput + } +} + +async function createAgent( + llm: BaseChatModel, + tools: any[], + systemPrompt: string, + multiModalMessageContent: MessageContentImageUrl[], + workerInputVariablesValues: ICommonObject, + maxIterations?: string, + flowObj?: { sessionId?: string; chatId?: string; input?: string } +): Promise { + if (tools.length) { + const combinedPrompt = + systemPrompt + + '\nWork autonomously according to your specialty, using the tools available to you.' + + ' Do not ask for clarification.' + + ' Your other team members (and other teams) will collaborate with you with their own specialties.' + + ' You are chosen for a reason! You are one of the following team members: {team_members}.' + + //const toolNames = tools.length ? tools.map((t) => t.name).join(', ') : '' + const prompt = ChatPromptTemplate.fromMessages([ + ['system', combinedPrompt], + new MessagesPlaceholder('messages'), + new MessagesPlaceholder('agent_scratchpad') + /* Gettind rid of this for now because other LLMs dont support system message at later stage + [ + 'system', + [ + 'Supervisor instructions: {instructions}\n' + tools.length + ? `Remember, you individually can only use these tools: ${toolNames}` + : '' + '\n\nEnd if you have already completed the requested task. Communicate the work completed.' + ].join('\n') + ]*/ + ]) + + if (multiModalMessageContent.length) { + const msg = HumanMessagePromptTemplate.fromTemplate([...multiModalMessageContent]) + prompt.promptMessages.splice(1, 0, msg) + } + + if (llm.bindTools === undefined) { + throw new Error(`This agent only compatible with function calling models.`) + } + const modelWithTools = llm.bindTools(tools) + + const agent = RunnableSequence.from([ + RunnablePassthrough.assign({ + //@ts-ignore + agent_scratchpad: (input: { steps: ToolsAgentStep[] }) => formatToOpenAIToolMessages(input.steps) + }), + RunnablePassthrough.assign(transformObjectPropertyToFunction(workerInputVariablesValues)), + prompt, + modelWithTools, + new ToolCallingAgentOutputParser() + ]) + + const executor = AgentExecutor.fromAgentAndTools({ + agent: agent, + tools, + sessionId: flowObj?.sessionId, + chatId: flowObj?.chatId, + input: flowObj?.input, + verbose: process.env.DEBUG === 'true' ? true : false, + maxIterations: maxIterations ? parseFloat(maxIterations) : undefined + }) + return executor + } else { + const combinedPrompt = + systemPrompt + + '\nWork autonomously according to your specialty, using the tools available to you.' + + ' Do not ask for clarification.' + + ' Your other team members (and other teams) will collaborate with you with their own specialties.' + + ' You are chosen for a reason! You are one of the following team members: {team_members}.' + + const prompt = ChatPromptTemplate.fromMessages([['system', combinedPrompt], new MessagesPlaceholder('messages')]) + if (multiModalMessageContent.length) { + const msg = HumanMessagePromptTemplate.fromTemplate([...multiModalMessageContent]) + prompt.promptMessages.splice(1, 0, msg) + } + const conversationChain = RunnableSequence.from([ + RunnablePassthrough.assign(transformObjectPropertyToFunction(workerInputVariablesValues)), + prompt, + llm, + new StringOutputParser() + ]) + return conversationChain + } +} + +async function agentNode( + { + state, + agent, + name, + abortControllerSignal + }: { state: ITeamState; agent: AgentExecutor | RunnableSequence; name: string; abortControllerSignal: AbortController }, + config: RunnableConfig +) { + try { + if (abortControllerSignal.signal.aborted) { + throw new Error('Aborted!') + } + const result = await agent.invoke({ ...state, signal: abortControllerSignal.signal }, config) + const additional_kwargs: ICommonObject = {} + if (result.usedTools) { + additional_kwargs.usedTools = result.usedTools + } + if (result.sourceDocuments) { + additional_kwargs.sourceDocuments = result.sourceDocuments + } + return { + messages: [ + new HumanMessage({ + content: typeof result === 'string' ? result : result.output, + name, + additional_kwargs: Object.keys(additional_kwargs).length ? additional_kwargs : undefined + }) + ] + } + } catch (error) { + throw new Error('Aborted!') + } +} + +const transformObjectPropertyToFunction = (obj: ICommonObject) => { + const transformedObject: ICommonObject = {} + + for (const key in obj) { + transformedObject[key] = () => obj[key] + } + + return transformedObject +} + +module.exports = { nodeClass: Worker_MultiAgents } diff --git a/packages/components/nodes/multiagents/Worker/worker.svg b/packages/components/nodes/multiagents/Worker/worker.svg new file mode 100644 index 00000000..671bc020 --- /dev/null +++ b/packages/components/nodes/multiagents/Worker/worker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts b/packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts new file mode 100644 index 00000000..a718a093 --- /dev/null +++ b/packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts @@ -0,0 +1,259 @@ +import { DataSource } from 'typeorm' +import { z } from 'zod' +import fetch from 'node-fetch' +import { RunnableConfig } from '@langchain/core/runnables' +import { CallbackManagerForToolRun, Callbacks, CallbackManager, parseCallbackConfigArg } from '@langchain/core/callbacks/manager' +import { StructuredTool } from '@langchain/core/tools' +import { ICommonObject, IDatabaseEntity, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface' +import { getCredentialData, getCredentialParam } from '../../../src/utils' + +class ChatflowTool_Tools implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + credential: INodeParams + inputs: INodeParams[] + + constructor() { + this.label = 'Chatflow Tool' + this.name = 'ChatflowTool' + this.version = 1.0 + this.type = 'ChatflowTool' + this.icon = 'chatflowTool.svg' + this.category = 'Tools' + this.description = 'Use as a tool to execute another chatflow' + this.baseClasses = [this.type, 'Tool'] + this.credential = { + label: 'Connect Credential', + name: 'credential', + type: 'credential', + credentialNames: ['chatflowApi'], + optional: true + } + this.inputs = [ + { + label: 'Select Chatflow', + name: 'selectedChatflow', + type: 'asyncOptions', + loadMethod: 'listChatflows' + }, + { + label: 'Tool Name', + name: 'name', + type: 'string' + }, + { + label: 'Tool Description', + name: 'description', + type: 'string', + description: 'Description of what the tool does. This is for LLM to determine when to use this tool.', + rows: 3, + placeholder: + 'State of the Union QA - useful for when you need to ask questions about the most recent state of the union address.' + }, + { + label: 'Use Question from Chat', + name: 'useQuestionFromChat', + type: 'boolean', + description: + 'Whether to use the question from the chat as input to the chatflow. If turned on, this will override the custom input.', + optional: true, + additionalParams: true + }, + { + label: 'Custom Input', + name: 'customInput', + type: 'string', + description: 'Custom input to be passed to the chatflow. Leave empty to let LLM decides the input.', + optional: true, + additionalParams: true + } + ] + } + + //@ts-ignore + loadMethods = { + async listChatflows(_: INodeData, options: ICommonObject): Promise { + const returnData: INodeOptionsValue[] = [] + + const appDataSource = options.appDataSource as DataSource + const databaseEntities = options.databaseEntities as IDatabaseEntity + if (appDataSource === undefined || !appDataSource) { + return returnData + } + + const chatflows = await appDataSource.getRepository(databaseEntities['ChatFlow']).find() + + for (let i = 0; i < chatflows.length; i += 1) { + const data = { + label: chatflows[i].name, + name: chatflows[i].id + } as INodeOptionsValue + returnData.push(data) + } + return returnData + } + } + + async init(nodeData: INodeData, input: string, options: ICommonObject): Promise { + const selectedChatflowId = nodeData.inputs?.selectedChatflow as string + const _name = nodeData.inputs?.name as string + const description = nodeData.inputs?.description as string + const useQuestionFromChat = nodeData.inputs?.useQuestionFromChat as boolean + const customInput = nodeData.inputs?.customInput as string + + const baseURL = options.baseURL as string + + const credentialData = await getCredentialData(nodeData.credential ?? '', options) + const chatflowApiKey = getCredentialParam('chatflowApiKey', credentialData, nodeData) + + let headers = {} + if (chatflowApiKey) headers = { Authorization: `Bearer ${chatflowApiKey}` } + + let toolInput = '' + if (useQuestionFromChat) { + toolInput = input + } else if (!customInput) { + toolInput = customInput + } + + let name = _name || 'chatflow_tool' + + return new ChatflowTool({ name, baseURL, description, chatflowid: selectedChatflowId, headers, input: toolInput }) + } +} + +class ChatflowTool extends StructuredTool { + static lc_name() { + return 'ChatflowTool' + } + + name = 'chatflow_tool' + + description = 'Execute another chatflow' + + input = '' + + chatflowid = '' + + baseURL = 'http://localhost:3000' + + headers = {} + + schema = z.object({ + input: z.string().describe('input question') + }) + + constructor({ + name, + description, + input, + chatflowid, + baseURL, + headers + }: { + name: string + description: string + input: string + chatflowid: string + baseURL: string + headers: ICommonObject + }) { + super() + this.name = name + this.description = description + this.input = input + this.baseURL = baseURL + this.headers = headers + this.chatflowid = chatflowid + } + + async call( + arg: z.infer, + configArg?: RunnableConfig | Callbacks, + tags?: string[], + flowConfig?: { sessionId?: string; chatId?: string; input?: string } + ): Promise { + const config = parseCallbackConfigArg(configArg) + if (config.runName === undefined) { + config.runName = this.name + } + let parsed + try { + parsed = await this.schema.parseAsync(arg) + } catch (e) { + throw new Error(`Received tool input did not match expected schema: ${JSON.stringify(arg)}`) + } + const callbackManager_ = await CallbackManager.configure( + config.callbacks, + this.callbacks, + config.tags || tags, + this.tags, + config.metadata, + this.metadata, + { verbose: this.verbose } + ) + const runManager = await callbackManager_?.handleToolStart( + this.toJSON(), + typeof parsed === 'string' ? parsed : JSON.stringify(parsed), + undefined, + undefined, + undefined, + undefined, + config.runName + ) + let result + try { + result = await this._call(parsed, runManager, flowConfig) + } catch (e) { + await runManager?.handleToolError(e) + throw e + } + await runManager?.handleToolEnd(result) + return result + } + + // @ts-ignore + protected async _call( + arg: z.infer, + _?: CallbackManagerForToolRun, + flowConfig?: { sessionId?: string; chatId?: string; input?: string } + ): Promise { + const inputQuestion = this.input || arg.input + + const url = `${this.baseURL}/api/v1/prediction/${this.chatflowid}` + + const body = { + question: inputQuestion, + chatId: flowConfig?.chatId, + overrideConfig: { + sessionId: flowConfig?.sessionId + } + } + + const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + ...this.headers + }, + body: JSON.stringify(body) + } + + try { + const response = await fetch(url, options) + const resp = await response.json() + return resp.text || '' + } catch (error) { + console.error(error) + return '' + } + } +} + +module.exports = { nodeClass: ChatflowTool_Tools } diff --git a/packages/components/nodes/tools/ChatflowTool/chatflowTool.svg b/packages/components/nodes/tools/ChatflowTool/chatflowTool.svg new file mode 100644 index 00000000..d61683d7 --- /dev/null +++ b/packages/components/nodes/tools/ChatflowTool/chatflowTool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/nodes/tools/E2B/E2B.ts b/packages/components/nodes/tools/E2B/E2B.ts new file mode 100644 index 00000000..1245ddf5 --- /dev/null +++ b/packages/components/nodes/tools/E2B/E2B.ts @@ -0,0 +1,152 @@ +/* +* TODO: Implement codeInterpreter column to chat_message table +import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface' +import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' +import { StructuredTool, ToolParams } from '@langchain/core/tools' +import { CodeInterpreter } from '@e2b/code-interpreter' +import { z } from 'zod' + +const DESC = `Evaluates python code in a sandbox environment. \ +The environment is long running and exists across multiple executions. \ +You must send the whole script every time and print your outputs. \ +Script should be pure python code that can be evaluated. \ +It should be in python format NOT markdown. \ +The code should NOT be wrapped in backticks. \ +All python packages including requests, matplotlib, scipy, numpy, pandas, \ +etc are available. Create and display chart using "plt.show()".` +const NAME = 'code_interpreter' + +class E2B_Tools implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + inputs: INodeParams[] + badge: string + credential: INodeParams + + constructor() { + this.label = 'E2B' + this.name = 'e2b' + this.version = 1.0 + this.type = 'E2B' + this.icon = 'e2b.png' + this.category = 'Tools' + this.badge = 'NEW' + this.description = 'Execute code in E2B Code Intepreter' + this.baseClasses = [this.type, 'Tool', ...getBaseClasses(E2BTool)] + this.credential = { + label: 'Connect Credential', + name: 'credential', + type: 'credential', + credentialNames: ['E2BApi'] + } + this.inputs = [ + { + label: 'Tool Name', + name: 'toolName', + type: 'string', + description: 'Specify the name of the tool', + default: 'code_interpreter' + }, + { + label: 'Tool Description', + name: 'toolDesc', + type: 'string', + rows: 4, + description: 'Specify the description of the tool', + default: DESC + } + ] + } + + async init(nodeData: INodeData, _: string, options: ICommonObject): Promise { + const toolDesc = nodeData.inputs?.toolDesc as string + const toolName = nodeData.inputs?.toolName as string + const credentialData = await getCredentialData(nodeData.credential ?? '', options) + const e2bApiKey = getCredentialParam('e2bApiKey', credentialData, nodeData) + const socketIO = options.socketIO + const socketIOClientId = options.socketIOClientId + + return await E2BTool.initialize({ + description: toolDesc ?? DESC, + name: toolName ?? NAME, + apiKey: e2bApiKey, + schema: z.object({ + input: z.string().describe('Python code to be executed in the sandbox environment') + }), + socketIO, + socketIOClientId + }) + } +} + +type E2BToolParams = ToolParams & { instance: CodeInterpreter } + +export class E2BTool extends StructuredTool { + static lc_name() { + return 'E2BTool' + } + + name = NAME + + description = DESC + + instance: CodeInterpreter + + apiKey: string + + schema + + socketIO + + socketIOClientId = '' + + constructor(options: E2BToolParams & { name: string; description: string, apiKey: string, schema: any, socketIO: any, socketIOClientId: string}) { + super(options) + this.instance = options.instance + this.description = options.description + this.name = options.name + this.apiKey = options.apiKey + this.schema = options.schema + this.returnDirect = true + this.socketIO = options.socketIO + this.socketIOClientId = options.socketIOClientId + } + + static async initialize(options: Partial & { name: string; description: string, apiKey: string, schema: any, socketIO: any, socketIOClientId: string }) { + const instance = await CodeInterpreter.create({ apiKey: options.apiKey }) + return new this({ instance, name: options.name, description: options.description, apiKey: options.apiKey, schema: options.schema, socketIO: options.socketIO, socketIOClientId: options.socketIOClientId}) + } + + async _call(args: any) { + try { + if ('input' in args) { + const execution = await this.instance.notebook.execCell(args?.input) + let imgHTML = '' + for (const result of execution.results) { + if (result.png) { + imgHTML += `\n\nimage
` + } + if (result.jpeg) { + imgHTML += `\n\nimage
` + } + } + const output = execution.text ? execution.text + imgHTML : imgHTML + if (this.socketIO && this.socketIOClientId) this.socketIO.to(this.socketIOClientId).emit('token', output) + return output + } else { + return 'No input provided' + } + } catch (e) { + return typeof e === 'string' ? e : JSON.stringify(e, null, 2) + } + } +} + +module.exports = { nodeClass: E2B_Tools } +*/ diff --git a/packages/components/nodes/tools/E2B/e2b.png b/packages/components/nodes/tools/E2B/e2b.png new file mode 100644 index 00000000..1b24b58e Binary files /dev/null and b/packages/components/nodes/tools/E2B/e2b.png differ diff --git a/packages/components/nodes/tools/PythonInterpreter/PythonInterpreter.ts b/packages/components/nodes/tools/PythonInterpreter/PythonInterpreter.ts new file mode 100644 index 00000000..08f87738 --- /dev/null +++ b/packages/components/nodes/tools/PythonInterpreter/PythonInterpreter.ts @@ -0,0 +1,128 @@ +import { INode, INodeData, INodeParams } from '../../../src/Interface' +import { getBaseClasses } from '../../../src/utils' +import { loadPyodide, type PyodideInterface } from 'pyodide' +import { Tool, ToolParams } from '@langchain/core/tools' +import * as path from 'path' +import { getUserHome } from '../../../src/utils' + +let pyodideInstance: PyodideInterface | undefined +const DESC = `Evaluates python code in a sandbox environment. The environment resets on every execution. You must send the whole script every time and print your outputs. Script should be pure python code that can be evaluated. Use only packages available in Pyodide.` +const NAME = 'python_interpreter' + +async function LoadPyodide(): Promise { + if (pyodideInstance === undefined) { + const obj = { packageCacheDir: path.join(getUserHome(), '.flowise', 'pyodideCacheDir') } + pyodideInstance = await loadPyodide(obj) + } + return pyodideInstance +} + +class PythonInterpreter_Tools implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + inputs: INodeParams[] + badge: string + + constructor() { + this.label = 'Python Interpreter' + this.name = 'pythonInterpreter' + this.version = 1.0 + this.type = 'PythonInterpreter' + this.icon = 'python.svg' + this.category = 'Tools' + this.badge = 'NEW' + this.description = 'Execute python code in Pyodide sandbox environment' + this.baseClasses = [this.type, 'Tool', ...getBaseClasses(PythonInterpreterTool)] + this.inputs = [ + { + label: 'Tool Name', + name: 'toolName', + type: 'string', + description: 'Specify the name of the tool', + default: 'python_interpreter' + }, + { + label: 'Tool Description', + name: 'toolDesc', + type: 'string', + rows: 4, + description: 'Specify the description of the tool', + default: DESC + } + ] + } + + async init(nodeData: INodeData): Promise { + const toolDesc = nodeData.inputs?.toolDesc as string + const toolName = nodeData.inputs?.toolName as string + + return await PythonInterpreterTool.initialize({ + description: toolDesc ?? DESC, + name: toolName ?? NAME + }) + } +} + +type PythonInterpreterToolParams = Parameters[0] & + ToolParams & { + instance: PyodideInterface + } + +export class PythonInterpreterTool extends Tool { + static lc_name() { + return 'PythonInterpreterTool' + } + + name = NAME + + description = DESC + + pyodideInstance: PyodideInterface + + stdout = '' + + stderr = '' + + constructor(options: PythonInterpreterToolParams & { name: string; description: string }) { + super(options) + this.description = options.description + this.name = options.name + this.pyodideInstance = options.instance + this.pyodideInstance.setStderr({ + batched: (text: string) => { + this.stderr += text + } + }) + this.pyodideInstance.setStdout({ + batched: (text: string) => { + this.stdout += text + } + }) + } + + static async initialize(options: Partial & { name: string; description: string }) { + const instance = await LoadPyodide() + return new this({ instance, name: options.name, description: options.description }) + } + + async _call(script: string) { + this.stdout = '' + this.stderr = '' + + try { + await this.pyodideInstance.loadPackagesFromImports(script) + await this.pyodideInstance.runPythonAsync(script) + return JSON.stringify({ stdout: this.stdout, stderr: this.stderr }, null, 2) + } catch (e) { + return typeof e === 'string' ? e : JSON.stringify(e, null, 2) + } + } +} + +module.exports = { nodeClass: PythonInterpreter_Tools } diff --git a/packages/components/nodes/tools/PythonInterpreter/python.svg b/packages/components/nodes/tools/PythonInterpreter/python.svg new file mode 100644 index 00000000..9cbbf947 --- /dev/null +++ b/packages/components/nodes/tools/PythonInterpreter/python.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/nodes/tools/RequestsGet/RequestsGet.ts b/packages/components/nodes/tools/RequestsGet/RequestsGet.ts deleted file mode 100644 index 91cff500..00000000 --- a/packages/components/nodes/tools/RequestsGet/RequestsGet.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { INode, INodeData, INodeParams } from '../../../src/Interface' -import { getBaseClasses } from '../../../src/utils' -import { desc, RequestParameters, RequestsGetTool } from './core' - -class RequestsGet_Tools implements INode { - label: string - name: string - version: number - description: string - type: string - icon: string - category: string - baseClasses: string[] - inputs: INodeParams[] - - constructor() { - this.label = 'Requests Get' - this.name = 'requestsGet' - this.version = 1.0 - this.type = 'RequestsGet' - this.icon = 'requestsget.svg' - this.category = 'Tools' - this.description = 'Execute HTTP GET requests' - this.baseClasses = [this.type, ...getBaseClasses(RequestsGetTool)] - this.inputs = [ - { - label: 'URL', - name: 'url', - type: 'string', - description: - 'Agent will make call to this exact URL. If not specified, agent will try to figure out itself from AIPlugin if provided', - additionalParams: true, - optional: true - }, - { - label: 'Description', - name: 'description', - type: 'string', - rows: 4, - default: desc, - description: 'Acts like a prompt to tell agent when it should use this tool', - additionalParams: true, - optional: true - }, - { - label: 'Headers', - name: 'headers', - type: 'json', - additionalParams: true, - optional: true - } - ] - } - - async init(nodeData: INodeData): Promise { - const headers = nodeData.inputs?.headers as string - const url = nodeData.inputs?.url as string - const description = nodeData.inputs?.description as string - - const obj: RequestParameters = {} - if (url) obj.url = url - if (description) obj.description = description - if (headers) { - const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(headers) - obj.headers = parsedHeaders - } - - return new RequestsGetTool(obj) - } -} - -module.exports = { nodeClass: RequestsGet_Tools } diff --git a/packages/components/nodes/tools/RequestsGet/core.ts b/packages/components/nodes/tools/RequestsGet/core.ts deleted file mode 100644 index ea97cdf2..00000000 --- a/packages/components/nodes/tools/RequestsGet/core.ts +++ /dev/null @@ -1,46 +0,0 @@ -import fetch from 'node-fetch' -import { Tool } from '@langchain/core/tools' - -export const desc = `A portal to the internet. Use this when you need to get specific content from a website. -Input should be a url (i.e. https://www.google.com). The output will be the text response of the GET request.` - -export interface Headers { - [key: string]: string -} - -export interface RequestParameters { - headers?: Headers - url?: string - description?: string - maxOutputLength?: number -} - -export class RequestsGetTool extends Tool { - name = 'requests_get' - url = '' - description = desc - maxOutputLength = 2000 - headers = {} - - constructor(args?: RequestParameters) { - super() - this.url = args?.url ?? this.url - this.headers = args?.headers ?? this.headers - this.description = args?.description ?? this.description - this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength - } - - /** @ignore */ - async _call(input: string) { - const inputUrl = !this.url ? input : this.url - - if (process.env.DEBUG === 'true') console.info(`Making GET API call to ${inputUrl}`) - - const res = await fetch(inputUrl, { - headers: this.headers - }) - - const text = await res.text() - return text.slice(0, this.maxOutputLength) - } -} diff --git a/packages/components/nodes/tools/RequestsGet/requestsget.svg b/packages/components/nodes/tools/RequestsGet/requestsget.svg deleted file mode 100644 index d92c5b51..00000000 --- a/packages/components/nodes/tools/RequestsGet/requestsget.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/components/nodes/tools/RequestsPost/RequestsPost.ts b/packages/components/nodes/tools/RequestsPost/RequestsPost.ts deleted file mode 100644 index 9ff3d142..00000000 --- a/packages/components/nodes/tools/RequestsPost/RequestsPost.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { INode, INodeData, INodeParams } from '../../../src/Interface' -import { getBaseClasses } from '../../../src/utils' -import { RequestParameters, desc, RequestsPostTool } from './core' - -class RequestsPost_Tools implements INode { - label: string - name: string - version: number - description: string - type: string - icon: string - category: string - baseClasses: string[] - inputs: INodeParams[] - - constructor() { - this.label = 'Requests Post' - this.name = 'requestsPost' - this.version = 1.0 - this.type = 'RequestsPost' - this.icon = 'requestspost.svg' - this.category = 'Tools' - this.description = 'Execute HTTP POST requests' - this.baseClasses = [this.type, ...getBaseClasses(RequestsPostTool)] - this.inputs = [ - { - label: 'URL', - name: 'url', - type: 'string', - description: - 'Agent will make call to this exact URL. If not specified, agent will try to figure out itself from AIPlugin if provided', - additionalParams: true, - optional: true - }, - { - label: 'Body', - name: 'body', - type: 'json', - description: - 'JSON body for the POST request. If not specified, agent will try to figure out itself from AIPlugin if provided', - additionalParams: true, - optional: true - }, - { - label: 'Description', - name: 'description', - type: 'string', - rows: 4, - default: desc, - description: 'Acts like a prompt to tell agent when it should use this tool', - additionalParams: true, - optional: true - }, - { - label: 'Headers', - name: 'headers', - type: 'json', - additionalParams: true, - optional: true - } - ] - } - - async init(nodeData: INodeData): Promise { - const headers = nodeData.inputs?.headers as string - const url = nodeData.inputs?.url as string - const description = nodeData.inputs?.description as string - const body = nodeData.inputs?.body as string - - const obj: RequestParameters = {} - if (url) obj.url = url - if (description) obj.description = description - if (headers) { - const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(headers) - obj.headers = parsedHeaders - } - if (body) { - const parsedBody = typeof body === 'object' ? body : JSON.parse(body) - obj.body = parsedBody - } - - return new RequestsPostTool(obj) - } -} - -module.exports = { nodeClass: RequestsPost_Tools } diff --git a/packages/components/nodes/tools/RequestsPost/core.ts b/packages/components/nodes/tools/RequestsPost/core.ts deleted file mode 100644 index a380f167..00000000 --- a/packages/components/nodes/tools/RequestsPost/core.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Tool } from '@langchain/core/tools' -import fetch from 'node-fetch' - -export const desc = `Use this when you want to POST to a website. -Input should be a json string with two keys: "url" and "data". -The value of "url" should be a string, and the value of "data" should be a dictionary of -key-value pairs you want to POST to the url as a JSON body. -Be careful to always use double quotes for strings in the json string -The output will be the text response of the POST request.` - -export interface Headers { - [key: string]: string -} - -export interface Body { - [key: string]: any -} - -export interface RequestParameters { - headers?: Headers - body?: Body - url?: string - description?: string - maxOutputLength?: number -} - -export class RequestsPostTool extends Tool { - name = 'requests_post' - url = '' - description = desc - maxOutputLength = Infinity - headers = {} - body = {} - - constructor(args?: RequestParameters) { - super() - this.url = args?.url ?? this.url - this.headers = args?.headers ?? this.headers - this.body = args?.body ?? this.body - this.description = args?.description ?? this.description - this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength - } - - /** @ignore */ - async _call(input: string) { - try { - let inputUrl = '' - let inputBody = {} - if (Object.keys(this.body).length || this.url) { - if (this.url) inputUrl = this.url - if (Object.keys(this.body).length) inputBody = this.body - } else { - const { url, data } = JSON.parse(input) - inputUrl = url - inputBody = data - } - - if (process.env.DEBUG === 'true') console.info(`Making POST API call to ${inputUrl} with body ${JSON.stringify(inputBody)}`) - - const res = await fetch(inputUrl, { - method: 'POST', - headers: this.headers, - body: JSON.stringify(inputBody) - }) - - const text = await res.text() - return text.slice(0, this.maxOutputLength) - } catch (error) { - return `${error}` - } - } -} diff --git a/packages/components/nodes/tools/RequestsPost/requestspost.svg b/packages/components/nodes/tools/RequestsPost/requestspost.svg deleted file mode 100644 index 477b1baf..00000000 --- a/packages/components/nodes/tools/RequestsPost/requestspost.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/components/package.json b/packages/components/package.json index 0b702411..83d73937 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -25,6 +25,7 @@ "@aws-sdk/client-s3": "^3.427.0", "@datastax/astra-db-ts": "^0.1.2", "@dqbd/tiktoken": "^1.0.7", + "@e2b/code-interpreter": "^0.0.5", "@elastic/elasticsearch": "^8.9.0", "@getzep/zep-cloud": "npm:@getzep/zep-js@next", "@getzep/zep-js": "^0.9.0", @@ -40,6 +41,7 @@ "@langchain/google-genai": "^0.0.10", "@langchain/google-vertexai": "^0.0.5", "@langchain/groq": "^0.0.8", + "@langchain/langgraph": "^0.0.12", "@langchain/mistralai": "^0.0.19", "@langchain/mongodb": "^0.0.1", "@langchain/openai": "^0.0.30", diff --git a/packages/components/src/Interface.ts b/packages/components/src/Interface.ts index 7e6e7ebd..29ee3499 100644 --- a/packages/components/src/Interface.ts +++ b/packages/components/src/Interface.ts @@ -1,3 +1,7 @@ +import { BaseMessage } from '@langchain/core/messages' +import { BufferMemory, BufferWindowMemory, ConversationSummaryMemory, ConversationSummaryBufferMemory } from 'langchain/memory' +import { Moderation } from '../nodes/moderation/Moderation' + /** * Types */ @@ -149,6 +153,38 @@ export interface IUsedTool { toolOutput: string | object } +export interface IMultiAgentNode { + node: any + name: string + label: string + type: 'supervisor' | 'worker' + llm?: any + parentSupervisorName?: string + workers?: string[] + workerPrompt?: string + workerInputVariables?: string[] + recursionLimit?: number + moderations?: Moderation[] + multiModalMessageContent?: MessageContentImageUrl[] +} + +export interface ITeamState { + messages: { + value: (x: BaseMessage[], y: BaseMessage[]) => BaseMessage[] + default: () => BaseMessage[] + } + team_members: string[] + next: string + instructions: string +} + +export interface IAgentReasoning { + agentName: string + messages: string[] + next: string + instructions: string +} + export interface IFileUpload { data?: string type: string @@ -239,8 +275,6 @@ export class VectorStoreRetriever { /** * Implement abstract classes and interface for memory */ -import { BaseMessage } from '@langchain/core/messages' -import { BufferMemory, BufferWindowMemory, ConversationSummaryMemory, ConversationSummaryBufferMemory } from 'langchain/memory' export interface MemoryMethods { getChatMessages( diff --git a/packages/components/src/agents.ts b/packages/components/src/agents.ts index 048bf96f..ef3acfd9 100644 --- a/packages/components/src/agents.ts +++ b/packages/components/src/agents.ts @@ -3,7 +3,7 @@ import { ChainValues } from '@langchain/core/utils/types' import { AgentStep, AgentAction } from '@langchain/core/agents' import { BaseMessage, FunctionMessage, AIMessage, isBaseMessage } from '@langchain/core/messages' import { ToolCall } from '@langchain/core/messages/tool' -import { OutputParserException, BaseOutputParser } from '@langchain/core/output_parsers' +import { OutputParserException, BaseOutputParser, BaseLLMOutputParser } from '@langchain/core/output_parsers' import { BaseLanguageModel } from '@langchain/core/language_models/base' import { CallbackManager, CallbackManagerForChainRun, Callbacks } from '@langchain/core/callbacks/manager' import { ToolInputParsingException, Tool, StructuredToolInterface } from '@langchain/core/tools' @@ -25,12 +25,11 @@ import { formatLogToString } from 'langchain/agents/format_scratchpad/log' import { IUsedTool } from './Interface' export const SOURCE_DOCUMENTS_PREFIX = '\n\n----FLOWISE_SOURCE_DOCUMENTS----\n\n' -type AgentFinish = { +export type AgentFinish = { returnValues: Record log: string } type AgentExecutorOutput = ChainValues - interface AgentExecutorIteratorInput { agentExecutor: AgentExecutor inputs: Record @@ -351,7 +350,6 @@ export class AgentExecutor extends BaseChain { const additional = await this.agent.prepareForOutput(returnValues, steps) if (sourceDocuments.length) additional.sourceDocuments = flatten(sourceDocuments) if (usedTools.length) additional.usedTools = usedTools - if (this.returnIntermediateSteps) { return { ...returnValues, intermediateSteps: steps, ...additional } } @@ -829,7 +827,7 @@ export class XMLAgentOutputParser extends AgentActionOutputParser { abstract class AgentMultiActionOutputParser extends BaseOutputParser {} -type ToolsAgentAction = AgentAction & { +export type ToolsAgentAction = AgentAction & { toolCallId: string messageLog?: BaseMessage[] } @@ -898,3 +896,106 @@ export class ToolCallingAgentOutputParser extends AgentMultiActionOutputParser { throw new Error('getFormatInstructions not implemented inside ToolCallingAgentOutputParser.') } } + +export type ParsedToolCall = { + id?: string + + type: string + + args: Record + + /** @deprecated Use `type` instead. Will be removed in 0.2.0. */ + name: string + + /** @deprecated Use `args` instead. Will be removed in 0.2.0. */ + arguments: Record +} + +export type JsonOutputToolsParserParams = { + /** Whether to return the tool call id. */ + returnId?: boolean +} + +export class JsonOutputToolsParser extends BaseLLMOutputParser { + static lc_name() { + return 'JsonOutputToolsParser' + } + + returnId = false + + lc_namespace = ['langchain', 'output_parsers', 'openai_tools'] + + lc_serializable = true + + constructor(fields?: JsonOutputToolsParserParams) { + super(fields) + this.returnId = fields?.returnId ?? this.returnId + } + + /** + * Parses the output and returns a JSON object. If `argsOnly` is true, + * only the arguments of the function call are returned. + * @param generations The output of the LLM to parse. + * @returns A JSON object representation of the function call or its arguments. + */ + async parseResult(generations: ChatGeneration[]): Promise { + const toolCalls = generations[0].message.additional_kwargs.tool_calls + const parsedToolCalls = [] + + if (!toolCalls) { + // @ts-expect-error name and arguemnts are defined by Object.defineProperty + const parsedToolCall: ParsedToolCall = { + type: 'undefined', + args: {} + } + + // backward-compatibility with previous + // versions of Langchain JS, which uses `name` and `arguments` + Object.defineProperty(parsedToolCall, 'name', { + get() { + return this.type + } + }) + + Object.defineProperty(parsedToolCall, 'arguments', { + get() { + return this.args + } + }) + + parsedToolCalls.push(parsedToolCall) + } + + const clonedToolCalls = JSON.parse(JSON.stringify(toolCalls)) + for (const toolCall of clonedToolCalls) { + if (toolCall.function !== undefined) { + // @ts-expect-error name and arguemnts are defined by Object.defineProperty + const parsedToolCall: ParsedToolCall = { + type: toolCall.function.name, + args: JSON.parse(toolCall.function.arguments) + } + + if (this.returnId) { + parsedToolCall.id = toolCall.id + } + + // backward-compatibility with previous + // versions of Langchain JS, which uses `name` and `arguments` + Object.defineProperty(parsedToolCall, 'name', { + get() { + return this.type + } + }) + + Object.defineProperty(parsedToolCall, 'arguments', { + get() { + return this.args + } + }) + + parsedToolCalls.push(parsedToolCall) + } + } + return parsedToolCalls + } +} diff --git a/packages/components/src/handler.ts b/packages/components/src/handler.ts index 19b3cbe6..fcdb83c8 100644 --- a/packages/components/src/handler.ts +++ b/packages/components/src/handler.ts @@ -195,7 +195,7 @@ export class CustomChainHandler extends BaseCallbackHandler { Callback Order is "Chain Start -> Chain End" for cached responses. */ if (this.cachedResponse && parentRunId === undefined) { - const cachedValue = outputs.text ?? outputs.response ?? outputs.output ?? outputs.output_text + const cachedValue = outputs.text || outputs.response || outputs.output || outputs.output_text //split at whitespace, and keep the whitespace. This is to preserve the original formatting. const result = cachedValue.split(/(\s+)/) result.forEach((token: string, index: number) => { diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index fb556163..d4707501 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -8,3 +8,4 @@ export * from './Interface' export * from './utils' export * from './speechToText' export * from './storageUtils' +export * from './handler' diff --git a/packages/server/marketplaces/agentflows/Customer Support Team Agents.json b/packages/server/marketplaces/agentflows/Customer Support Team Agents.json new file mode 100644 index 00000000..1fe896d5 --- /dev/null +++ b/packages/server/marketplaces/agentflows/Customer Support Team Agents.json @@ -0,0 +1,975 @@ +{ + "description": "Customer support team consisting of Support Representative and Quality Assurance Specialist to handle support tickets", + "nodes": [ + { + "id": "supervisor_0", + "position": { + "x": 343.59847938459717, + "y": 124.00657409829381 + }, + "type": "customNode", + "data": { + "id": "supervisor_0", + "label": "Supervisor", + "version": 1, + "name": "supervisor", + "type": "Supervisor", + "baseClasses": ["Supervisor"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Supervisor Name", + "name": "supervisorName", + "type": "string", + "placeholder": "Supervisor", + "default": "Supervisor", + "id": "supervisor_0-input-supervisorName-string" + }, + { + "label": "Supervisor Prompt", + "name": "supervisorPrompt", + "type": "string", + "description": "Prompt must contains {team_members}", + "rows": 4, + "default": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "additionalParams": true, + "id": "supervisor_0-input-supervisorPrompt-string" + }, + { + "label": "Recursion Limit", + "name": "recursionLimit", + "type": "number", + "description": "Maximum number of times a call can recurse. If not provided, defaults to 100.", + "default": 100, + "additionalParams": true, + "id": "supervisor_0-input-recursionLimit-number" + } + ], + "inputAnchors": [ + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model", + "id": "supervisor_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "supervisor_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "supervisorName": "Supervisor", + "supervisorPrompt": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "model": "{{chatOpenAI_0.data.instance}}", + "recursionLimit": 100, + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "supervisor_0-output-supervisor-Supervisor", + "name": "supervisor", + "label": "Supervisor", + "description": "", + "type": "Supervisor" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 431, + "selected": false, + "positionAbsolute": { + "x": 343.59847938459717, + "y": 124.00657409829381 + }, + "dragging": false + }, + { + "id": "worker_0", + "position": { + "x": 848.0791314419789, + "y": 550.1251435439353 + }, + "type": "customNode", + "data": { + "id": "worker_0", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_0-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_0-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_0-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_0-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_0-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_0-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Quality Assurance Specialist", + "workerPrompt": "You are working at {company} and are now collaborating with your team on a customer request. Your task is to ensure that the support representative delivers the best possible support. It's crucial that the representative provides complete, accurate answers without making any assumptions.\n\nYour objective is to maintain top-tier support quality assurance within your team.\n\nReview the response drafted by the support representative for the customer's inquiry. Make sure the answer is thorough, accurate, and meets the high standards expected in customer support. Confirm that every aspect of the customer's question is addressed comprehensively, with a friendly and helpful tone. Verify that all references and sources used to find the information are included, ensuring the response is well-supported and leaves no questions unanswered.\n\nOnce your review is complete, return it to the Support Representative for finalization.", + "tools": "", + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_0-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "positionAbsolute": { + "x": 848.0791314419789, + "y": 550.1251435439353 + }, + "selected": false, + "dragging": false + }, + { + "id": "worker_1", + "position": { + "x": 1573.2919579833303, + "y": -234.22598124451474 + }, + "type": "customNode", + "data": { + "id": "worker_1", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_1-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_1-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_1-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_1-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_1-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_1-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_1-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Support Representative", + "workerPrompt": "As a representative at {company}, your role is to deliver exceptional customer support. Your objective is to provide the highest quality assistance, ensuring that your answers are comprehensive and based on facts without any assumptions.\n\nYour goal is to strive to be the most friendly and helpful support representative on your team.\n\nHere is your previous conversation with the customer:\n{conversation}\n\nCraft a detailed and informative response to the customer's inquiry, addressing all aspects of their question. Your response should include references to all sources used to find the answer, including external data or solutions. Ensure your answer is thorough, leaving no questions unanswered, while maintaining a friendly and supportive tone throughout.\n\nAlways use the tool provided - search_docs to look for answers. Check if you need to pass the result to Quality Assurance Specialist for review.", + "tools": ["{{retrieverTool_0.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"conversation\":\"{{customFunction_0.data.instance}}\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_1-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "positionAbsolute": { + "x": 1573.2919579833303, + "y": -234.22598124451474 + }, + "selected": false, + "dragging": false + }, + { + "id": "retrieverTool_0", + "position": { + "x": 1136.3773214513722, + "y": -661.7020929797668 + }, + "type": "customNode", + "data": { + "id": "retrieverTool_0", + "label": "Retriever Tool", + "version": 2, + "name": "retrieverTool", + "type": "RetrieverTool", + "baseClasses": ["RetrieverTool", "DynamicTool", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Use a retriever as allowed tool for agent", + "inputParams": [ + { + "label": "Retriever Name", + "name": "name", + "type": "string", + "placeholder": "search_state_of_union", + "id": "retrieverTool_0-input-name-string" + }, + { + "label": "Retriever Description", + "name": "description", + "type": "string", + "description": "When should agent uses to retrieve documents", + "rows": 3, + "placeholder": "Searches and returns documents regarding the state-of-the-union.", + "id": "retrieverTool_0-input-description-string" + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "retrieverTool_0-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Retriever", + "name": "retriever", + "type": "BaseRetriever", + "id": "retrieverTool_0-input-retriever-BaseRetriever" + } + ], + "inputs": { + "name": "search_docs", + "description": "Search and return documents about any issue or bugfix. Always give priority to this tool", + "retriever": "{{pinecone_0.data.instance}}", + "returnSourceDocuments": "" + }, + "outputAnchors": [ + { + "id": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "retrieverTool", + "label": "RetrieverTool", + "description": "Use a retriever as allowed tool for agent", + "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 602, + "selected": false, + "positionAbsolute": { + "x": 1136.3773214513722, + "y": -661.7020929797668 + }, + "dragging": false + }, + { + "id": "pinecone_0", + "position": { + "x": 767.1744633865214, + "y": -634.6870559540365 + }, + "type": "customNode", + "data": { + "id": "pinecone_0", + "label": "Pinecone", + "version": 3, + "name": "pinecone", + "type": "Pinecone", + "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], + "category": "Vector Stores", + "description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["pineconeApi"], + "id": "pinecone_0-input-credential-credential" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pinecone_0-input-pineconeIndex-string" + }, + { + "label": "Pinecone Namespace", + "name": "pineconeNamespace", + "type": "string", + "placeholder": "my-first-namespace", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-pineconeNamespace-string" + }, + { + "label": "Pinecone Metadata Filter", + "name": "pineconeMetadataFilter", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "pinecone_0-input-pineconeMetadataFilter-json" + }, + { + "label": "Top K", + "name": "topK", + "description": "Number of top results to fetch. Default to 4", + "placeholder": "4", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-topK-number" + }, + { + "label": "Search Type", + "name": "searchType", + "type": "options", + "default": "similarity", + "options": [ + { + "label": "Similarity", + "name": "similarity" + }, + { + "label": "Max Marginal Relevance", + "name": "mmr" + } + ], + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-searchType-options" + }, + { + "label": "Fetch K (for MMR Search)", + "name": "fetchK", + "description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR", + "placeholder": "20", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-fetchK-number" + }, + { + "label": "Lambda (for MMR Search)", + "name": "lambda", + "description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR", + "placeholder": "0.5", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-lambda-number" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "list": true, + "optional": true, + "id": "pinecone_0-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pinecone_0-input-embeddings-Embeddings" + }, + { + "label": "Record Manager", + "name": "recordManager", + "type": "RecordManager", + "description": "Keep track of the record to prevent duplication", + "optional": true, + "id": "pinecone_0-input-recordManager-RecordManager" + } + ], + "inputs": { + "document": "", + "embeddings": "{{openAIEmbeddings_0.data.instance}}", + "recordManager": "", + "pineconeIndex": "flowiseindex", + "pineconeNamespace": "pinecone-flowise-docs", + "pineconeMetadataFilter": "", + "topK": "", + "searchType": "similarity", + "fetchK": "", + "lambda": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "description": "", + "type": "Pinecone | VectorStoreRetriever | BaseRetriever" + }, + { + "id": "pinecone_0-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "description": "", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "width": 300, + "height": 604, + "selected": false, + "positionAbsolute": { + "x": 767.1744633865214, + "y": -634.6870559540365 + }, + "dragging": false + }, + { + "id": "openAIEmbeddings_0", + "position": { + "x": 373.4730229546882, + "y": -480.5312248256105 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_0", + "label": "OpenAI Embeddings", + "version": 4, + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": ["OpenAIEmbeddings", "Embeddings"], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "openAIEmbeddings_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "text-embedding-ada-002", + "id": "openAIEmbeddings_0-input-modelName-asyncOptions" + }, + { + "label": "Strip New Lines", + "name": "stripNewLines", + "type": "boolean", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-stripNewLines-boolean" + }, + { + "label": "Batch Size", + "name": "batchSize", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-batchSize-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-basepath-string" + }, + { + "label": "Dimensions", + "name": "dimensions", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-dimensions-number" + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-embedding-ada-002", + "stripNewLines": "", + "batchSize": "", + "timeout": "", + "basepath": "", + "dimensions": "" + }, + "outputAnchors": [ + { + "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "description": "OpenAI API to generate embeddings for a given text", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 423, + "selected": false, + "positionAbsolute": { + "x": 373.4730229546882, + "y": -480.5312248256105 + }, + "dragging": false + }, + { + "id": "customFunction_0", + "position": { + "x": 1214.8704502141265, + "y": 109.13589410824264 + }, + "type": "customNode", + "data": { + "id": "customFunction_0", + "label": "Custom JS Function", + "version": 1, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": ["CustomFunction", "Utilities"], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_0-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "My Function", + "id": "customFunction_0-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_0-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "", + "functionName": "", + "javascriptFunction": "// Simulating fetching conversation between system and customer\nconst conversations =[\n {\n \"role\": \"bot\",\n \"content\": \"Hey how can I help you?\",\n },\n {\n \"role\": \"user\",\n \"content\": \"There is a bug when installing Flowise\",\n },\n {\n \"role\": \"bot\",\n \"content\": \"Can you tell me what was the error?\",\n }\n];\n\nreturn conversations;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "customFunction_0-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + }, + { + "id": "customFunction_0-output-EndingNode-CustomFunction", + "name": "EndingNode", + "label": "Ending Node", + "description": "", + "type": "CustomFunction" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 1214.8704502141265, + "y": 109.13589410824264 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": -29.209923556934555, + "y": -53.48197675171315 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-4o", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": -29.209923556934555, + "y": -53.48197675171315 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "openAIEmbeddings_0", + "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pinecone_0", + "targetHandle": "pinecone_0-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pinecone_0-pinecone_0-input-embeddings-Embeddings" + }, + { + "source": "pinecone_0", + "sourceHandle": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "target": "retrieverTool_0", + "targetHandle": "retrieverTool_0-input-retriever-BaseRetriever", + "type": "buttonedge", + "id": "pinecone_0-pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_0-retrieverTool_0-input-retriever-BaseRetriever" + }, + { + "source": "retrieverTool_0", + "sourceHandle": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "worker_1", + "targetHandle": "worker_1-input-tools-Tool", + "type": "buttonedge", + "id": "retrieverTool_0-retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-worker_1-worker_1-input-tools-Tool" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_1", + "targetHandle": "worker_1-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_1-worker_1-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_0", + "targetHandle": "worker_0-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_0-worker_0-input-supervisor-Supervisor" + }, + { + "source": "customFunction_0", + "sourceHandle": "customFunction_0-output-output-string|number|boolean|json|array", + "target": "worker_1", + "targetHandle": "worker_1-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_0-customFunction_0-output-output-string|number|boolean|json|array-worker_1-worker_1-input-promptValues-json" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "supervisor_0", + "targetHandle": "supervisor_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-supervisor_0-supervisor_0-input-model-BaseChatModel" + } + ] +} diff --git a/packages/server/marketplaces/agentflows/Lead Outreach.json b/packages/server/marketplaces/agentflows/Lead Outreach.json new file mode 100644 index 00000000..0152e9d5 --- /dev/null +++ b/packages/server/marketplaces/agentflows/Lead Outreach.json @@ -0,0 +1,560 @@ +{ + "description": "Research leads and create personalized email drafts for sales team", + "nodes": [ + { + "id": "supervisor_0", + "position": { + "x": 528, + "y": 241 + }, + "type": "customNode", + "data": { + "id": "supervisor_0", + "label": "Supervisor", + "version": 1, + "name": "supervisor", + "type": "Supervisor", + "baseClasses": ["Supervisor"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Supervisor Name", + "name": "supervisorName", + "type": "string", + "placeholder": "Supervisor", + "default": "Supervisor", + "id": "supervisor_0-input-supervisorName-string" + }, + { + "label": "Supervisor Prompt", + "name": "supervisorPrompt", + "type": "string", + "description": "Prompt must contains {team_members}", + "rows": 4, + "default": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "additionalParams": true, + "id": "supervisor_0-input-supervisorPrompt-string" + }, + { + "label": "Recursion Limit", + "name": "recursionLimit", + "type": "number", + "description": "Maximum number of times a call can recurse. If not provided, defaults to 100.", + "default": 100, + "additionalParams": true, + "id": "supervisor_0-input-recursionLimit-number" + } + ], + "inputAnchors": [ + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model", + "id": "supervisor_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "supervisor_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "supervisorName": "Supervisor", + "supervisorPrompt": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "model": "{{chatOpenAI_0.data.instance}}", + "recursionLimit": 100, + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "supervisor_0-output-supervisor-Supervisor", + "name": "supervisor", + "label": "Supervisor", + "description": "", + "type": "Supervisor" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 431, + "positionAbsolute": { + "x": 528, + "y": 241 + }, + "selected": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": 141.20413030236358, + "y": 37.29175117907283 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-4o", + "temperature": 0.9, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 141.20413030236358, + "y": 37.29175117907283 + }, + "dragging": false + }, + { + "id": "worker_0", + "position": { + "x": 918.2245199532538, + "y": 112.34294138561228 + }, + "type": "customNode", + "data": { + "id": "worker_0", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_0-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_0-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_0-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_0-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_0-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_0-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Lead Research", + "workerPrompt": "As a member of the sales team at {company}, your mission is to explore the digital landscape for potential leads. Equipped with advanced tools and a strategic approach, you analyze data, trends, and interactions to discover opportunities that others might miss. Your efforts are vital in creating pathways for meaningful engagements and driving the company's growth.\n\nYour goal is to identify high-value leads that align with our ideal customer profile.\n\nPerform a thorough analysis of {lead_company}, a company that has recently shown interest in our solutions. Use all available data sources to create a detailed profile, concentrating on key decision-makers, recent business developments, and potential needs that match our offerings. This task is essential for effectively customizing our engagement strategy.\n\nAvoid making assumptions and only use information you are certain about.\n\nYou should produce a comprehensive report on {lead_person}, including company background, key personnel, recent milestones, and identified needs. Emphasize potential areas where our solutions can add value and suggest tailored engagement strategies. Pass the info to Lead Sales Representative.", + "tools": ["{{googleCustomSearch_0.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"lead_company\":\"Langchain\",\"lead_person\":\"Harrison Chase\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_0-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 918.2245199532538, + "y": 112.34294138561228 + }, + "dragging": false + }, + { + "id": "worker_1", + "position": { + "x": 1318.2245199532538, + "y": 112.34294138561228 + }, + "type": "customNode", + "data": { + "id": "worker_1", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_1-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_1-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_1-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_1-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_1-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_1-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_1-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Lead Sales Representative", + "workerPrompt": "You play a crucial role within {company} as the link between potential clients and the solutions they need. By crafting engaging, personalized messages, you not only inform leads about our company offerings but also make them feel valued and understood. Your role is essential in transforming interest into action, guiding leads from initial curiosity to committed engagement.\n\nYour goal is to nurture leads with tailored, compelling communications.\n\nLeveraging the insights from the lead profiling report on {lead_company}, create a personalized outreach campaign targeting {lead_person}, the {position} of {lead_company}. he campaign should highlight their recent {lead_activity} and demonstrate how our solutions can support their objectives. Your communication should align with {lead_company}'s company culture and values, showcasing a thorough understanding of their business and needs. Avoid making assumptions and use only verified information.\n\nThe output should be a series of personalized email drafts customized for {lead_company}, specifically addressing {lead_person}. Each draft should present a compelling narrative that connects our solutions to their recent accomplishments and future goals. Ensure the tone is engaging, professional, and consistent with {lead_company}'s corporate identity. Keep in natural, don't use strange and fancy words.", + "tools": "", + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"lead_company\":\"Langchain\",\"lead_person\":\"Harrison Chase\",\"position\":\"CEO\",\"lead_activity\":\"Langgraph launch\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_1-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1318.2245199532538, + "y": 112.34294138561228 + }, + "dragging": false + }, + { + "id": "googleCustomSearch_0", + "position": { + "x": 542.5920618578143, + "y": -102.36639408227376 + }, + "type": "customNode", + "data": { + "id": "googleCustomSearch_0", + "label": "Google Custom Search", + "version": 1, + "name": "googleCustomSearch", + "type": "GoogleCustomSearchAPI", + "baseClasses": ["GoogleCustomSearchAPI", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["googleCustomSearchApi"], + "id": "googleCustomSearch_0-input-credential-credential" + } + ], + "inputAnchors": [], + "inputs": {}, + "outputAnchors": [ + { + "id": "googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "name": "googleCustomSearch", + "label": "GoogleCustomSearchAPI", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "type": "GoogleCustomSearchAPI | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 275, + "selected": false, + "positionAbsolute": { + "x": 542.5920618578143, + "y": -102.36639408227376 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_0", + "targetHandle": "worker_0-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_0-worker_0-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_1", + "targetHandle": "worker_1-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_1-worker_1-input-supervisor-Supervisor" + }, + { + "source": "googleCustomSearch_0", + "sourceHandle": "googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "target": "worker_0", + "targetHandle": "worker_0-input-tools-Tool", + "type": "buttonedge", + "id": "googleCustomSearch_0-googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable-worker_0-worker_0-input-tools-Tool" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "supervisor_0", + "targetHandle": "supervisor_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-supervisor_0-supervisor_0-input-model-BaseChatModel" + } + ] +} diff --git a/packages/server/marketplaces/agentflows/Portfolio Management Team.json b/packages/server/marketplaces/agentflows/Portfolio Management Team.json new file mode 100644 index 00000000..02e6b081 --- /dev/null +++ b/packages/server/marketplaces/agentflows/Portfolio Management Team.json @@ -0,0 +1,783 @@ +{ + "description": "A team of portfolio manager, financial analyst, and risk manager working together to optimize an investment portfolio.", + "nodes": [ + { + "id": "supervisor_0", + "position": { + "x": 242.0267719253082, + "y": 185.62152813526978 + }, + "type": "customNode", + "data": { + "id": "supervisor_0", + "label": "Supervisor", + "version": 1, + "name": "supervisor", + "type": "Supervisor", + "baseClasses": ["Supervisor"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Supervisor Name", + "name": "supervisorName", + "type": "string", + "placeholder": "Supervisor", + "default": "Supervisor", + "id": "supervisor_0-input-supervisorName-string" + }, + { + "label": "Supervisor Prompt", + "name": "supervisorPrompt", + "type": "string", + "description": "Prompt must contains {team_members}", + "rows": 4, + "default": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "additionalParams": true, + "id": "supervisor_0-input-supervisorPrompt-string" + }, + { + "label": "Recursion Limit", + "name": "recursionLimit", + "type": "number", + "description": "Maximum number of times a call can recurse. If not provided, defaults to 100.", + "default": 100, + "additionalParams": true, + "id": "supervisor_0-input-recursionLimit-number" + } + ], + "inputAnchors": [ + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model", + "id": "supervisor_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "supervisor_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "supervisorName": "Supervisor", + "supervisorPrompt": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "model": "{{chatOpenAI_0.data.instance}}", + "recursionLimit": 100, + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "supervisor_0-output-supervisor-Supervisor", + "name": "supervisor", + "label": "Supervisor", + "description": "", + "type": "Supervisor" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 431, + "selected": false, + "positionAbsolute": { + "x": 242.0267719253082, + "y": 185.62152813526978 + }, + "dragging": false + }, + { + "id": "worker_0", + "position": { + "x": 637.3247841463353, + "y": 115.189653148269 + }, + "type": "customNode", + "data": { + "id": "worker_0", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_0-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_0-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_0-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_0-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_0-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_0-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Portfolio Manager", + "workerPrompt": "As the Portfolio Manager at {company}, you play a crucial role in overseeing and optimizing our investment portfolio. Your expertise in market analysis, strategic planning, and risk management is essential for making informed investment decisions that drive our financial growth.\n\nYour goal is to develop and implement effective investment strategies that align with our clients' financial goals and risk tolerance.\n\nAnalyze market trends, economic data, and financial reports to identify potential investment opportunities. Collaborate with the Financial Analyst and Risk Manager to ensure that your strategies are well-informed and balanced. Continuously monitor the portfolio's performance and make adjustments as necessary to maximize returns while managing risk.\n\nYour task is to create a comprehensive investment strategy for {portfolio_name}, taking into account the client's financial objectives and risk tolerance. Ensure that your strategy is backed by thorough market research and financial analysis, and includes a plan for regular performance reviews and adjustments.\n\nThe output should be a detailed investment strategy report for {portfolio_name}, including market analysis, recommended investments, risk management approaches, and performance monitoring plans. Ensure that the strategy is designed to achieve the client's financial goals while maintaining an appropriate risk level.", + "tools": ["{{googleCustomSearch_0.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"portfolio_name\":\"Tesla Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_0-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 637.3247841463353, + "y": 115.189653148269 + }, + "dragging": false + }, + { + "id": "worker_1", + "position": { + "x": 1037.3247841463353, + "y": 115.189653148269 + }, + "type": "customNode", + "data": { + "id": "worker_1", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_1-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_1-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_1-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_1-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_1-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_1-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_1-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Financial Analyst", + "workerPrompt": "As a Financial Analyst at {company}, you are a vital member of our portfolio management team, providing in-depth research and analysis to support informed investment decisions. Your analytical skills and market insights are key to identifying profitable opportunities and enhancing the overall performance of our portfolio.\n\nYour goal is to conduct thorough financial analysis and market research to support the Portfolio Manager in developing effective investment strategies.\n\nAnalyze financial data, market trends, and economic indicators to identify potential investment opportunities. Prepare detailed reports and presentations that highlight your findings and recommendations. Collaborate closely with the Portfolio Manager and Risk Manager to ensure that your analyses contribute to well-informed and balanced investment strategies.\n\nYour task is to perform a comprehensive analysis of {investment_opportunity} for inclusion in {portfolio_name}. Use various financial metrics and market data to evaluate the potential risks and returns. Provide clear, actionable insights and recommendations based on your analysis.\n\nThe output should be a detailed financial analysis report for {investment_opportunity}, including key financial metrics, market trends, risk assessment, and your investment recommendation. Ensure that the report is well-supported by data and provides valuable insights to inform the Portfolio Manager's decision-making process.", + "tools": ["{{googleCustomSearch_1.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"investment_opportunity\":\"Tech Summit Fund\",\"portfolio_name\":\"Tesla Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_1-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1037.3247841463353, + "y": 115.189653148269 + }, + "dragging": false + }, + { + "id": "worker_2", + "position": { + "x": 1482.836195011232, + "y": 119.54481208270889 + }, + "type": "customNode", + "data": { + "id": "worker_2", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_2-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_2-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_2-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_2-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_2-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_2-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_2-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Risk Manager", + "workerPrompt": "As the Risk Manager at {company}, you play a pivotal role in ensuring the stability and resilience of our investment portfolio. Your expertise in risk assessment and mitigation is essential for maintaining an appropriate balance between risk and return, aligning with our clients' risk tolerance and financial goals.\n\nYour goal is to identify, assess, and mitigate risks associated with the investment portfolio to safeguard its performance and align with our clients' risk tolerance.\n\nEvaluate potential risks for current and prospective investments using quantitative and qualitative analysis. Collaborate with the Portfolio Manager and Financial Analyst to integrate risk management strategies into the overall investment approach. Continuously monitor the portfolio to identify emerging risks and implement measures to mitigate them.\n\nYour task is to perform a comprehensive risk assessment for {portfolio_name}, focusing on potential market, credit, and operational risks. Develop and recommend risk mitigation strategies that align with the client's risk tolerance and investment objectives.\n\nThe output should be a detailed risk assessment report for {portfolio_name}, including identification of key risks, risk metrics, and recommended mitigation strategies. Ensure that the report provides actionable insights and supports the Portfolio Manager in maintaining a balanced and resilient portfolio.", + "tools": ["{{googleCustomSearch_2.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"portfolio_name\":\"Tesla Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_2-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1482.836195011232, + "y": 119.54481208270889 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": -120.80560304817006, + "y": 71.63806380387018 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-4o", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": -120.80560304817006, + "y": 71.63806380387018 + }, + "dragging": false + }, + { + "id": "googleCustomSearch_0", + "position": { + "x": 268.39206549032804, + "y": -209.224097209214 + }, + "type": "customNode", + "data": { + "id": "googleCustomSearch_0", + "label": "Google Custom Search", + "version": 1, + "name": "googleCustomSearch", + "type": "GoogleCustomSearchAPI", + "baseClasses": ["GoogleCustomSearchAPI", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["googleCustomSearchApi"], + "id": "googleCustomSearch_0-input-credential-credential" + } + ], + "inputAnchors": [], + "inputs": {}, + "outputAnchors": [ + { + "id": "googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "name": "googleCustomSearch", + "label": "GoogleCustomSearchAPI", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "type": "GoogleCustomSearchAPI | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 275, + "selected": false, + "positionAbsolute": { + "x": 268.39206549032804, + "y": -209.224097209214 + }, + "dragging": false + }, + { + "id": "googleCustomSearch_1", + "position": { + "x": 708.2007597123056, + "y": -214.21906914647434 + }, + "type": "customNode", + "data": { + "id": "googleCustomSearch_1", + "label": "Google Custom Search", + "version": 1, + "name": "googleCustomSearch", + "type": "GoogleCustomSearchAPI", + "baseClasses": ["GoogleCustomSearchAPI", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["googleCustomSearchApi"], + "id": "googleCustomSearch_1-input-credential-credential" + } + ], + "inputAnchors": [], + "inputs": {}, + "outputAnchors": [ + { + "id": "googleCustomSearch_1-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "name": "googleCustomSearch", + "label": "GoogleCustomSearchAPI", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "type": "GoogleCustomSearchAPI | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 275, + "selected": false, + "positionAbsolute": { + "x": 708.2007597123056, + "y": -214.21906914647434 + }, + "dragging": false + }, + { + "id": "googleCustomSearch_2", + "position": { + "x": 1148.6913242910439, + "y": -216.29397639610963 + }, + "type": "customNode", + "data": { + "id": "googleCustomSearch_2", + "label": "Google Custom Search", + "version": 1, + "name": "googleCustomSearch", + "type": "GoogleCustomSearchAPI", + "baseClasses": ["GoogleCustomSearchAPI", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["googleCustomSearchApi"], + "id": "googleCustomSearch_2-input-credential-credential" + } + ], + "inputAnchors": [], + "inputs": {}, + "outputAnchors": [ + { + "id": "googleCustomSearch_2-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "name": "googleCustomSearch", + "label": "GoogleCustomSearchAPI", + "description": "Wrapper around Google Custom Search API - a real-time API to access Google search results", + "type": "GoogleCustomSearchAPI | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 275, + "selected": false, + "positionAbsolute": { + "x": 1148.6913242910439, + "y": -216.29397639610963 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "googleCustomSearch_0", + "sourceHandle": "googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "target": "worker_0", + "targetHandle": "worker_0-input-tools-Tool", + "type": "buttonedge", + "id": "googleCustomSearch_0-googleCustomSearch_0-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable-worker_0-worker_0-input-tools-Tool" + }, + { + "source": "googleCustomSearch_1", + "sourceHandle": "googleCustomSearch_1-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "target": "worker_1", + "targetHandle": "worker_1-input-tools-Tool", + "type": "buttonedge", + "id": "googleCustomSearch_1-googleCustomSearch_1-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable-worker_1-worker_1-input-tools-Tool" + }, + { + "source": "googleCustomSearch_2", + "sourceHandle": "googleCustomSearch_2-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable", + "target": "worker_2", + "targetHandle": "worker_2-input-tools-Tool", + "type": "buttonedge", + "id": "googleCustomSearch_2-googleCustomSearch_2-output-googleCustomSearch-GoogleCustomSearchAPI|Tool|StructuredTool|Runnable-worker_2-worker_2-input-tools-Tool" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "supervisor_0", + "targetHandle": "supervisor_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-supervisor_0-supervisor_0-input-model-BaseChatModel" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_0", + "targetHandle": "worker_0-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_0-worker_0-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_1", + "targetHandle": "worker_1-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_1-worker_1-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_2", + "targetHandle": "worker_2-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_2-worker_2-input-supervisor-Supervisor" + } + ] +} diff --git a/packages/server/marketplaces/agentflows/Software Team.json b/packages/server/marketplaces/agentflows/Software Team.json new file mode 100644 index 00000000..b55a4648 --- /dev/null +++ b/packages/server/marketplaces/agentflows/Software Team.json @@ -0,0 +1,504 @@ +{ + "description": "Software engineering team working together to build a feature, solve a problem, or complete a task.", + "nodes": [ + { + "id": "supervisor_0", + "position": { + "x": 577, + "y": 156 + }, + "type": "customNode", + "data": { + "id": "supervisor_0", + "label": "Supervisor", + "version": 1, + "name": "supervisor", + "type": "Supervisor", + "baseClasses": ["Supervisor"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Supervisor Name", + "name": "supervisorName", + "type": "string", + "placeholder": "Supervisor", + "default": "Supervisor", + "id": "supervisor_0-input-supervisorName-string" + }, + { + "label": "Supervisor Prompt", + "name": "supervisorPrompt", + "type": "string", + "description": "Prompt must contains {team_members}", + "rows": 4, + "default": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "additionalParams": true, + "id": "supervisor_0-input-supervisorPrompt-string" + }, + { + "label": "Recursion Limit", + "name": "recursionLimit", + "type": "number", + "description": "Maximum number of times a call can recurse. If not provided, defaults to 100.", + "default": 100, + "additionalParams": true, + "id": "supervisor_0-input-recursionLimit-number" + } + ], + "inputAnchors": [ + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model", + "id": "supervisor_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "supervisor_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "supervisorName": "Supervisor", + "supervisorPrompt": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "model": "{{chatOpenAI_0.data.instance}}", + "recursionLimit": 100, + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "supervisor_0-output-supervisor-Supervisor", + "name": "supervisor", + "label": "Supervisor", + "description": "", + "type": "Supervisor" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 431, + "positionAbsolute": { + "x": 577, + "y": 156 + }, + "selected": false + }, + { + "id": "worker_0", + "position": { + "x": 969.3717362716295, + "y": 77.52271438462338 + }, + "type": "customNode", + "data": { + "id": "worker_0", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_0-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_0-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_0-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_0-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_0-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_0-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Senior Software Engineer", + "workerPrompt": "As a Senior Software Engineer at {company}, you are a pivotal part of our innovative development team. Your expertise and leadership drive the creation of robust, scalable software solutions that meet the needs of our diverse clientele. By applying best practices in software development, you ensure that our products are reliable, efficient, and maintainable.\n\nYour goal is to lead the development of high-quality software solutions.\n\nUtilize your deep technical knowledge and experience to architect, design, and implement software systems that address complex problems. Collaborate closely with other engineers, reviewers to ensure that the solutions you develop align with business objectives and user needs.\n\nDesign and implement new feature for the given task, ensuring it integrates seamlessly with existing systems and meets performance requirements. Use your understanding of {technology} to build this feature. Make sure to adhere to our coding standards and follow best practices.\n\nThe output should be a fully functional, well-documented feature that enhances our product's capabilities. Include detailed comments in the code. Pass the code to Quality Assurance Engineer for review if neccessary. Once ther review is good enough, produce a finalized version of the code.", + "tools": "", + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"technology\":\"React, NodeJS, ExpressJS, Tailwindcss\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_0-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 969.3717362716295, + "y": 77.52271438462338 + }, + "dragging": false + }, + { + "id": "worker_1", + "position": { + "x": 1369.3717362716295, + "y": 77.52271438462338 + }, + "type": "customNode", + "data": { + "id": "worker_1", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_1-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_1-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_1-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_1-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_1-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_1-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_1-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "Code Reviewer", + "workerPrompt": "As a Quality Assurance Engineer at {company}, you are an integral part of our development team, ensuring that our software products are of the highest quality. Your meticulous attention to detail and expertise in testing methodologies are crucial in identifying defects and ensuring that our code meets the highest standards.\n\nYour goal is to ensure the delivery of high-quality software through thorough code review and testing.\n\nReview the codebase for the new feature designed and implemented by the Senior Software Engineer. Your expertise goes beyond mere code inspection; you are adept at ensuring that developments not only function as intended but also adhere to the team's coding standards, enhance maintainability, and seamlessly integrate with existing systems. \n\nWith a deep appreciation for collaborative development, you provide constructive feedback, guiding contributors towards best practices and fostering a culture of continuous improvement. Your meticulous approach to reviewing code, coupled with your ability to foresee potential issues and recommend proactive solutions, ensures the delivery of high-quality software that is robust, scalable, and aligned with the team's strategic goals.\n\nAlways pass back the review and feedback to Senior Software Engineer.", + "tools": "", + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_1-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1369.3717362716295, + "y": 77.52271438462338 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": 201.1230948105134, + "y": 70.78573663723421 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-4o", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 201.1230948105134, + "y": 70.78573663723421 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "supervisor_0", + "targetHandle": "supervisor_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-supervisor_0-supervisor_0-input-model-BaseChatModel" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_1", + "targetHandle": "worker_1-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_1-worker_1-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_0", + "targetHandle": "worker_0-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_0-worker_0-input-supervisor-Supervisor" + } + ] +} diff --git a/packages/server/marketplaces/agentflows/Text to SQL.json b/packages/server/marketplaces/agentflows/Text to SQL.json new file mode 100644 index 00000000..2e3f6522 --- /dev/null +++ b/packages/server/marketplaces/agentflows/Text to SQL.json @@ -0,0 +1,768 @@ +{ + "description": "Text to SQL query process using team of 3 agents: SQL Expert, SQL Reviewer, and SQL Executor", + "nodes": [ + { + "id": "supervisor_0", + "position": { + "x": -275.4818449163403, + "y": 462.4424369159454 + }, + "type": "customNode", + "data": { + "id": "supervisor_0", + "label": "Supervisor", + "version": 1, + "name": "supervisor", + "type": "Supervisor", + "baseClasses": ["Supervisor"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Supervisor Name", + "name": "supervisorName", + "type": "string", + "placeholder": "Supervisor", + "default": "Supervisor", + "id": "supervisor_0-input-supervisorName-string" + }, + { + "label": "Supervisor Prompt", + "name": "supervisorPrompt", + "type": "string", + "description": "Prompt must contains {team_members}", + "rows": 4, + "default": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "additionalParams": true, + "id": "supervisor_0-input-supervisorPrompt-string" + }, + { + "label": "Recursion Limit", + "name": "recursionLimit", + "type": "number", + "description": "Maximum number of times a call can recurse. If not provided, defaults to 100.", + "default": 100, + "additionalParams": true, + "id": "supervisor_0-input-recursionLimit-number" + } + ], + "inputAnchors": [ + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, GroqChat. Best result with GPT-4 model", + "id": "supervisor_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "supervisor_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "supervisorName": "Supervisor", + "supervisorPrompt": "You are a supervisor tasked with managing a conversation between the following workers: {team_members}.\nGiven the following user request, respond with the worker to act next.\nEach worker will perform a task and respond with their results and status.\nWhen finished, respond with FINISH.\nSelect strategically to minimize the number of steps taken.", + "model": "{{chatOpenAI_0.data.instance}}", + "recursionLimit": 100, + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "supervisor_0-output-supervisor-Supervisor", + "name": "supervisor", + "label": "Supervisor", + "description": "", + "type": "Supervisor" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 431, + "selected": false, + "positionAbsolute": { + "x": -275.4818449163403, + "y": 462.4424369159454 + }, + "dragging": false + }, + { + "id": "worker_0", + "position": { + "x": 483.6310212673076, + "y": 304.6138109554939 + }, + "type": "customNode", + "data": { + "id": "worker_0", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_0-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_0-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_0-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_0-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_0-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_0-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "SQL Expert", + "workerPrompt": "As an SQL Expert at {company}, you are a critical member of our data team, responsible for designing, optimizing, and maintaining our database systems. Your expertise in SQL and database management ensures that our data is accurate, accessible, and efficiently processed.\n\nYour goal is to develop and optimize complex SQL queries to answer the question.\n\nYou are given the following schema:\n{schema}\n\nYour task is to use the provided schema, and produce the SQL query needed to answer user question. Collaborate with SQL Reviewer and SQL Executor for feedback and review, ensuring that your SQL solutions is correct and follow best practices in database design and query optimization to enhance performance and reliability.\n\nThe output should be a an optimized SQL query. Ensure that your output only contains SQL query, nothing else. Remember, only output SQL query.", + "tools": [], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\",\"schema\":\"{{customFunction_0.data.instance}}\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_0-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 483.6310212673076, + "y": 304.6138109554939 + }, + "dragging": false + }, + { + "id": "worker_1", + "position": { + "x": 1214.157684503848, + "y": 248.8294849061827 + }, + "type": "customNode", + "data": { + "id": "worker_1", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_1-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_1-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_1-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_1-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_1-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_1-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_1-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "SQL Executor", + "workerPrompt": "As an SQL Executor at {company}, you must ensure the SQL query can be executed with no error.\n\nYou must use the execute_sql tool to execute the SQL query provided by SQL Expert and get the result. Verify the result is indeed correct and error-free. Collaborate with the SQL Expert and SQL Reviewer to make sure the SQL query is valid and successfully fetches back the right information.\n\nREMEMBER, always use the execute_sql tool!", + "tools": ["{{customTool_0.data.instance}}"], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_1-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1214.157684503848, + "y": 248.8294849061827 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": -636.2452233568264, + "y": 233.06616199339652 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-4o", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": -636.2452233568264, + "y": 233.06616199339652 + }, + "dragging": false + }, + { + "id": "customFunction_0", + "position": { + "x": 90.45254468977657, + "y": 626.487889256008 + }, + "type": "customNode", + "data": { + "id": "customFunction_0", + "label": "Custom JS Function", + "version": 1, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": ["CustomFunction", "Utilities"], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_0-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "My Function", + "id": "customFunction_0-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_0-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "", + "functionName": "", + "javascriptFunction": "// Fetch schema info\nconst sqlSchema = `CREATE TABLE customers (\n customerNumber int NOT NULL,\n customerName varchar(50) NOT NULL,\n contactLastName varchar(50) NOT NULL,\n contactFirstName varchar(50) NOT NULL,\n phone varchar(50) NOT NULL,\n addressLine1 varchar(50) NOT NULL,\n addressLine2 varchar(50) DEFAULT NULL,\n city varchar(50) NOT NULL,\n state varchar(50) DEFAULT NULL,\n postalCode varchar(15) DEFAULT NULL,\n country varchar(50) NOT NULL,\n salesRepEmployeeNumber int DEFAULT NULL,\n creditLimit decimal(10,2) DEFAULT NULL,\n)`\n\nreturn sqlSchema;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "customFunction_0-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + }, + { + "id": "customFunction_0-output-EndingNode-CustomFunction", + "name": "EndingNode", + "label": "Ending Node", + "description": "", + "type": "CustomFunction" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 90.45254468977657, + "y": 626.487889256008 + }, + "dragging": false + }, + { + "id": "customTool_0", + "position": { + "x": 823.759726626879, + "y": 87.97240806811993 + }, + "type": "customNode", + "data": { + "id": "customTool_0", + "label": "Custom Tool", + "version": 1, + "name": "customTool", + "type": "CustomTool", + "baseClasses": ["CustomTool", "Tool", "StructuredTool", "Runnable"], + "category": "Tools", + "description": "Use custom tool you've created in Flowise within chatflow", + "inputParams": [ + { + "label": "Select Tool", + "name": "selectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "id": "customTool_0-input-selectedTool-asyncOptions" + } + ], + "inputAnchors": [], + "inputs": { + "selectedTool": "4d723d69-e854-4351-90c0-6385ce908213" + }, + "outputAnchors": [ + { + "id": "customTool_0-output-customTool-CustomTool|Tool|StructuredTool|Runnable", + "name": "customTool", + "label": "CustomTool", + "description": "Use custom tool you've created in Flowise within chatflow", + "type": "CustomTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 285, + "selected": false, + "positionAbsolute": { + "x": 823.759726626879, + "y": 87.97240806811993 + }, + "dragging": false + }, + { + "id": "worker_2", + "position": { + "x": 1643.1366621404572, + "y": 253.12633995235484 + }, + "type": "customNode", + "data": { + "id": "worker_2", + "label": "Worker", + "version": 1, + "name": "worker", + "type": "Worker", + "baseClasses": ["Worker"], + "category": "Multi Agents", + "inputParams": [ + { + "label": "Worker Name", + "name": "workerName", + "type": "string", + "placeholder": "Worker", + "id": "worker_2-input-workerName-string" + }, + { + "label": "Worker Prompt", + "name": "workerPrompt", + "type": "string", + "rows": 4, + "default": "You are a research assistant who can search for up-to-date info using search engine.", + "id": "worker_2-input-workerPrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "worker_2-input-promptValues-json" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "id": "worker_2-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "optional": true, + "id": "worker_2-input-tools-Tool" + }, + { + "label": "Supervisor", + "name": "supervisor", + "type": "Supervisor", + "id": "worker_2-input-supervisor-Supervisor" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "optional": true, + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat. If not specified, supervisor's model will be used", + "id": "worker_2-input-model-BaseChatModel" + } + ], + "inputs": { + "workerName": "SQL Reviewer", + "workerPrompt": "As an SQL Code Reviewer at {company}, you play a crucial role in ensuring the accuracy, efficiency, and reliability of our SQL queries and database systems. Your expertise in SQL and best practices in database management is essential for maintaining high standards in our data operations.\n\nYour goal is to thoroughly review and validate the SQL queries developed by the SQL Expert to ensure they meet our performance and accuracy standards. Check for potential issues such as syntax errors, performance bottlenecks, and logical inaccuracies. Collaborate with the SQL Expert and SQL Executor to provide constructive feedback and suggest improvements where necessary.\n\nThe output should be a detailed code review report that includes an assessment of each SQL query's accuracy, performance, and correctness. Provide actionable feedback and suggestions to enhance the quality of the SQL code, ensuring it supports our data-driven initiatives effectively.", + "tools": [], + "supervisor": "{{supervisor_0.data.instance}}", + "model": "", + "promptValues": "{\"company\":\"Flowise Inc\"}", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "worker_2-output-worker-Worker", + "name": "worker", + "label": "Worker", + "description": "", + "type": "Worker" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 808, + "selected": false, + "positionAbsolute": { + "x": 1643.1366621404572, + "y": 253.12633995235484 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "supervisor_0", + "targetHandle": "supervisor_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-supervisor_0-supervisor_0-input-model-BaseChatModel" + }, + { + "source": "customFunction_0", + "sourceHandle": "customFunction_0-output-output-string|number|boolean|json|array", + "target": "worker_0", + "targetHandle": "worker_0-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_0-customFunction_0-output-output-string|number|boolean|json|array-worker_0-worker_0-input-promptValues-json" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_0", + "targetHandle": "worker_0-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_0-worker_0-input-supervisor-Supervisor" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_1", + "targetHandle": "worker_1-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_1-worker_1-input-supervisor-Supervisor" + }, + { + "source": "customTool_0", + "sourceHandle": "customTool_0-output-customTool-CustomTool|Tool|StructuredTool|Runnable", + "target": "worker_1", + "targetHandle": "worker_1-input-tools-Tool", + "type": "buttonedge", + "id": "customTool_0-customTool_0-output-customTool-CustomTool|Tool|StructuredTool|Runnable-worker_1-worker_1-input-tools-Tool" + }, + { + "source": "supervisor_0", + "sourceHandle": "supervisor_0-output-supervisor-Supervisor", + "target": "worker_2", + "targetHandle": "worker_2-input-supervisor-Supervisor", + "type": "buttonedge", + "id": "supervisor_0-supervisor_0-output-supervisor-Supervisor-worker_2-worker_2-input-supervisor-Supervisor" + } + ] +} diff --git a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json index a7e765ca..9e193b11 100644 --- a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json @@ -1,5 +1,7 @@ { "description": "Return response as a JSON structure as specified by a Zod schema", + "categories": "AdvancedStructuredOutputParser,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "badge": "NEW", "nodes": [ { diff --git a/packages/server/src/Interface.ts b/packages/server/src/Interface.ts index 479d4c3b..8a54c130 100644 --- a/packages/server/src/Interface.ts +++ b/packages/server/src/Interface.ts @@ -2,6 +2,8 @@ import { ICommonObject, IFileUpload, INode, INodeData as INodeDataFromComponent, export type MessageType = 'apiMessage' | 'userMessage' +export type ChatflowType = 'CHATFLOW' | 'MULTIAGENT' + export enum chatType { INTERNAL = 'INTERNAL', EXTERNAL = 'EXTERNAL' @@ -25,7 +27,9 @@ export interface IChatFlow { apikeyid?: string analytic?: string chatbotConfig?: string - apiConfig?: any + apiConfig?: string + category?: string + type?: ChatflowType } export interface IChatMessage { @@ -36,6 +40,7 @@ export interface IChatMessage { sourceDocuments?: string usedTools?: string fileAnnotations?: string + agentReasoning?: string fileUploads?: string chatType: string chatId: string diff --git a/packages/server/src/controllers/chat-messages/index.ts b/packages/server/src/controllers/chat-messages/index.ts index 7c32fb4c..8ed67399 100644 --- a/packages/server/src/controllers/chat-messages/index.ts +++ b/packages/server/src/controllers/chat-messages/index.ts @@ -150,9 +150,25 @@ const removeAllChatMessages = async (req: Request, res: Response, next: NextFunc } } +const abortChatMessage = async (req: Request, res: Response, next: NextFunction) => { + try { + if (typeof req.params === 'undefined' || !req.params.chatflowid || !req.params.chatid) { + throw new InternalFlowiseError( + StatusCodes.PRECONDITION_FAILED, + `Error: chatMessagesController.abortChatMessage - chatflowid or chatid not provided!` + ) + } + await chatMessagesService.abortChatMessage(req.params.chatid, req.params.chatflowid) + return res.json({ status: 200, message: 'Chat message aborted' }) + } catch (error) { + next(error) + } +} + export default { createChatMessage, getAllChatMessages, getAllInternalChatMessages, - removeAllChatMessages + removeAllChatMessages, + abortChatMessage } diff --git a/packages/server/src/controllers/chatflows/index.ts b/packages/server/src/controllers/chatflows/index.ts index 8923bf55..dc86090a 100644 --- a/packages/server/src/controllers/chatflows/index.ts +++ b/packages/server/src/controllers/chatflows/index.ts @@ -5,6 +5,7 @@ import { createRateLimiter } from '../../utils/rateLimit' import { getApiKey } from '../../utils/apiKey' import { InternalFlowiseError } from '../../errors/internalFlowiseError' import { StatusCodes } from 'http-status-codes' +import { ChatflowType } from '../../Interface' const checkIfChatflowIsValidForStreaming = async (req: Request, res: Response, next: NextFunction) => { try { @@ -50,7 +51,7 @@ const deleteChatflow = async (req: Request, res: Response, next: NextFunction) = const getAllChatflows = async (req: Request, res: Response, next: NextFunction) => { try { - const apiResponse = await chatflowsService.getAllChatflows() + const apiResponse = await chatflowsService.getAllChatflows(req.query?.type as ChatflowType) return res.json(apiResponse) } catch (error) { next(error) @@ -60,17 +61,17 @@ const getAllChatflows = async (req: Request, res: Response, next: NextFunction) // Get specific chatflow via api key const getChatflowByApiKey = async (req: Request, res: Response, next: NextFunction) => { try { - if (typeof req.params === 'undefined' || !req.params.apiKey) { + if (typeof req.params === 'undefined' || !req.params.apikey) { throw new InternalFlowiseError( StatusCodes.PRECONDITION_FAILED, - `Error: chatflowsRouter.getChatflowByApiKey - apiKey not provided!` + `Error: chatflowsRouter.getChatflowByApiKey - apikey not provided!` ) } - const apiKey = await getApiKey(req.params.apiKey) - if (!apiKey) { + const apikey = await getApiKey(req.params.apikey) + if (!apikey) { return res.status(401).send('Unauthorized') } - const apiResponse = await chatflowsService.getChatflowByApiKey(apiKey.id) + const apiResponse = await chatflowsService.getChatflowByApiKey(apikey.id) return res.json(apiResponse) } catch (error) { next(error) diff --git a/packages/server/src/database/entities/ChatFlow.ts b/packages/server/src/database/entities/ChatFlow.ts index d654128d..e0d2da50 100644 --- a/packages/server/src/database/entities/ChatFlow.ts +++ b/packages/server/src/database/entities/ChatFlow.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import { Entity, Column, CreateDateColumn, UpdateDateColumn, PrimaryGeneratedColumn } from 'typeorm' -import { IChatFlow } from '../../Interface' +import { ChatflowType, IChatFlow } from '../../Interface' @Entity() export class ChatFlow implements IChatFlow { @@ -34,6 +34,12 @@ export class ChatFlow implements IChatFlow { @Column({ nullable: true, type: 'text' }) speechToText?: string + @Column({ nullable: true, type: 'text' }) + category?: string + + @Column({ nullable: true, type: 'text' }) + type?: ChatflowType + @Column({ type: 'timestamp' }) @CreateDateColumn() createdDate: Date @@ -41,7 +47,4 @@ export class ChatFlow implements IChatFlow { @Column({ type: 'timestamp' }) @UpdateDateColumn() updatedDate: Date - - @Column({ nullable: true, type: 'text' }) - category?: string } diff --git a/packages/server/src/database/entities/ChatMessage.ts b/packages/server/src/database/entities/ChatMessage.ts index 4cc84983..af7ccb0f 100644 --- a/packages/server/src/database/entities/ChatMessage.ts +++ b/packages/server/src/database/entities/ChatMessage.ts @@ -26,6 +26,9 @@ export class ChatMessage implements IChatMessage { @Column({ nullable: true, type: 'text' }) fileAnnotations?: string + @Column({ nullable: true, type: 'text' }) + agentReasoning?: string + @Column({ nullable: true, type: 'text' }) fileUploads?: string diff --git a/packages/server/src/database/migrations/mysql/1714679514451-AddAgentReasoningToChatMessage.ts b/packages/server/src/database/migrations/mysql/1714679514451-AddAgentReasoningToChatMessage.ts new file mode 100644 index 00000000..c1987256 --- /dev/null +++ b/packages/server/src/database/migrations/mysql/1714679514451-AddAgentReasoningToChatMessage.ts @@ -0,0 +1,12 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddAgentReasoningToChatMessage1714679514451 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const columnExists = await queryRunner.hasColumn('chat_message', 'agentReasoning') + if (!columnExists) queryRunner.query(`ALTER TABLE \`chat_message\` ADD COLUMN \`agentReasoning\` LONGTEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`chat_message\` DROP COLUMN \`agentReasoning\`;`) + } +} diff --git a/packages/server/src/database/migrations/mysql/1766759476232-AddTypeToChatFlow.ts b/packages/server/src/database/migrations/mysql/1766759476232-AddTypeToChatFlow.ts new file mode 100644 index 00000000..f19e4ad5 --- /dev/null +++ b/packages/server/src/database/migrations/mysql/1766759476232-AddTypeToChatFlow.ts @@ -0,0 +1,12 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddTypeToChatFlow1766759476232 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const columnExists = await queryRunner.hasColumn('chat_flow', 'type') + if (!columnExists) queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`type\` TEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`chat_flow\` DROP COLUMN \`type\`;`) + } +} diff --git a/packages/server/src/database/migrations/mysql/index.ts b/packages/server/src/database/migrations/mysql/index.ts index 65de0bb4..f8c594ca 100644 --- a/packages/server/src/database/migrations/mysql/index.ts +++ b/packages/server/src/database/migrations/mysql/index.ts @@ -18,6 +18,8 @@ import { AddFeedback1707213626553 } from './1707213626553-AddFeedback' import { AddDocumentStore1711637331047 } from './1711637331047-AddDocumentStore' import { AddLead1710832127079 } from './1710832127079-AddLead' import { AddLeadToChatMessage1711538023578 } from './1711538023578-AddLeadToChatMessage' +import { AddAgentReasoningToChatMessage1714679514451 } from './1714679514451-AddAgentReasoningToChatMessage' +import { AddTypeToChatFlow1766759476232 } from './1766759476232-AddTypeToChatFlow' export const mysqlMigrations = [ Init1693840429259, @@ -32,12 +34,14 @@ export const mysqlMigrations = [ AddUsedToolsToChatMessage1699481607341, AddCategoryToChatFlow1699900910291, AddFileAnnotationsToChatMessage1700271021237, - AddFileUploadsToChatMessage1701788586491, AddVariableEntity1699325775451, + AddFileUploadsToChatMessage1701788586491, AddSpeechToText1706364937060, AddUpsertHistoryEntity1709814301358, AddFeedback1707213626553, AddDocumentStore1711637331047, AddLead1710832127079, - AddLeadToChatMessage1711538023578 + AddLeadToChatMessage1711538023578, + AddAgentReasoningToChatMessage1714679514451, + AddTypeToChatFlow1766759476232 ] diff --git a/packages/server/src/database/migrations/postgres/1714679514451-AddAgentReasoningToChatMessage.ts b/packages/server/src/database/migrations/postgres/1714679514451-AddAgentReasoningToChatMessage.ts new file mode 100644 index 00000000..d0a76b55 --- /dev/null +++ b/packages/server/src/database/migrations/postgres/1714679514451-AddAgentReasoningToChatMessage.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddAgentReasoningToChatMessage1714679514451 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_message" ADD COLUMN IF NOT EXISTS "agentReasoning" TEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_message" DROP COLUMN "agentReasoning";`) + } +} diff --git a/packages/server/src/database/migrations/postgres/1766759476232-AddTypeToChatFlow.ts b/packages/server/src/database/migrations/postgres/1766759476232-AddTypeToChatFlow.ts new file mode 100644 index 00000000..ad79a197 --- /dev/null +++ b/packages/server/src/database/migrations/postgres/1766759476232-AddTypeToChatFlow.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddTypeToChatFlow1766759476232 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_flow" ADD COLUMN IF NOT EXISTS "type" TEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_flow" DROP COLUMN "type";`) + } +} diff --git a/packages/server/src/database/migrations/postgres/index.ts b/packages/server/src/database/migrations/postgres/index.ts index b366071a..abcf8173 100644 --- a/packages/server/src/database/migrations/postgres/index.ts +++ b/packages/server/src/database/migrations/postgres/index.ts @@ -19,6 +19,8 @@ import { FieldTypes1710497452584 } from './1710497452584-FieldTypes' import { AddDocumentStore1711637331047 } from './1711637331047-AddDocumentStore' import { AddLead1710832137905 } from './1710832137905-AddLead' import { AddLeadToChatMessage1711538016098 } from './1711538016098-AddLeadToChatMessage' +import { AddAgentReasoningToChatMessage1714679514451 } from './1714679514451-AddAgentReasoningToChatMessage' +import { AddTypeToChatFlow1766759476232 } from './1766759476232-AddTypeToChatFlow' export const postgresMigrations = [ Init1693891895163, @@ -33,13 +35,15 @@ export const postgresMigrations = [ AddUsedToolsToChatMessage1699481607341, AddCategoryToChatFlow1699900910291, AddFileAnnotationsToChatMessage1700271021237, - AddFileUploadsToChatMessage1701788586491, AddVariableEntity1699325775451, + AddFileUploadsToChatMessage1701788586491, AddSpeechToText1706364937060, AddUpsertHistoryEntity1709814301358, AddFeedback1707213601923, FieldTypes1710497452584, AddDocumentStore1711637331047, AddLead1710832137905, - AddLeadToChatMessage1711538016098 + AddLeadToChatMessage1711538016098, + AddAgentReasoningToChatMessage1714679514451, + AddTypeToChatFlow1766759476232 ] diff --git a/packages/server/src/database/migrations/sqlite/1714679514451-AddAgentReasoningToChatMessage.ts b/packages/server/src/database/migrations/sqlite/1714679514451-AddAgentReasoningToChatMessage.ts new file mode 100644 index 00000000..8a1c8ea8 --- /dev/null +++ b/packages/server/src/database/migrations/sqlite/1714679514451-AddAgentReasoningToChatMessage.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddAgentReasoningToChatMessage1714679514451 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_message" ADD COLUMN "agentReasoning" TEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_message" DROP COLUMN "agentReasoning";`) + } +} diff --git a/packages/server/src/database/migrations/sqlite/1766759476232-AddTypeToChatFlow.ts b/packages/server/src/database/migrations/sqlite/1766759476232-AddTypeToChatFlow.ts new file mode 100644 index 00000000..f41d9ed9 --- /dev/null +++ b/packages/server/src/database/migrations/sqlite/1766759476232-AddTypeToChatFlow.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from 'typeorm' + +export class AddTypeToChatFlow1766759476232 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_flow" ADD COLUMN "type" TEXT;`) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "chat_flow" DROP COLUMN "type";`) + } +} diff --git a/packages/server/src/database/migrations/sqlite/index.ts b/packages/server/src/database/migrations/sqlite/index.ts index 22d3e790..35237efd 100644 --- a/packages/server/src/database/migrations/sqlite/index.ts +++ b/packages/server/src/database/migrations/sqlite/index.ts @@ -18,6 +18,8 @@ import { AddFeedback1707213619308 } from './1707213619308-AddFeedback' import { AddDocumentStore1711637331047 } from './1711637331047-AddDocumentStore' import { AddLead1710832117612 } from './1710832117612-AddLead' import { AddLeadToChatMessage1711537986113 } from './1711537986113-AddLeadToChatMessage' +import { AddAgentReasoningToChatMessage1714679514451 } from './1714679514451-AddAgentReasoningToChatMessage' +import { AddTypeToChatFlow1766759476232 } from './1766759476232-AddTypeToChatFlow' export const sqliteMigrations = [ Init1693835579790, @@ -32,12 +34,14 @@ export const sqliteMigrations = [ AddUsedToolsToChatMessage1699481607341, AddCategoryToChatFlow1699900910291, AddFileAnnotationsToChatMessage1700271021237, - AddFileUploadsToChatMessage1701788586491, AddVariableEntity1699325775451, + AddFileUploadsToChatMessage1701788586491, AddSpeechToText1706364937060, AddUpsertHistoryEntity1709814301358, AddFeedback1707213619308, AddDocumentStore1711637331047, AddLead1710832117612, - AddLeadToChatMessage1711537986113 + AddLeadToChatMessage1711537986113, + AddAgentReasoningToChatMessage1714679514451, + AddTypeToChatFlow1766759476232 ] diff --git a/packages/server/src/routes/chat-messages/index.ts b/packages/server/src/routes/chat-messages/index.ts index 64dacb13..ca90abcf 100644 --- a/packages/server/src/routes/chat-messages/index.ts +++ b/packages/server/src/routes/chat-messages/index.ts @@ -9,6 +9,7 @@ router.post(['/', '/:id'], chatMessageController.createChatMessage) router.get(['/', '/:id'], chatMessageController.getAllChatMessages) // UPDATE +router.put(['/abort/', '/abort/:chatflowid/:chatid'], chatMessageController.abortChatMessage) // DELETE router.delete(['/', '/:id'], chatMessageController.removeAllChatMessages) diff --git a/packages/server/src/services/apikey/index.ts b/packages/server/src/services/apikey/index.ts index 0bb09d02..06c4f3d5 100644 --- a/packages/server/src/services/apikey/index.ts +++ b/packages/server/src/services/apikey/index.ts @@ -46,7 +46,7 @@ const deleteApiKey = async (id: string) => { } } -const verifyApiKey = async (paramApiKey: string): Promise => { +const verifyApiKey = async (paramApiKey: string): Promise => { try { const apiKey = await getApiKey(paramApiKey) if (!apiKey) { diff --git a/packages/server/src/services/chat-messages/index.ts b/packages/server/src/services/chat-messages/index.ts index 8782b9be..39d0606c 100644 --- a/packages/server/src/services/chat-messages/index.ts +++ b/packages/server/src/services/chat-messages/index.ts @@ -1,4 +1,4 @@ -import { FindOptionsWhere } from 'typeorm' +import { DeleteResult, FindOptionsWhere } from 'typeorm' import { StatusCodes } from 'http-status-codes' import { chatType, IChatMessage } from '../../Interface' import { utilGetChatMessage } from '../../utils/getChatMessage' @@ -36,7 +36,7 @@ const getAllChatMessages = async ( endDate?: string, messageId?: string, feedback?: boolean -): Promise => { +): Promise => { try { const dbResponse = await utilGetChatMessage( chatflowId, @@ -71,7 +71,7 @@ const getAllInternalChatMessages = async ( endDate?: string, messageId?: string, feedback?: boolean -): Promise => { +): Promise => { try { const dbResponse = await utilGetChatMessage( chatflowId, @@ -94,7 +94,11 @@ const getAllInternalChatMessages = async ( } } -const removeAllChatMessages = async (chatId: string, chatflowid: string, deleteOptions: FindOptionsWhere): Promise => { +const removeAllChatMessages = async ( + chatId: string, + chatflowid: string, + deleteOptions: FindOptionsWhere +): Promise => { try { const appServer = getRunningExpressApp() @@ -120,9 +124,32 @@ const removeAllChatMessages = async (chatId: string, chatflowid: string, deleteO } } +const abortChatMessage = async (chatId: string, chatflowid: string) => { + try { + const appServer = getRunningExpressApp() + + const endingNodeData = appServer.chatflowPool.activeChatflows[`${chatflowid}_${chatId}`]?.endingNodeData as any + + if (endingNodeData && endingNodeData.signal) { + try { + endingNodeData.signal.abort() + await appServer.chatflowPool.remove(`${chatflowid}_${chatId}`) + } catch (e) { + logger.error(`[server]: Error aborting chat message for ${chatflowid}, chatId ${chatId}: ${e}`) + } + } + } catch (error) { + throw new InternalFlowiseError( + StatusCodes.INTERNAL_SERVER_ERROR, + `Error: chatMessagesService.abortChatMessage - ${getErrorMessage(error)}` + ) + } +} + export default { createChatMessage, getAllChatMessages, getAllInternalChatMessages, - removeAllChatMessages + removeAllChatMessages, + abortChatMessage } diff --git a/packages/server/src/services/chatflows/index.ts b/packages/server/src/services/chatflows/index.ts index 725071e2..54e7ee47 100644 --- a/packages/server/src/services/chatflows/index.ts +++ b/packages/server/src/services/chatflows/index.ts @@ -1,7 +1,7 @@ import { StatusCodes } from 'http-status-codes' import { InternalFlowiseError } from '../../errors/internalFlowiseError' import { getRunningExpressApp } from '../../utils/getRunningExpressApp' -import { IChatFlow } from '../../Interface' +import { ChatflowType, IChatFlow } from '../../Interface' import { ChatFlow } from '../../database/entities/ChatFlow' import { getAppVersion, getTelemetryFlowObj, isFlowValidForStream, constructGraphs, getEndingNodes } from '../../utils' import logger from '../../utils/logger' @@ -47,6 +47,11 @@ const checkIfChatflowIsValidForStreaming = async (chatflowId: string): Promise node.data.category === 'Multi Agents').length > 0) { + return { isStreaming: true } + } + const dbResponse = { isStreaming: isStreaming } return dbResponse } catch (error) { @@ -99,11 +104,14 @@ const deleteChatflow = async (chatflowId: string): Promise => { } } -const getAllChatflows = async (): Promise => { +const getAllChatflows = async (type?: ChatflowType): Promise => { try { const appServer = getRunningExpressApp() const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow).find() - return dbResponse + if (type === 'MULTIAGENT') { + return dbResponse.filter((chatflow) => chatflow.type === type) + } + return dbResponse.filter((chatflow) => chatflow.type === 'CHATFLOW' || !chatflow.type) } catch (error) { throw new InternalFlowiseError( StatusCodes.INTERNAL_SERVER_ERROR, @@ -114,6 +122,7 @@ const getAllChatflows = async (): Promise => { const getChatflowByApiKey = async (apiKeyId: string): Promise => { try { + // Here we only get chatflows that are bounded by the apikeyid and chatflows that are not bounded by any apikey const appServer = getRunningExpressApp() const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow) .createQueryBuilder('cf') diff --git a/packages/server/src/services/marketplaces/index.ts b/packages/server/src/services/marketplaces/index.ts index 54e43899..1858f769 100644 --- a/packages/server/src/services/marketplaces/index.ts +++ b/packages/server/src/services/marketplaces/index.ts @@ -44,6 +44,25 @@ const getAllTemplates = async () => { } templates.push(template) }) + + marketplaceDir = path.join(__dirname, '..', '..', '..', 'marketplaces', 'agentflows') + jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') + jsonsInDir.forEach((file, index) => { + const filePath = path.join(__dirname, '..', '..', '..', 'marketplaces', 'agentflows', file) + const fileData = fs.readFileSync(filePath) + const fileDataObj = JSON.parse(fileData.toString()) + const template = { + id: index, + templateName: file.split('.json')[0], + flowData: fileData.toString(), + badge: fileDataObj?.badge, + framework: fileDataObj?.framework, + categories: fileDataObj?.categories, + type: 'Agentflow', + description: fileDataObj?.description || '' + } + templates.push(template) + }) const sortedTemplates = templates.sort((a, b) => a.templateName.localeCompare(b.templateName)) const FlowiseDocsQnAIndex = sortedTemplates.findIndex((tmp) => tmp.templateName === 'Flowise Docs QnA') if (FlowiseDocsQnAIndex > 0) { diff --git a/packages/server/src/utils/buildAgentGraph.ts b/packages/server/src/utils/buildAgentGraph.ts new file mode 100644 index 00000000..9ada9eea --- /dev/null +++ b/packages/server/src/utils/buildAgentGraph.ts @@ -0,0 +1,345 @@ +import { + ICommonObject, + IMultiAgentNode, + IAgentReasoning, + ITeamState, + ConsoleCallbackHandler, + additionalCallbacks +} from 'flowise-components' +import { IChatFlow, IComponentNodes, IDepthQueue, IReactFlowNode, IReactFlowObject } from '../Interface' +import { Server } from 'socket.io' +import { buildFlow, getStartingNodes, getEndingNodes, constructGraphs, databaseEntities } from '../utils' +import { getRunningExpressApp } from './getRunningExpressApp' +import logger from './logger' +import { StateGraph, END } from '@langchain/langgraph' +import { BaseMessage, HumanMessage } from '@langchain/core/messages' +import { cloneDeep, flatten } from 'lodash' +import { replaceInputsWithConfig, resolveVariables } from '.' +import { StatusCodes } from 'http-status-codes' +import { InternalFlowiseError } from '../errors/internalFlowiseError' +import { getErrorMessage } from '../errors/utils' + +/** + * Build Agent Graph + * @param {IChatFlow} chatflow + * @param {string} chatId + * @param {string} sessionId + * @param {ICommonObject} incomingInput + * @param {string} baseURL + * @param {Server} socketIO + */ +export const buildAgentGraph = async ( + chatflow: IChatFlow, + chatId: string, + sessionId: string, + incomingInput: ICommonObject, + baseURL?: string, + socketIO?: Server +): Promise => { + try { + const appServer = getRunningExpressApp() + const chatflowid = chatflow.id + + /*** Get chatflows and prepare data ***/ + const flowData = chatflow.flowData + const parsedFlowData: IReactFlowObject = JSON.parse(flowData) + const nodes = parsedFlowData.nodes + const edges = parsedFlowData.edges + + /*** Get Ending Node with Directed Graph ***/ + const { graph, nodeDependencies } = constructGraphs(nodes, edges) + const directedGraph = graph + + const endingNodes = getEndingNodes(nodeDependencies, directedGraph, nodes) + + /*** Get Starting Nodes with Reversed Graph ***/ + const constructedObj = constructGraphs(nodes, edges, { isReversed: true }) + const nonDirectedGraph = constructedObj.graph + let startingNodeIds: string[] = [] + let depthQueue: IDepthQueue = {} + const endingNodeIds = endingNodes.map((n) => n.id) + for (const endingNodeId of endingNodeIds) { + const resx = getStartingNodes(nonDirectedGraph, endingNodeId) + startingNodeIds.push(...resx.startingNodeIds) + depthQueue = Object.assign(depthQueue, resx.depthQueue) + } + startingNodeIds = [...new Set(startingNodeIds)] + + // Initialize nodes like ChatModels, Tools, etc. + const reactFlowNodes = await buildFlow( + startingNodeIds, + nodes, + edges, + graph, + depthQueue, + appServer.nodesPool.componentNodes, + incomingInput.question, + [], + chatId, + sessionId, + chatflowid, + appServer.AppDataSource, + incomingInput?.overrideConfig, + appServer.cachePool, + false, + undefined, + incomingInput.uploads, + baseURL + ) + + const options = { + chatId, + sessionId, + chatflowid, + logger, + analytic: chatflow.analytic, + appDataSource: appServer.AppDataSource, + databaseEntities: databaseEntities, + cachePool: appServer.cachePool, + uploads: incomingInput.uploads, + baseURL, + signal: new AbortController() + } + + let streamResults + let finalResult = '' + let agentReasoning: IAgentReasoning[] = [] + + const workerNodes: IReactFlowNode[] = reactFlowNodes.filter((node: IReactFlowNode) => node.data.name === 'worker') + const supervisorNodes: IReactFlowNode[] = reactFlowNodes.filter((node: IReactFlowNode) => node.data.name === 'supervisor') + + const mapNameToLabel: Record = {} + + for (const node of [...workerNodes, ...supervisorNodes]) { + mapNameToLabel[node.data.instance.name] = node.data.instance.label + } + + try { + streamResults = await compileGraph( + chatflow, + mapNameToLabel, + reactFlowNodes, + endingNodeIds, + appServer.nodesPool.componentNodes, + options, + startingNodeIds, + incomingInput.question, + incomingInput?.overrideConfig + ) + + if (streamResults) { + let isStreamingStarted = false + for await (const output of await streamResults) { + if (!output?.__end__) { + const agentName = Object.keys(output)[0] + const usedTools = output[agentName]?.messages + ? output[agentName].messages.map((msg: any) => msg.additional_kwargs?.usedTools) + : [] + const sourceDocuments = output[agentName]?.messages + ? output[agentName].messages.map((msg: any) => msg.additional_kwargs?.sourceDocuments) + : [] + const messages = output[agentName]?.messages ? output[agentName].messages.map((msg: any) => msg.content) : [] + const reasoning = { + agentName: mapNameToLabel[agentName], + messages, + next: output[agentName]?.next, + instructions: output[agentName]?.instructions, + usedTools: flatten(usedTools), + sourceDocuments: flatten(sourceDocuments) + } + agentReasoning.push(reasoning) + if (socketIO && incomingInput.socketIOClientId) { + if (!isStreamingStarted) { + isStreamingStarted = true + socketIO.to(incomingInput.socketIOClientId).emit('start', JSON.stringify(agentReasoning)) + } + + socketIO.to(incomingInput.socketIOClientId).emit('agentReasoning', JSON.stringify(agentReasoning)) + + // Send loading next agent indicator + if (reasoning.next && reasoning.next !== 'FINISH' && reasoning.next !== 'END') { + socketIO + .to(incomingInput.socketIOClientId) + .emit('nextAgent', mapNameToLabel[reasoning.next] || reasoning.next) + } + } + } else { + finalResult = output.__end__.messages.length ? output.__end__.messages.pop()?.content : '' + if (Array.isArray(finalResult)) finalResult = output.__end__.instructions + + if (finalResult === incomingInput.question) { + const supervisorNode = reactFlowNodes.find((node: IReactFlowNode) => node.data.name === 'supervisor') + const llm = supervisorNode?.data?.instance?.llm + if (llm) { + const res = await llm.invoke(incomingInput.question) + finalResult = res?.content + } + } + + if (socketIO && incomingInput.socketIOClientId) { + socketIO.to(incomingInput.socketIOClientId).emit('token', finalResult) + } + } + } + + return { finalResult, agentReasoning } + } + } catch (e) { + if (socketIO && incomingInput.socketIOClientId) { + socketIO.to(incomingInput.socketIOClientId).emit('abort') + } + return { finalResult, agentReasoning } + } + return streamResults + } catch (e) { + logger.error('[server]: Error:', e) + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Error buildAgentGraph - ${getErrorMessage(e)}`) + } +} + +/** + * Compile Graph + * @param {IChatFlow} chatflow + * @param {Record} mapNameToLabel + * @param {IReactFlowNode[]} reactflowNodes + * @param {string[]} workerNodeIds + * @param {IComponentNodes} componentNodes + * @param {ICommonObject} options + * @param {string[]} startingNodeIds + * @param {string} question + * @param {ICommonObject} overrideConfig + */ +const compileGraph = async ( + chatflow: IChatFlow, + mapNameToLabel: Record, + reactflowNodes: IReactFlowNode[] = [], + workerNodeIds: string[], + componentNodes: IComponentNodes, + options: ICommonObject, + startingNodeIds: string[], + question: string, + overrideConfig?: ICommonObject +) => { + const appServer = getRunningExpressApp() + const channels: ITeamState = { + messages: { + value: (x: BaseMessage[], y: BaseMessage[]) => x.concat(y), + default: () => [] + }, + next: 'initialState', + instructions: "Solve the user's request.", + team_members: [] + } + + const workflowGraph = new StateGraph({ + //@ts-ignore + channels + }) + + const workerNodes = reactflowNodes.filter((node) => workerNodeIds.includes(node.data.id)) + + let supervisorWorkers: { [key: string]: IMultiAgentNode[] } = {} + + // Init worker nodes + for (const workerNode of workerNodes) { + const nodeInstanceFilePath = componentNodes[workerNode.data.name].filePath as string + const nodeModule = await import(nodeInstanceFilePath) + const newNodeInstance = new nodeModule.nodeClass() + + let flowNodeData = cloneDeep(workerNode.data) + if (overrideConfig) flowNodeData = replaceInputsWithConfig(flowNodeData, overrideConfig) + flowNodeData = resolveVariables(flowNodeData, reactflowNodes, question, []) + + try { + const workerResult: IMultiAgentNode = await newNodeInstance.init(flowNodeData, question, options) + const parentSupervisor = workerResult.parentSupervisorName + if (!parentSupervisor || workerResult.type !== 'worker') continue + if (Object.prototype.hasOwnProperty.call(supervisorWorkers, parentSupervisor)) { + supervisorWorkers[parentSupervisor].push(workerResult) + } else { + supervisorWorkers[parentSupervisor] = [workerResult] + } + + workflowGraph.addNode(workerResult.name, workerResult.node) + } catch (e) { + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Error initialize worker nodes - ${getErrorMessage(e)}`) + } + } + + // Init supervisor nodes + for (const supervisor in supervisorWorkers) { + const supervisorInputLabel = mapNameToLabel[supervisor] + const supervisorNode = reactflowNodes.find((node) => supervisorInputLabel === node.data.inputs?.supervisorName) + if (!supervisorNode) continue + + const nodeInstanceFilePath = componentNodes[supervisorNode.data.name].filePath as string + const nodeModule = await import(nodeInstanceFilePath) + const newNodeInstance = new nodeModule.nodeClass() + + let flowNodeData = cloneDeep(supervisorNode.data) + + if (overrideConfig) flowNodeData = replaceInputsWithConfig(flowNodeData, overrideConfig) + flowNodeData = resolveVariables(flowNodeData, reactflowNodes, question, []) + + if (flowNodeData.inputs) flowNodeData.inputs.workerNodes = supervisorWorkers[supervisor] + + try { + const supervisorResult: IMultiAgentNode = await newNodeInstance.init(flowNodeData, question, options) + if (!supervisorResult.workers?.length) continue + + if (supervisorResult.moderations && supervisorResult.moderations.length > 0) { + try { + for (const moderation of supervisorResult.moderations) { + question = await moderation.checkForViolations(question) + } + } catch (e) { + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, getErrorMessage(e)) + } + } + + workflowGraph.addNode(supervisorResult.name, supervisorResult.node) + + for (const worker of supervisorResult.workers) { + workflowGraph.addEdge(worker, supervisorResult.name) + } + + let conditionalEdges: { [key: string]: string } = {} + for (let i = 0; i < supervisorResult.workers.length; i++) { + conditionalEdges[supervisorResult.workers[i]] = supervisorResult.workers[i] + } + + workflowGraph.addConditionalEdges(supervisorResult.name, (x: ITeamState) => x.next, { + ...conditionalEdges, + FINISH: END + }) + + workflowGraph.setEntryPoint(supervisorResult.name) + + // Add agentflow to pool + ;(workflowGraph as any).signal = options.signal + appServer.chatflowPool.add( + `${chatflow.id}_${options.chatId}`, + workflowGraph as any, + reactflowNodes.filter((node) => startingNodeIds.includes(node.id)), + overrideConfig + ) + + // TODO: add persistence + // const memory = new MemorySaver() + const graph = workflowGraph.compile() + + const loggerHandler = new ConsoleCallbackHandler(logger) + const callbacks = await additionalCallbacks(flowNodeData, options) + + // Return stream result as we should only have 1 supervisor + return await graph.stream( + { + messages: [new HumanMessage({ content: question })] + }, + { recursionLimit: supervisorResult?.recursionLimit ?? 100, callbacks: [loggerHandler, ...callbacks] } + ) + } catch (e) { + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Error initialize supervisor nodes - ${getErrorMessage(e)}`) + } + } +} diff --git a/packages/server/src/utils/buildChatflow.ts b/packages/server/src/utils/buildChatflow.ts index 03035e06..3fcf03fa 100644 --- a/packages/server/src/utils/buildChatflow.ts +++ b/packages/server/src/utils/buildChatflow.ts @@ -1,7 +1,18 @@ import { Request } from 'express' import { IFileUpload, convertSpeechToText, ICommonObject, addSingleFileToStorage, addArrayFilesToStorage } from 'flowise-components' import { StatusCodes } from 'http-status-codes' -import { IncomingInput, IMessage, INodeData, IReactFlowObject, IReactFlowNode, IDepthQueue, chatType, IChatMessage } from '../Interface' +import { + IncomingInput, + IMessage, + INodeData, + IReactFlowObject, + IReactFlowNode, + IDepthQueue, + chatType, + IChatMessage, + IChatFlow, + IReactFlowEdge +} from '../Interface' import { InternalFlowiseError } from '../errors/internalFlowiseError' import { ChatFlow } from '../database/entities/ChatFlow' import { Server } from 'socket.io' @@ -30,6 +41,8 @@ import { omit } from 'lodash' import * as fs from 'fs' import logger from './logger' import { utilAddChatMessage } from './addChatMesage' +import { buildAgentGraph } from './buildAgentGraph' +import { getErrorMessage } from '../errors/utils' /** * Build Chatflow @@ -41,6 +54,8 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter try { const appServer = getRunningExpressApp() const chatflowid = req.params.id + const baseURL = `${req.protocol}://${req.get('host')}` + let incomingInput: IncomingInput = req.body let nodeToExecuteData: INodeData const chatflow = await appServer.AppDataSource.getRepository(ChatFlow).findOneBy({ @@ -140,11 +155,34 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter const nodes = parsedFlowData.nodes const edges = parsedFlowData.edges - // Get session ID + /*** Get session ID ***/ const memoryNode = findMemoryNode(nodes, edges) const memoryType = memoryNode?.data.label let sessionId = getMemorySessionId(memoryNode, incomingInput, chatId, isInternal) + /*** Get Ending Node with Directed Graph ***/ + const { graph, nodeDependencies } = constructGraphs(nodes, edges) + const directedGraph = graph + const endingNodes = getEndingNodes(nodeDependencies, directedGraph, nodes) + + /*** If the graph is an agent graph, build the agent response ***/ + if (endingNodes.filter((node) => node.data.category === 'Multi Agents').length) { + return await utilBuildAgentResponse( + chatflow, + isInternal, + chatId, + memoryType ?? '', + sessionId, + userMessageDateTime, + fileUploads, + incomingInput, + nodes, + edges, + socketIO, + baseURL + ) + } + // Get prepend messages const prependMessages = incomingInput.history @@ -153,7 +191,6 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter * - Still in sync (i.e the flow has not been modified since) * - Existing overrideConfig and new overrideConfig are the same * - Flow doesn't start with/contain nodes that depend on incomingInput.question - * TODO: convert overrideConfig to hash when we no longer store base64 string but filepath ***/ const isFlowReusable = () => { return ( @@ -176,13 +213,7 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter `[server]: Reuse existing chatflow ${chatflowid} with ending node ${nodeToExecuteData.label} (${nodeToExecuteData.id})` ) } else { - /*** Get Ending Node with Directed Graph ***/ - const { graph, nodeDependencies } = constructGraphs(nodes, edges) - const directedGraph = graph - - const endingNodes = getEndingNodes(nodeDependencies, directedGraph, nodes) - - let isCustomFunctionEndingNode = endingNodes.some((node) => node.data?.outputs?.output === 'EndingNode') + const isCustomFunctionEndingNode = endingNodes.some((node) => node.data?.outputs?.output === 'EndingNode') for (const endingNode of endingNodes) { const endingNodeData = endingNode.data @@ -268,7 +299,10 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter appServer.cachePool, false, undefined, - incomingInput.uploads + incomingInput.uploads, + baseURL, + socketIO, + incomingInput.socketIOClientId ) const nodeToExecute = @@ -372,13 +406,92 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter // this is used when input text is empty but question is in audio format result.question = incomingInput.question result.chatId = chatId - result.chatMessageId = chatMessage.id + result.chatMessageId = chatMessage?.id if (sessionId) result.sessionId = sessionId if (memoryType) result.memoryType = memoryType return result - } catch (e: any) { + } catch (e) { logger.error('[server]: Error:', e) - throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, e.message) + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, getErrorMessage(e)) + } +} + +const utilBuildAgentResponse = async ( + chatflow: IChatFlow, + isInternal: boolean, + chatId: string, + memoryType: string, + sessionId: string, + userMessageDateTime: Date, + fileUploads: IFileUpload[], + incomingInput: ICommonObject, + nodes: IReactFlowNode[], + edges: IReactFlowEdge[], + socketIO?: Server, + baseURL?: string +) => { + try { + const appServer = getRunningExpressApp() + const streamResults = await buildAgentGraph(chatflow, chatId, sessionId, incomingInput, baseURL, socketIO) + if (streamResults) { + const { finalResult, agentReasoning } = streamResults + const userMessage: Omit = { + role: 'userMessage', + content: incomingInput.question, + chatflowid: chatflow.id, + chatType: isInternal ? chatType.INTERNAL : chatType.EXTERNAL, + chatId, + memoryType, + sessionId, + createdDate: userMessageDateTime, + fileUploads: incomingInput.uploads ? JSON.stringify(fileUploads) : undefined, + leadEmail: incomingInput.leadEmail + } + await utilAddChatMessage(userMessage) + + const apiMessage: Omit = { + role: 'apiMessage', + content: finalResult, + chatflowid: chatflow.id, + chatType: isInternal ? chatType.INTERNAL : chatType.EXTERNAL, + chatId, + memoryType, + sessionId + } + if (agentReasoning.length) apiMessage.agentReasoning = JSON.stringify(agentReasoning) + const chatMessage = await utilAddChatMessage(apiMessage) + + await appServer.telemetry.sendTelemetry('prediction_sent', { + version: await getAppVersion(), + chatlowId: chatflow.id, + chatId, + type: isInternal ? chatType.INTERNAL : chatType.EXTERNAL, + flowGraph: getTelemetryFlowObj(nodes, edges) + }) + + // Prepare response + let result: ICommonObject = {} + result.text = finalResult + result.question = incomingInput.question + result.chatId = chatId + result.chatMessageId = chatMessage?.id + if (sessionId) result.sessionId = sessionId + if (memoryType) result.memoryType = memoryType + if (agentReasoning.length) result.agentReasoning = agentReasoning + + await appServer.telemetry.sendTelemetry('graph_compiled', { + version: await getAppVersion(), + graphId: chatflow.id, + type: isInternal ? chatType.INTERNAL : chatType.EXTERNAL, + flowGraph: getTelemetryFlowObj(nodes, edges) + }) + + return result + } + return undefined + } catch (e) { + logger.error('[server]: Error:', e) + throw new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, getErrorMessage(e)) } } diff --git a/packages/server/src/utils/getUploadsConfig.ts b/packages/server/src/utils/getUploadsConfig.ts index 13d18eb9..d89e1848 100644 --- a/packages/server/src/utils/getUploadsConfig.ts +++ b/packages/server/src/utils/getUploadsConfig.ts @@ -18,7 +18,7 @@ export const utilGetUploadsConfig = async (chatflowid: string): Promise => throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Chatflow ${chatflowid} not found`) } - const uploadAllowedNodes = ['llmChain', 'conversationChain', 'reactAgentChat', 'conversationalAgent', 'toolAgent'] + const uploadAllowedNodes = ['llmChain', 'conversationChain', 'reactAgentChat', 'conversationalAgent', 'toolAgent', 'supervisor'] const uploadProcessingNodes = ['chatOpenAI', 'chatAnthropic', 'awsChatBedrock', 'azureChatOpenAI', 'chatGoogleGenerativeAI'] const flowObj = JSON.parse(chatflow.flowData) diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index 5da29ba8..1b5d9ed6 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -1,6 +1,7 @@ import path from 'path' import fs from 'fs' import logger from './logger' +import { Server } from 'socket.io' import { IComponentCredentials, IComponentNodes, @@ -267,9 +268,10 @@ export const getEndingNodes = ( endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents' && - endingNodeData.category !== 'Engine' + endingNodeData.category !== 'Engine' && + endingNodeData.category !== 'Multi Agents' ) { - error = new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Ending node must be either a Chain or Agent`) + error = new InternalFlowiseError(StatusCodes.INTERNAL_SERVER_ERROR, `Ending node must be either a Chain or Agent or Engine`) continue } } @@ -443,7 +445,10 @@ export const buildFlow = async ( cachePool?: CachePool, isUpsert?: boolean, stopNodeId?: string, - uploads?: IFileUpload[] + uploads?: IFileUpload[], + baseURL?: string, + socketIO?: Server, + socketIOClientId?: string ) => { const flowNodes = cloneDeep(reactFlowNodes) @@ -496,7 +501,10 @@ export const buildFlow = async ( databaseEntities, cachePool, dynamicVariables, - uploads + uploads, + baseURL, + socketIO, + socketIOClientId }) if (indexResult) upsertHistory['result'] = indexResult logger.debug(`[server]: Finished upserting ${reactFlowNode.data.label} (${reactFlowNode.data.id})`) @@ -520,7 +528,10 @@ export const buildFlow = async ( cachePool, isUpsert, dynamicVariables, - uploads + uploads, + baseURL, + socketIO, + socketIOClientId }) // Save dynamic variables @@ -1048,7 +1059,6 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[], component } } } - return configs } diff --git a/packages/ui/src/api/chatflows.js b/packages/ui/src/api/chatflows.js index 586fe183..aa305d14 100644 --- a/packages/ui/src/api/chatflows.js +++ b/packages/ui/src/api/chatflows.js @@ -2,6 +2,8 @@ import client from './client' const getAllChatflows = () => client.get('/chatflows') +const getAllAgentflows = () => client.get('/chatflows?type=MULTIAGENT') + const getSpecificChatflow = (id) => client.get(`/chatflows/${id}`) const getSpecificChatflowFromPublicEndpoint = (id) => client.get(`/public-chatflows/${id}`) @@ -18,6 +20,7 @@ const getAllowChatflowUploads = (id) => client.get(`/chatflows-uploads/${id}`) export default { getAllChatflows, + getAllAgentflows, getSpecificChatflow, getSpecificChatflowFromPublicEndpoint, createNewChatflow, diff --git a/packages/ui/src/api/chatmessage.js b/packages/ui/src/api/chatmessage.js index 8760ce07..aa8edfc8 100644 --- a/packages/ui/src/api/chatmessage.js +++ b/packages/ui/src/api/chatmessage.js @@ -7,11 +7,13 @@ const getAllChatmessageFromChatflow = (id, params = {}) => const getChatmessageFromPK = (id, params = {}) => client.get(`/chatmessage/${id}`, { params: { order: 'ASC', feedback: true, ...params } }) const deleteChatmessage = (id, params = {}) => client.delete(`/chatmessage/${id}`, { params: { ...params } }) const getStoragePath = () => client.get(`/get-upload-path`) +const abortMessage = (chatflowid, chatid) => client.put(`/chatmessage/abort/${chatflowid}/${chatid}`) export default { getInternalChatmessageFromChatflow, getAllChatmessageFromChatflow, getChatmessageFromPK, deleteChatmessage, - getStoragePath + getStoragePath, + abortMessage } diff --git a/packages/ui/src/assets/images/agentgraph.png b/packages/ui/src/assets/images/agentgraph.png new file mode 100644 index 00000000..384dec20 Binary files /dev/null and b/packages/ui/src/assets/images/agentgraph.png differ diff --git a/packages/ui/src/assets/images/agents_empty.svg b/packages/ui/src/assets/images/agents_empty.svg new file mode 100644 index 00000000..8fbf0881 --- /dev/null +++ b/packages/ui/src/assets/images/agents_empty.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/ui/src/assets/images/assistant_empty.svg b/packages/ui/src/assets/images/assistant_empty.svg new file mode 100644 index 00000000..cc9cda37 --- /dev/null +++ b/packages/ui/src/assets/images/assistant_empty.svg @@ -0,0 +1 @@ +server down \ No newline at end of file diff --git a/packages/ui/src/assets/images/multiagent_supervisor.png b/packages/ui/src/assets/images/multiagent_supervisor.png new file mode 100644 index 00000000..3c11bb9f Binary files /dev/null and b/packages/ui/src/assets/images/multiagent_supervisor.png differ diff --git a/packages/ui/src/assets/images/multiagent_worker.png b/packages/ui/src/assets/images/multiagent_worker.png new file mode 100644 index 00000000..3b6e812e Binary files /dev/null and b/packages/ui/src/assets/images/multiagent_worker.png differ diff --git a/packages/ui/src/assets/images/next-agent.gif b/packages/ui/src/assets/images/next-agent.gif new file mode 100644 index 00000000..956c129d Binary files /dev/null and b/packages/ui/src/assets/images/next-agent.gif differ diff --git a/packages/ui/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.jsx b/packages/ui/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.jsx index d4d40917..f9a2959b 100644 --- a/packages/ui/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.jsx +++ b/packages/ui/src/layout/MainLayout/Sidebar/MenuList/NavItem/index.jsx @@ -135,6 +135,18 @@ const NavItem = ({ item, level, navType, onClick, onUploadFile }) => { avatar={item.chip.avatar && {item.chip.avatar}} /> )} + {item.isBeta && ( + + )} ) } diff --git a/packages/ui/src/menu-items/agentsettings.js b/packages/ui/src/menu-items/agentsettings.js new file mode 100644 index 00000000..0fef2225 --- /dev/null +++ b/packages/ui/src/menu-items/agentsettings.js @@ -0,0 +1,84 @@ +// assets +import { + IconTrash, + IconFileUpload, + IconFileExport, + IconCopy, + IconMessage, + IconDatabaseExport, + IconAdjustmentsHorizontal, + IconUsers +} from '@tabler/icons-react' + +// constant +const icons = { + IconTrash, + IconFileUpload, + IconFileExport, + IconCopy, + IconMessage, + IconDatabaseExport, + IconAdjustmentsHorizontal, + IconUsers +} + +// ==============================|| SETTINGS MENU ITEMS ||============================== // + +const agent_settings = { + id: 'settings', + title: '', + type: 'group', + children: [ + { + id: 'viewMessages', + title: 'View Messages', + type: 'item', + url: '', + icon: icons.IconMessage + }, + { + id: 'viewLeads', + title: 'View Leads', + type: 'item', + url: '', + icon: icons.IconUsers + }, + { + id: 'chatflowConfiguration', + title: 'Configuration', + type: 'item', + url: '', + icon: icons.IconAdjustmentsHorizontal + }, + { + id: 'duplicateChatflow', + title: 'Duplicate Agents', + type: 'item', + url: '', + icon: icons.IconCopy + }, + { + id: 'loadChatflow', + title: 'Load Agents', + type: 'item', + url: '', + icon: icons.IconFileUpload + }, + { + id: 'exportChatflow', + title: 'Export Agents', + type: 'item', + url: '', + icon: icons.IconFileExport + }, + { + id: 'deleteChatflow', + title: 'Delete Agents', + type: 'item', + url: '', + icon: icons.IconTrash + } + ] +} + +export default agent_settings diff --git a/packages/ui/src/menu-items/dashboard.js b/packages/ui/src/menu-items/dashboard.js index 766e205d..95992e96 100644 --- a/packages/ui/src/menu-items/dashboard.js +++ b/packages/ui/src/menu-items/dashboard.js @@ -1,8 +1,18 @@ // assets -import { IconHierarchy, IconBuildingStore, IconKey, IconTool, IconLock, IconRobot, IconVariable, IconFiles } from '@tabler/icons-react' +import { + IconUsersGroup, + IconHierarchy, + IconBuildingStore, + IconKey, + IconTool, + IconLock, + IconRobot, + IconVariable, + IconFiles +} from '@tabler/icons-react' // constant -const icons = { IconHierarchy, IconBuildingStore, IconKey, IconTool, IconLock, IconRobot, IconVariable, IconFiles } +const icons = { IconUsersGroup, IconHierarchy, IconBuildingStore, IconKey, IconTool, IconLock, IconRobot, IconVariable, IconFiles } // ==============================|| DASHBOARD MENU ITEMS ||============================== // @@ -19,6 +29,15 @@ const dashboard = { icon: icons.IconHierarchy, breadcrumbs: true }, + { + id: 'agentflows', + title: 'Agentflows', + type: 'item', + url: '/agentflows', + icon: icons.IconUsersGroup, + breadcrumbs: true, + isBeta: true + }, { id: 'marketplaces', title: 'Marketplaces', @@ -68,7 +87,7 @@ const dashboard = { breadcrumbs: true }, { - id: 'documents', + id: 'document-stores', title: 'Document Stores', type: 'item', url: '/document-stores', diff --git a/packages/ui/src/routes/CanvasRoutes.jsx b/packages/ui/src/routes/CanvasRoutes.jsx index f0ea1eb3..0a278c0f 100644 --- a/packages/ui/src/routes/CanvasRoutes.jsx +++ b/packages/ui/src/routes/CanvasRoutes.jsx @@ -22,6 +22,14 @@ const CanvasRoutes = { path: '/canvas/:id', element: }, + { + path: '/agentcanvas', + element: + }, + { + path: '/agentcanvas/:id', + element: + }, { path: '/marketplace/:id', element: diff --git a/packages/ui/src/routes/MainRoutes.jsx b/packages/ui/src/routes/MainRoutes.jsx index 9b2db964..76783dc0 100644 --- a/packages/ui/src/routes/MainRoutes.jsx +++ b/packages/ui/src/routes/MainRoutes.jsx @@ -7,6 +7,9 @@ import Loadable from '@/ui-component/loading/Loadable' // chatflows routing const Chatflows = Loadable(lazy(() => import('@/views/chatflows'))) +// agents routing +const Agentflows = Loadable(lazy(() => import('@/views/agentflows'))) + // marketplaces routing const Marketplaces = Loadable(lazy(() => import('@/views/marketplaces'))) @@ -45,6 +48,10 @@ const MainRoutes = { path: '/chatflows', element: }, + { + path: '/agentflows', + element: + }, { path: '/marketplaces', element: diff --git a/packages/ui/src/ui-component/button/FlowListMenu.jsx b/packages/ui/src/ui-component/button/FlowListMenu.jsx index b0abee6d..07c44104 100644 --- a/packages/ui/src/ui-component/button/FlowListMenu.jsx +++ b/packages/ui/src/ui-component/button/FlowListMenu.jsx @@ -72,7 +72,7 @@ const StyledMenu = styled((props) => ( } })) -export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { +export default function FlowListMenu({ chatflow, isAgentCanvas, setError, updateFlowsApi }) { const { confirm } = useConfirm() const dispatch = useDispatch() const updateChatflowApi = useApi(chatflowsApi.updateChatflow) @@ -95,6 +95,8 @@ export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { const [speechToTextDialogOpen, setSpeechToTextDialogOpen] = useState(false) const [speechToTextDialogProps, setSpeechToTextDialogProps] = useState({}) + const title = isAgentCanvas ? 'Agents' : 'Chatflow' + const handleClick = (event) => { setAnchorEl(event.currentTarget) } @@ -213,7 +215,7 @@ export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { setAnchorEl(null) const confirmPayload = { title: `Delete`, - description: `Delete chatflow ${chatflow.name}?`, + description: `Delete ${title} ${chatflow.name}?`, confirmButtonName: 'Delete', cancelButtonName: 'Cancel' } @@ -246,7 +248,7 @@ export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { setAnchorEl(null) try { localStorage.setItem('duplicatedFlowData', chatflow.flowData) - window.open(`${uiBaseURL}/canvas`, '_blank') + window.open(`${uiBaseURL}/${isAgentCanvas ? 'agentcanvas' : 'canvas'}`, '_blank') } catch (e) { console.error(e) } @@ -259,7 +261,7 @@ export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { let dataStr = JSON.stringify(generateExportFlowData(flowData), null, 2) let dataUri = 'data:application/json;charset=utf-8,' + encodeURIComponent(dataStr) - let exportFileDefaultName = `${chatflow.name} Chatflow.json` + let exportFileDefaultName = `${chatflow.name} ${title}.json` let linkElement = document.createElement('a') linkElement.setAttribute('href', dataUri) @@ -334,7 +336,7 @@ export default function FlowListMenu({ chatflow, setError, updateFlowsApi }) { { if (chatmsg.usedTools) msg.usedTools = JSON.parse(chatmsg.usedTools) if (chatmsg.fileAnnotations) msg.fileAnnotations = JSON.parse(chatmsg.fileAnnotations) if (chatmsg.feedback) msg.feedback = chatmsg.feedback?.content + if (chatmsg.agentReasoning) msg.agentReasoning = JSON.parse(chatmsg.agentReasoning) if (!Object.prototype.hasOwnProperty.call(obj, chatPK)) { obj[chatPK] = { @@ -319,6 +323,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => { if (chatmsg.sourceDocuments) obj.sourceDocuments = JSON.parse(chatmsg.sourceDocuments) if (chatmsg.usedTools) obj.usedTools = JSON.parse(chatmsg.usedTools) if (chatmsg.fileAnnotations) obj.fileAnnotations = JSON.parse(chatmsg.fileAnnotations) + if (chatmsg.agentReasoning) obj.agentReasoning = JSON.parse(chatmsg.agentReasoning) loadedMessages.push(obj) } @@ -803,6 +808,97 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => { })} )} + {message.agentReasoning && ( +
+ {message.agentReasoning.map((agent, index) => { + return ( + + + + + agentPNG + +
{agent.agentName}
+
+ {agent.messages.length > 0 && ( + + ) : ( + + {children} + + ) + } + }} + > + {agent.messages.length > 1 + ? agent.messages.join('\\n') + : agent.messages[0]} + + )} + {agent.instructions &&

{agent.instructions}

} + {agent.messages.length === 0 && + !agent.instructions &&

Finished

} +
+
+ ) + })} +
+ )}
{/* Messages are being rendered in Markdown format */} ({ } })) -export const FlowListTable = ({ data, images, isLoading, filterFunction, updateFlowsApi, setError }) => { +export const FlowListTable = ({ data, images, isLoading, filterFunction, updateFlowsApi, setError, isAgentCanvas }) => { const theme = useTheme() const customization = useSelector((state) => state.customization) @@ -128,7 +128,10 @@ export const FlowListTable = ({ data, images, isLoading, filterFunction, updateF overflow: 'hidden' }} > - + {row.templateName || row.name} @@ -211,7 +214,12 @@ export const FlowListTable = ({ data, images, isLoading, filterFunction, updateF justifyContent='center' alignItems='center' > - + @@ -231,5 +239,6 @@ FlowListTable.propTypes = { isLoading: PropTypes.bool, filterFunction: PropTypes.func, updateFlowsApi: PropTypes.object, - setError: PropTypes.func + setError: PropTypes.func, + isAgentCanvas: PropTypes.bool } diff --git a/packages/ui/src/utils/genericHelper.js b/packages/ui/src/utils/genericHelper.js index f474a281..d57a550c 100644 --- a/packages/ui/src/utils/genericHelper.js +++ b/packages/ui/src/utils/genericHelper.js @@ -549,14 +549,14 @@ export const removeDuplicateURL = (message) => { if (!message.sourceDocuments) return newSourceDocuments message.sourceDocuments.forEach((source) => { - if (source.metadata && source.metadata.source) { + if (source && source.metadata && source.metadata.source) { if (isValidURL(source.metadata.source) && !visitedURLs.includes(source.metadata.source)) { visitedURLs.push(source.metadata.source) newSourceDocuments.push(source) } else if (!isValidURL(source.metadata.source)) { newSourceDocuments.push(source) } - } else { + } else if (source) { newSourceDocuments.push(source) } }) diff --git a/packages/ui/src/views/agentflows/index.jsx b/packages/ui/src/views/agentflows/index.jsx new file mode 100644 index 00000000..2d9572e0 --- /dev/null +++ b/packages/ui/src/views/agentflows/index.jsx @@ -0,0 +1,218 @@ +import { useEffect, useState } from 'react' +import { useNavigate } from 'react-router-dom' + +// material-ui +import { Box, Skeleton, Stack, ToggleButton, ToggleButtonGroup } from '@mui/material' +import { useTheme } from '@mui/material/styles' + +// project imports +import MainCard from '@/ui-component/cards/MainCard' +import ItemCard from '@/ui-component/cards/ItemCard' +import { gridSpacing } from '@/store/constant' +import AgentsEmptySVG from '@/assets/images/agents_empty.svg' +import LoginDialog from '@/ui-component/dialog/LoginDialog' +import ConfirmDialog from '@/ui-component/dialog/ConfirmDialog' +import { FlowListTable } from '@/ui-component/table/FlowListTable' +import { StyledButton } from '@/ui-component/button/StyledButton' +import ViewHeader from '@/layout/MainLayout/ViewHeader' +import ErrorBoundary from '@/ErrorBoundary' + +// API +import chatflowsApi from '@/api/chatflows' + +// Hooks +import useApi from '@/hooks/useApi' + +// const +import { baseURL } from '@/store/constant' + +// icons +import { IconPlus, IconLayoutGrid, IconList } from '@tabler/icons-react' + +// ==============================|| AGENTS ||============================== // + +const Agentflows = () => { + const navigate = useNavigate() + const theme = useTheme() + + const [isLoading, setLoading] = useState(true) + const [error, setError] = useState(null) + const [images, setImages] = useState({}) + const [search, setSearch] = useState('') + const [loginDialogOpen, setLoginDialogOpen] = useState(false) + const [loginDialogProps, setLoginDialogProps] = useState({}) + + const getAllAgentflows = useApi(chatflowsApi.getAllAgentflows) + const [view, setView] = useState(localStorage.getItem('flowDisplayStyle') || 'card') + + const handleChange = (event, nextView) => { + if (nextView === null) return + localStorage.setItem('flowDisplayStyle', nextView) + setView(nextView) + } + + const onSearchChange = (event) => { + setSearch(event.target.value) + } + + function filterFlows(data) { + return ( + data.name.toLowerCase().indexOf(search.toLowerCase()) > -1 || + (data.category && data.category.toLowerCase().indexOf(search.toLowerCase()) > -1) + ) + } + + const onLoginClick = (username, password) => { + localStorage.setItem('username', username) + localStorage.setItem('password', password) + navigate(0) + } + + const addNew = () => { + navigate('/agentcanvas') + } + + const goToCanvas = (selectedAgentflow) => { + navigate(`/agentcanvas/${selectedAgentflow.id}`) + } + + useEffect(() => { + getAllAgentflows.request() + + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + useEffect(() => { + if (getAllAgentflows.error) { + if (getAllAgentflows.error?.response?.status === 401) { + setLoginDialogProps({ + title: 'Login', + confirmButtonName: 'Login' + }) + setLoginDialogOpen(true) + } else { + setError(getAllAgentflows.error) + } + } + }, [getAllAgentflows.error]) + + useEffect(() => { + setLoading(getAllAgentflows.loading) + }, [getAllAgentflows.loading]) + + useEffect(() => { + if (getAllAgentflows.data) { + try { + const agentflows = getAllAgentflows.data + const images = {} + for (let i = 0; i < agentflows.length; i += 1) { + const flowDataStr = agentflows[i].flowData + const flowData = JSON.parse(flowDataStr) + const nodes = flowData.nodes || [] + images[agentflows[i].id] = [] + for (let j = 0; j < nodes.length; j += 1) { + const imageSrc = `${baseURL}/api/v1/node-icon/${nodes[j].data.name}` + if (!images[agentflows[i].id].includes(imageSrc)) { + images[agentflows[i].id].push(imageSrc) + } + } + } + setImages(images) + } catch (e) { + console.error(e) + } + } + }, [getAllAgentflows.data]) + + return ( + + {error ? ( + + ) : ( + + + + + + + + + + + } sx={{ borderRadius: 2, height: 40 }}> + Add New + + + {!view || view === 'card' ? ( + <> + {isLoading && !getAllAgentflows.data ? ( + + + + + + ) : ( + + {getAllAgentflows.data?.filter(filterFlows).map((data, index) => ( + goToCanvas(data)} data={data} images={images[data.id]} /> + ))} + + )} + + ) : ( + + )} + {!isLoading && (!getAllAgentflows.data || getAllAgentflows.data.length === 0) && ( + + + AgentsEmptySVG + +
No Agents Yet
+
+ )} +
+ )} + + + +
+ ) +} + +export default Agentflows diff --git a/packages/ui/src/views/apikey/index.jsx b/packages/ui/src/views/apikey/index.jsx index 055ac144..d0c3bd56 100644 --- a/packages/ui/src/views/apikey/index.jsx +++ b/packages/ui/src/views/apikey/index.jsx @@ -355,7 +355,7 @@ const APIKey = () => { APIEmptySVG diff --git a/packages/ui/src/views/assistants/index.jsx b/packages/ui/src/views/assistants/index.jsx index 9d46f437..85f9fc2a 100644 --- a/packages/ui/src/views/assistants/index.jsx +++ b/packages/ui/src/views/assistants/index.jsx @@ -7,7 +7,7 @@ import { Box, Stack, Button, Skeleton } from '@mui/material' import MainCard from '@/ui-component/cards/MainCard' import ItemCard from '@/ui-component/cards/ItemCard' import { gridSpacing } from '@/store/constant' -import ToolEmptySVG from '@/assets/images/tools_empty.svg' +import AssistantEmptySVG from '@/assets/images/assistant_empty.svg' import { StyledButton } from '@/ui-component/button/StyledButton' import AssistantDialog from './AssistantDialog' import LoadAssistantDialog from './LoadAssistantDialog' @@ -145,9 +145,9 @@ const Assistants = () => { ToolEmptySVG
No Assistants Added Yet
diff --git a/packages/ui/src/views/canvas/AddNodes.jsx b/packages/ui/src/views/canvas/AddNodes.jsx index 8dfc7b94..af1fad29 100644 --- a/packages/ui/src/views/canvas/AddNodes.jsx +++ b/packages/ui/src/views/canvas/AddNodes.jsx @@ -53,7 +53,10 @@ function a11yProps(index) { } } -const AddNodes = ({ nodesData, node }) => { +const blacklistCategoriesForAgentCanvas = ['Agents', 'Memory', 'Record Manager'] +const allowedAgentModel = {} + +const AddNodes = ({ nodesData, node, isAgentCanvas }) => { const theme = useTheme() const customization = useSelector((state) => state.customization) const dispatch = useDispatch() @@ -103,7 +106,17 @@ const AddNodes = ({ nodesData, node }) => { } const getSearchedNodes = (value) => { - const passed = nodesData.filter((nd) => { + if (isAgentCanvas) { + const nodes = nodesData.filter((nd) => !blacklistCategoriesForAgentCanvas.includes(nd.category)) + const passed = nodes.filter((nd) => { + const passesQuery = nd.name.toLowerCase().includes(value.toLowerCase()) + const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase()) + return passesQuery || passesCategory + }) + return passed + } + const nodes = nodesData.filter((nd) => nd.category !== 'Multi Agents') + const passed = nodes.filter((nd) => { const passesQuery = nd.name.toLowerCase().includes(value.toLowerCase()) const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase()) return passesQuery || passesCategory @@ -136,17 +149,57 @@ const AddNodes = ({ nodesData, node }) => { } const groupByCategory = (nodes, newTabValue, isFilter) => { - const taggedNodes = groupByTags(nodes, newTabValue) - const accordianCategories = {} - const result = taggedNodes.reduce(function (r, a) { - r[a.category] = r[a.category] || [] - r[a.category].push(a) - accordianCategories[a.category] = isFilter ? true : false - return r - }, Object.create(null)) - setNodes(result) - categorizeVectorStores(result, accordianCategories, isFilter) - setCategoryExpanded(accordianCategories) + if (isAgentCanvas) { + const accordianCategories = {} + const result = nodes.reduce(function (r, a) { + r[a.category] = r[a.category] || [] + r[a.category].push(a) + accordianCategories[a.category] = isFilter ? true : false + return r + }, Object.create(null)) + + const filteredResult = {} + for (const category in result) { + // Filter out blacklisted categories + if (!blacklistCategoriesForAgentCanvas.includes(category)) { + // Filter out LlamaIndex nodes + const nodes = result[category].filter((nd) => !nd.tags || !nd.tags.includes('LlamaIndex')) + if (!nodes.length) continue + + // Only allow specific models for specific categories + if (Object.keys(allowedAgentModel).includes(category)) { + const allowedModels = allowedAgentModel[category] + filteredResult[category] = nodes.filter((nd) => allowedModels.includes(nd.name)) + } else { + filteredResult[category] = nodes + } + } + } + setNodes(filteredResult) + categorizeVectorStores(filteredResult, accordianCategories, isFilter) + accordianCategories['Multi Agents'] = true + setCategoryExpanded(accordianCategories) + } else { + const taggedNodes = groupByTags(nodes, newTabValue) + const accordianCategories = {} + const result = taggedNodes.reduce(function (r, a) { + r[a.category] = r[a.category] || [] + r[a.category].push(a) + accordianCategories[a.category] = isFilter ? true : false + return r + }, Object.create(null)) + + const filteredResult = {} + for (const category in result) { + if (category === 'Multi Agents') { + continue + } + filteredResult[category] = result[category] + } + setNodes(filteredResult) + categorizeVectorStores(filteredResult, accordianCategories, isFilter) + setCategoryExpanded(accordianCategories) + } } const handleAccordionChange = (category) => (event, isExpanded) => { @@ -271,62 +324,64 @@ const AddNodes = ({ nodesData, node }) => { 'aria-label': 'weight' }} /> - - {['LangChain', 'LlamaIndex'].map((item, index) => ( - - {item} -
- } - iconPosition='start' - sx={{ minHeight: '50px', height: '50px' }} - key={index} - label={item} - {...a11yProps(index)} - > - ))} -
- BETA -
- + {['LangChain', 'LlamaIndex'].map((item, index) => ( + + {item} + + } + iconPosition='start' + sx={{ minHeight: '50px', height: '50px' }} + key={index} + label={item} + {...a11yProps(index)} + > + ))} +
+ BETA +
+ + )} @@ -334,7 +389,11 @@ const AddNodes = ({ nodesData, node }) => { containerRef={(el) => { ps.current = el }} - style={{ height: '100%', maxHeight: 'calc(100vh - 380px)', overflowX: 'hidden' }} + style={{ + height: '100%', + maxHeight: `calc(100vh - ${isAgentCanvas ? '300' : '380'}px)`, + overflowX: 'hidden' + }} > { AddNodes.propTypes = { nodesData: PropTypes.array, - node: PropTypes.object + node: PropTypes.object, + isAgentCanvas: PropTypes.bool } export default AddNodes diff --git a/packages/ui/src/views/canvas/CanvasHeader.jsx b/packages/ui/src/views/canvas/CanvasHeader.jsx index 1a6e9058..c4d842cf 100644 --- a/packages/ui/src/views/canvas/CanvasHeader.jsx +++ b/packages/ui/src/views/canvas/CanvasHeader.jsx @@ -32,7 +32,7 @@ import ViewLeadsDialog from '@/ui-component/dialog/ViewLeadsDialog' // ==============================|| CANVAS HEADER ||============================== // -const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFlow }) => { +const CanvasHeader = ({ chatflow, isAgentCanvas, handleSaveFlow, handleDeleteFlow, handleLoadFlow }) => { const theme = useTheme() const dispatch = useDispatch() const navigate = useNavigate() @@ -54,6 +54,8 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl const [chatflowConfigurationDialogOpen, setChatflowConfigurationDialogOpen] = useState(false) const [chatflowConfigurationDialogProps, setChatflowConfigurationDialogProps] = useState({}) + const title = isAgentCanvas ? 'Agents' : 'Chatflow' + const updateChatflowApi = useApi(chatflowsApi.updateChatflow) const canvas = useSelector((state) => state.canvas) @@ -82,14 +84,17 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl setUpsertHistoryDialogOpen(true) } else if (setting === 'chatflowConfiguration') { setChatflowConfigurationDialogProps({ - title: 'Chatflow Configuration', + title: `${title} Configuration`, chatflow: chatflow }) setChatflowConfigurationDialogOpen(true) } else if (setting === 'duplicateChatflow') { try { - localStorage.setItem('duplicatedFlowData', chatflow.flowData) - window.open(`${uiBaseURL}/canvas`, '_blank') + let flowData = chatflow.flowData + const parsedFlowData = JSON.parse(flowData) + flowData = JSON.stringify(parsedFlowData) + localStorage.setItem('duplicatedFlowData', flowData) + window.open(`${uiBaseURL}/${isAgentCanvas ? 'agentcanvas' : 'canvas'}`, '_blank') } catch (e) { console.error(e) } @@ -99,7 +104,7 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl let dataStr = JSON.stringify(generateExportFlowData(flowData), null, 2) let dataUri = 'data:application/json;charset=utf-8,' + encodeURIComponent(dataStr) - let exportFileDefaultName = `${chatflow.name} Chatflow.json` + let exportFileDefaultName = `${chatflow.name} ${title}.json` let linkElement = document.createElement('a') linkElement.setAttribute('href', dataUri) @@ -192,12 +197,12 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl // if configuration dialog is open, update its data if (chatflowConfigurationDialogOpen) { setChatflowConfigurationDialogProps({ - title: 'Chatflow Configuration', + title: `${title} Configuration`, chatflow }) } } - }, [chatflow, chatflowConfigurationDialogOpen]) + }, [chatflow, title, chatflowConfigurationDialogOpen]) return ( <> @@ -346,7 +351,7 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl )} - + setSettingsOpen(false)} onSettingsItemClick={onSettingsItemClick} onUploadFile={onUploadFile} + isAgentCanvas={isAgentCanvas} /> { + if (!templateValue) return '' + const obj = {} + const inputVariables = getInputVariables(templateValue) + for (const inputVariable of inputVariables) { + obj[inputVariable] = '' + } + if (Object.keys(obj).length) return JSON.stringify(obj) + return '' + } + const onEditJSONClicked = (value, inputParam) => { // Preset values if the field is format prompt values let inputValue = value if (inputParam.name === 'promptValues' && !value) { - const obj = {} const templateValue = - (data.inputs['template'] ?? '') + (data.inputs['systemMessagePrompt'] ?? '') + (data.inputs['humanMessagePrompt'] ?? '') - const inputVariables = getInputVariables(templateValue) - for (const inputVariable of inputVariables) { - obj[inputVariable] = '' - } - if (Object.keys(obj).length) inputValue = JSON.stringify(obj) + (data.inputs['template'] ?? '') + + (data.inputs['systemMessagePrompt'] ?? '') + + (data.inputs['humanMessagePrompt'] ?? '') + + (data.inputs['workerPrompt'] ?? '') + inputValue = getJSONValue(templateValue) } const dialogProp = { value: inputValue, @@ -386,7 +395,12 @@ const NodeInputHandler = ({ inputAnchor, inputParam, data, disabled = false, isA (data.inputs[inputParam.name] = newValue)} - value={data.inputs[inputParam.name] ?? inputParam.default ?? ''} + value={ + data.inputs[inputParam.name] || + inputParam.default || + getJSONValue(data.inputs['workerPrompt']) || + '' + } isDarkMode={customization.isDarkMode} /> )} diff --git a/packages/ui/src/views/canvas/index.jsx b/packages/ui/src/views/canvas/index.jsx index 318d8d98..42605054 100644 --- a/packages/ui/src/views/canvas/index.jsx +++ b/packages/ui/src/views/canvas/index.jsx @@ -4,7 +4,6 @@ import 'reactflow/dist/style.css' import { useDispatch, useSelector } from 'react-redux' import { useNavigate, useLocation } from 'react-router-dom' -import { usePrompt } from '@/utils/usePrompt' import { REMOVE_DIRTY, SET_DIRTY, @@ -50,6 +49,7 @@ import { updateOutdatedNodeEdge } from '@/utils/genericHelper' import useNotifier from '@/utils/useNotifier' +import { usePrompt } from '@/utils/usePrompt' // const import { FLOWISE_CREDENTIAL_ID } from '@/store/constant' @@ -67,7 +67,10 @@ const Canvas = () => { const templateFlowData = state ? state.templateFlowData : '' const URLpath = document.location.pathname.toString().split('/') - const chatflowId = URLpath[URLpath.length - 1] === 'canvas' ? '' : URLpath[URLpath.length - 1] + const chatflowId = + URLpath[URLpath.length - 1] === 'canvas' || URLpath[URLpath.length - 1] === 'agentcanvas' ? '' : URLpath[URLpath.length - 1] + const isAgentCanvas = URLpath.includes('agentcanvas') ? true : false + const canvasTitle = URLpath.includes('agentcanvas') ? 'Agent' : 'Chatflow' const { confirm } = useConfirm() @@ -75,7 +78,6 @@ const Canvas = () => { const canvas = useSelector((state) => state.canvas) const [canvasDataStore, setCanvasDataStore] = useState(canvas) const [chatflow, setChatflow] = useState(null) - const { reactFlowInstance, setReactFlowInstance } = useContext(flowContext) // ==============================|| Snackbar ||============================== // @@ -99,7 +101,6 @@ const Canvas = () => { const getNodesApi = useApi(nodesApi.getAllNodes) const createNewChatflowApi = useApi(chatflowsApi.createNewChatflow) - const testChatflowApi = useApi(chatflowsApi.testChatflow) const updateChatflowApi = useApi(chatflowsApi.updateChatflow) const getSpecificChatflowApi = useApi(chatflowsApi.getSpecificChatflow) @@ -159,7 +160,7 @@ const Canvas = () => { setNodes(nodes) setEdges(flowData.edges || []) - setDirty() + setTimeout(() => setDirty(), 0) } catch (e) { console.error(e) } @@ -168,7 +169,7 @@ const Canvas = () => { const handleDeleteFlow = async () => { const confirmPayload = { title: `Delete`, - description: `Delete chatflow ${chatflow.name}?`, + description: `Delete ${canvasTitle} ${chatflow.name}?`, confirmButtonName: 'Delete', cancelButtonName: 'Cancel' } @@ -178,7 +179,7 @@ const Canvas = () => { try { await chatflowsApi.deleteChatflow(chatflow.id) localStorage.removeItem(`${chatflow.id}_INTERNAL`) - navigate('/') + navigate(isAgentCanvas ? '/agentflows' : '/') } catch (error) { enqueueSnackbar({ message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data, @@ -221,7 +222,8 @@ const Canvas = () => { name: chatflowName, deployed: false, isPublic: false, - flowData + flowData, + type: isAgentCanvas ? 'MULTIAGENT' : 'CHATFLOW' } createNewChatflowApi.request(newChatflowBody) } else { @@ -339,7 +341,7 @@ const Canvas = () => { const saveChatflowSuccess = () => { dispatch({ type: REMOVE_DIRTY }) enqueueSnackbar({ - message: 'Chatflow saved', + message: `${canvasTitle} saved`, options: { key: new Date().getTime() + Math.random(), variant: 'success', @@ -404,7 +406,7 @@ const Canvas = () => { setEdges(initialFlow.edges || []) dispatch({ type: SET_CHATFLOW, chatflow }) } else if (getSpecificChatflowApi.error) { - errorFailed(`Failed to retrieve chatflow: ${getSpecificChatflowApi.error.response.data.message}`) + errorFailed(`Failed to retrieve ${canvasTitle}: ${getSpecificChatflowApi.error.response.data.message}`) } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -416,9 +418,9 @@ const Canvas = () => { const chatflow = createNewChatflowApi.data dispatch({ type: SET_CHATFLOW, chatflow }) saveChatflowSuccess() - window.history.replaceState(null, null, `/canvas/${chatflow.id}`) + window.history.replaceState(state, null, `/${isAgentCanvas ? 'agentcanvas' : 'canvas'}/${chatflow.id}`) } else if (createNewChatflowApi.error) { - errorFailed(`Failed to save chatflow: ${createNewChatflowApi.error.response.data.message}`) + errorFailed(`Failed to save ${canvasTitle}: ${createNewChatflowApi.error.response.data.message}`) } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -430,33 +432,12 @@ const Canvas = () => { dispatch({ type: SET_CHATFLOW, chatflow: updateChatflowApi.data }) saveChatflowSuccess() } else if (updateChatflowApi.error) { - errorFailed(`Failed to save chatflow: ${updateChatflowApi.error.response.data.message}`) + errorFailed(`Failed to save ${canvasTitle}: ${updateChatflowApi.error.response.data.message}`) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [updateChatflowApi.data, updateChatflowApi.error]) - // Test chatflow failed - useEffect(() => { - if (testChatflowApi.error) { - enqueueSnackbar({ - message: 'Test chatflow failed', - options: { - key: new Date().getTime() + Math.random(), - variant: 'error', - persist: true, - action: (key) => ( - - ) - } - }) - } - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [testChatflowApi.error]) - useEffect(() => { setChatflow(canvasDataStore.chatflow) if (canvasDataStore.chatflow) { @@ -485,7 +466,7 @@ const Canvas = () => { dispatch({ type: SET_CHATFLOW, chatflow: { - name: 'Untitled chatflow' + name: `Untitled ${canvasTitle}` } }) } @@ -550,6 +531,7 @@ const Canvas = () => { handleSaveFlow={handleSaveFlow} handleDeleteFlow={handleDeleteFlow} handleLoadFlow={handleLoadFlow} + isAgentCanvas={isAgentCanvas} /> @@ -582,7 +564,7 @@ const Canvas = () => { }} /> - + {isSyncNodesButtonEnabled && ( { )} {isUpsertButtonEnabled && } - + diff --git a/packages/ui/src/views/chatflows/APICodeDialog.jsx b/packages/ui/src/views/chatflows/APICodeDialog.jsx index 65613c19..d479239c 100644 --- a/packages/ui/src/views/chatflows/APICodeDialog.jsx +++ b/packages/ui/src/views/chatflows/APICodeDialog.jsx @@ -14,7 +14,8 @@ import { Accordion, AccordionSummary, AccordionDetails, - Typography + Typography, + Stack } from '@mui/material' import { CopyBlock, atomOneDark } from 'react-code-blocks' import ExpandMoreIcon from '@mui/icons-material/ExpandMore' @@ -118,16 +119,34 @@ const APICodeDialog = ({ show, dialogProps, onCancel }) => { updateChatflowApi.request(dialogProps.chatflowid, updateBody) } - const groupByNodeLabel = (nodes, isFilter = false) => { - const accordianNodes = {} - const result = nodes.reduce(function (r, a) { - r[a.node] = r[a.node] || [] - r[a.node].push(a) - accordianNodes[a.node] = isFilter ? true : false - return r - }, Object.create(null)) + const groupByNodeLabel = (nodes) => { + const result = {} + + nodes.forEach((item) => { + const { node, nodeId, label, name, type } = item + + if (!result[node]) { + result[node] = { + nodeIds: [], + params: [] + } + } + + if (!result[node].nodeIds.includes(nodeId)) result[node].nodeIds.push(nodeId) + + const param = { label, name, type } + + if (!result[node].params.some((existingParam) => JSON.stringify(existingParam) === JSON.stringify(param))) { + result[node].params.push(param) + } + }) + + // Sort the nodeIds array + for (const node in result) { + result[node].nodeIds.sort() + } + setNodeConfig(result) - setNodeConfigExpanded(accordianNodes) } const handleAccordionChange = (nodeLabel) => (event, isExpanded) => { @@ -481,12 +500,16 @@ query({ const getMultiConfigCodeWithFormData = (codeLang) => { if (codeLang === 'Python') { - return `body_data = { - "openAIApiKey[chatOpenAI_0]": "sk-my-openai-1st-key", - "openAIApiKey[openAIEmbeddings_0]": "sk-my-openai-2nd-key" + return `# Specify multiple values for a config parameter by specifying the node id +body_data = { + "openAIApiKey": { + "chatOpenAI_0": "sk-my-openai-1st-key", + "openAIEmbeddings_0": "sk-my-openai-2nd-key" + } }` } else if (codeLang === 'JavaScript') { - return `formData.append("openAIApiKey[chatOpenAI_0]", "sk-my-openai-1st-key") + return `// Specify multiple values for a config parameter by specifying the node id +formData.append("openAIApiKey[chatOpenAI_0]", "sk-my-openai-1st-key") formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")` } else if (codeLang === 'cURL') { return `-F "openAIApiKey[chatOpenAI_0]=sk-my-openai-1st-key" \\ @@ -619,35 +642,34 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")` aria-controls={`nodes-accordian-${nodeLabel}`} id={`nodes-accordian-header-${nodeLabel}`} > -
+ {nodeLabel} -
- - {nodeConfig[nodeLabel][0].nodeId} - -
-
+ {nodeConfig[nodeLabel].nodeIds.length > 0 && + nodeConfig[nodeLabel].nodeIds.map((nodeId, index) => ( +
+ + {nodeId} + +
+ ))} + { - // eslint-disable-next-line - const { node, nodeId, ...rest } = obj - return rest - })} - columns={Object.keys(nodeConfig[nodeLabel][0]).slice(-3)} + rows={nodeConfig[nodeLabel].params} + columns={Object.keys(nodeConfig[nodeLabel].params[0]).slice(-3)} /> diff --git a/packages/ui/src/views/chatflows/index.jsx b/packages/ui/src/views/chatflows/index.jsx index 78f0e7a5..26452c9e 100644 --- a/packages/ui/src/views/chatflows/index.jsx +++ b/packages/ui/src/views/chatflows/index.jsx @@ -197,7 +197,7 @@ const Chatflows = () => { WorkflowEmptySVG diff --git a/packages/ui/src/views/chatmessage/ChatExpandDialog.jsx b/packages/ui/src/views/chatmessage/ChatExpandDialog.jsx index e2fdd9d4..88b8e90c 100644 --- a/packages/ui/src/views/chatmessage/ChatExpandDialog.jsx +++ b/packages/ui/src/views/chatmessage/ChatExpandDialog.jsx @@ -7,7 +7,7 @@ import { ChatMessage } from './ChatMessage' import { StyledButton } from '@/ui-component/button/StyledButton' import { IconEraser } from '@tabler/icons-react' -const ChatExpandDialog = ({ show, dialogProps, onClear, onCancel, previews, setPreviews }) => { +const ChatExpandDialog = ({ show, dialogProps, isAgentCanvas, onClear, onCancel, previews, setPreviews }) => { const portalElement = document.getElementById('portal') const customization = useSelector((state) => state.customization) @@ -50,6 +50,7 @@ const ChatExpandDialog = ({ show, dialogProps, onClear, onCancel, previews, setP { +export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, previews, setPreviews }) => { const theme = useTheme() const customization = useSelector((state) => state.customization) const ps = useRef() + const dispatch = useDispatch() + + useNotifier() + const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args)) + const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args)) + const [userInput, setUserInput] = useState('') const [loading, setLoading] = useState(false) const [messages, setMessages] = useState([ @@ -83,7 +107,8 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews const [isChatFlowAvailableForSpeech, setIsChatFlowAvailableForSpeech] = useState(false) const [sourceDialogOpen, setSourceDialogOpen] = useState(false) const [sourceDialogProps, setSourceDialogProps] = useState({}) - const [chatId, setChatId] = useState(undefined) + const [chatId, setChatId] = useState(uuidv4()) + const [isMessageStopping, setIsMessageStopping] = useState(false) const inputRef = useRef(null) const getChatmessageApi = useApi(chatmessageApi.getInternalChatmessageFromChatflow) @@ -287,6 +312,28 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews } } + const handleAbort = async () => { + setIsMessageStopping(true) + try { + await chatmessageApi.abortMessage(chatflowid, chatId) + } catch (error) { + setIsMessageStopping(false) + enqueueSnackbar({ + message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data, + options: { + key: new Date().getTime() + Math.random(), + variant: 'error', + persist: true, + action: (key) => ( + + ) + } + }) + } + } + const handleDeletePreview = (itemToDelete) => { if (itemToDelete.type === 'file') { URL.revokeObjectURL(itemToDelete.preview) // Clean up for file @@ -357,6 +404,56 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews }) } + const updateLastMessageAgentReasoning = (agentReasoning) => { + setMessages((prevMessages) => { + let allMessages = [...cloneDeep(prevMessages)] + if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages + allMessages[allMessages.length - 1].agentReasoning = JSON.parse(agentReasoning) + return allMessages + }) + } + + const updateLastMessageNextAgent = (nextAgent) => { + setMessages((prevMessages) => { + let allMessages = [...cloneDeep(prevMessages)] + if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages + const lastAgentReasoning = allMessages[allMessages.length - 1].agentReasoning + if (lastAgentReasoning && lastAgentReasoning.length > 0) { + lastAgentReasoning.push({ nextAgent }) + } + allMessages[allMessages.length - 1].agentReasoning = lastAgentReasoning + return allMessages + }) + } + + const abortMessage = () => { + setIsMessageStopping(false) + setMessages((prevMessages) => { + let allMessages = [...cloneDeep(prevMessages)] + if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages + const lastAgentReasoning = allMessages[allMessages.length - 1].agentReasoning + if (lastAgentReasoning && lastAgentReasoning.length > 0) { + allMessages[allMessages.length - 1].agentReasoning = lastAgentReasoning.filter((reasoning) => !reasoning.nextAgent) + } + return allMessages + }) + setTimeout(() => { + inputRef.current?.focus() + }, 100) + enqueueSnackbar({ + message: 'Message stopped', + options: { + key: new Date().getTime() + Math.random(), + variant: 'success', + action: (key) => ( + + ) + } + }) + } + const updateLastMessageUsedTools = (usedTools) => { setMessages((prevMessages) => { let allMessages = [...cloneDeep(prevMessages)] @@ -441,7 +538,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews return allMessages }) - if (!chatId) setChatId(data.chatId) + setChatId(data.chatId) if (input === '' && data.question) { // the response contains the question even if it was in an audio format @@ -468,6 +565,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews sourceDocuments: data?.sourceDocuments, usedTools: data?.usedTools, fileAnnotations: data?.fileAnnotations, + agentReasoning: data?.agentReasoning, type: 'apiMessage', feedback: null } @@ -535,6 +633,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews if (message.sourceDocuments) obj.sourceDocuments = JSON.parse(message.sourceDocuments) if (message.usedTools) obj.usedTools = JSON.parse(message.usedTools) if (message.fileAnnotations) obj.fileAnnotations = JSON.parse(message.fileAnnotations) + if (message.agentReasoning) obj.agentReasoning = JSON.parse(message.agentReasoning) if (message.fileUploads) { obj.fileUploads = JSON.parse(message.fileUploads) obj.fileUploads.forEach((file) => { @@ -656,6 +755,12 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews socket.on('fileAnnotations', updateLastMessageFileAnnotations) socket.on('token', updateLastMessage) + + socket.on('agentReasoning', updateLastMessageAgentReasoning) + + socket.on('nextAgent', updateLastMessageNextAgent) + + socket.on('abort', abortMessage) } return () => { @@ -779,7 +884,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews const result = await leadsApi.addLead(body) if (result.data) { const data = result.data - if (!chatId) setChatId(data.chatId) + setChatId(data.chatId) setLocalStorageChatflow(chatflowid, data.chatId, { lead: { name: leadName, email: leadEmail, phone: leadPhone } }) setIsLeadSaved(true) setLeadEmail(leadEmail) @@ -865,7 +970,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews }} > {message.usedTools.map((tool, index) => { - return ( + return tool ? ( } onClick={() => onSourceDialogClick(tool, 'Used Tools')} /> - ) + ) : null })} )} @@ -925,6 +1030,183 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews })} )} + {message.agentReasoning && ( +
+ {message.agentReasoning.map((agent, index) => { + return agent.nextAgent ? ( + + + + + agentPNG + +
{agent.nextAgent}
+
+
+
+ ) : ( + + + + + agentPNG + +
{agent.agentName}
+
+ {agent.usedTools && agent.usedTools.length > 0 && ( +
+ {agent.usedTools.map((tool, index) => { + return tool !== null ? ( + } + onClick={() => onSourceDialogClick(tool, 'Used Tools')} + /> + ) : null + })} +
+ )} + {agent.messages.length > 0 && ( + + ) : ( + + {children} + + ) + } + }} + > + {agent.messages.length > 1 + ? agent.messages.join('\\n') + : agent.messages[0]} + + )} + {agent.instructions &&

{agent.instructions}

} + {agent.messages.length === 0 && !agent.instructions &&

Finished

} + {agent.sourceDocuments && agent.sourceDocuments.length > 0 && ( +
+ {removeDuplicateURL(agent).map((source, index) => { + const URL = + source && source.metadata && source.metadata.source + ? isValidURL(source.metadata.source) + : undefined + return ( + + URL + ? onURLClick(source.metadata.source) + : onSourceDialogClick(source) + } + /> + ) + })} +
+ )} +
+
+ ) + })} +
+ )}
{message.type === 'leadCaptureMessage' && !getLocalStorageChatflow(chatflowid)?.lead && @@ -1310,30 +1592,74 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews )} - - - {loading ? ( -
- -
- ) : ( - // Send icon SVG in input field - + {!isAgentCanvas && ( + + + {loading ? ( +
+ +
+ ) : ( + // Send icon SVG in input field + + )} +
+
+ )} + {isAgentCanvas && ( + <> + {!loading && ( + + + + + )} -
-
+ {loading && ( + + handleAbort()} + disabled={isMessageStopping} + > + {isMessageStopping ? ( +
+ +
+ ) : ( + + )} +
+
+ )} + + )} } /> @@ -1356,6 +1682,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews ChatMessage.propTypes = { open: PropTypes.bool, chatflowid: PropTypes.string, + isAgentCanvas: PropTypes.bool, isDialog: PropTypes.bool, previews: PropTypes.array, setPreviews: PropTypes.func diff --git a/packages/ui/src/views/chatmessage/ChatPopUp.jsx b/packages/ui/src/views/chatmessage/ChatPopUp.jsx index a4ed9570..05deb38d 100644 --- a/packages/ui/src/views/chatmessage/ChatPopUp.jsx +++ b/packages/ui/src/views/chatmessage/ChatPopUp.jsx @@ -26,7 +26,7 @@ import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackba // Utils import { getLocalStorageChatflow, removeLocalStorageChatHistory } from '@/utils/genericHelper' -export const ChatPopUp = ({ chatflowid }) => { +export const ChatPopUp = ({ chatflowid, isAgentCanvas }) => { const theme = useTheme() const { confirm } = useConfirm() const dispatch = useDispatch() @@ -201,7 +201,13 @@ export const ChatPopUp = ({ chatflowid }) => { boxShadow shadow={theme.shadows[16]} > - + @@ -211,6 +217,7 @@ export const ChatPopUp = ({ chatflowid }) => { setShowExpandDialog(false)} previews={previews} @@ -220,4 +227,4 @@ export const ChatPopUp = ({ chatflowid }) => { ) } -ChatPopUp.propTypes = { chatflowid: PropTypes.string } +ChatPopUp.propTypes = { chatflowid: PropTypes.string, isAgentCanvas: PropTypes.bool } diff --git a/packages/ui/src/views/docstore/index.jsx b/packages/ui/src/views/docstore/index.jsx index f889e0c7..cd3c8fd8 100644 --- a/packages/ui/src/views/docstore/index.jsx +++ b/packages/ui/src/views/docstore/index.jsx @@ -327,7 +327,7 @@ const Documents = () => { doc_store_empty diff --git a/packages/ui/src/views/marketplaces/MarketplaceCanvas.jsx b/packages/ui/src/views/marketplaces/MarketplaceCanvas.jsx index e256b7f5..d807c4f0 100644 --- a/packages/ui/src/views/marketplaces/MarketplaceCanvas.jsx +++ b/packages/ui/src/views/marketplaces/MarketplaceCanvas.jsx @@ -46,8 +46,9 @@ const MarketplaceCanvas = () => { }, [flowData]) const onChatflowCopy = (flowData) => { + const isAgentCanvas = (flowData?.nodes || []).some((node) => node.data.category === 'Multi Agents') const templateFlowData = JSON.stringify(flowData) - navigate(`/canvas`, { state: { templateFlowData } }) + navigate(`/${isAgentCanvas ? 'agentcanvas' : 'canvas'}`, { state: { templateFlowData } }) } return ( diff --git a/packages/ui/src/views/marketplaces/index.jsx b/packages/ui/src/views/marketplaces/index.jsx index b403567e..a4d997c2 100644 --- a/packages/ui/src/views/marketplaces/index.jsx +++ b/packages/ui/src/views/marketplaces/index.jsx @@ -63,7 +63,7 @@ TabPanel.propTypes = { } const badges = ['POPULAR', 'NEW'] -const types = ['Chatflow', 'Tool'] +const types = ['Chatflow', 'Agentflow', 'Tool'] const framework = ['Langchain', 'LlamaIndex'] const MenuProps = { PaperProps: { @@ -413,7 +413,7 @@ const Marketplace = () => { badgeContent={data.badge} color={data.badge === 'POPULAR' ? 'primary' : 'error'} > - {data.type === 'Chatflow' && ( + {(data.type === 'Chatflow' || data.type === 'Agentflow') && ( goToCanvas(data)} data={data} @@ -425,7 +425,7 @@ const Marketplace = () => { )} )} - {!data.badge && data.type === 'Chatflow' && ( + {!data.badge && (data.type === 'Chatflow' || data.type === 'Agentflow') && ( goToCanvas(data)} data={data} images={images[data.id]} /> )} {!data.badge && data.type === 'Tool' && ( diff --git a/packages/ui/src/views/settings/index.jsx b/packages/ui/src/views/settings/index.jsx index 41d22c42..10900b62 100644 --- a/packages/ui/src/views/settings/index.jsx +++ b/packages/ui/src/views/settings/index.jsx @@ -14,10 +14,11 @@ import PerfectScrollbar from 'react-perfect-scrollbar' import MainCard from '@/ui-component/cards/MainCard' import Transitions from '@/ui-component/extended/Transitions' import settings from '@/menu-items/settings' +import agentsettings from '@/menu-items/agentsettings' // ==============================|| SETTINGS ||============================== // -const Settings = ({ chatflow, isSettingsOpen, anchorEl, onSettingsItemClick, onUploadFile, onClose }) => { +const Settings = ({ chatflow, isSettingsOpen, anchorEl, isAgentCanvas, onSettingsItemClick, onUploadFile, onClose }) => { const theme = useTheme() const [settingsMenu, setSettingsMenu] = useState([]) const customization = useSelector((state) => state.customization) @@ -42,13 +43,15 @@ const Settings = ({ chatflow, isSettingsOpen, anchorEl, onSettingsItemClick, onU useEffect(() => { if (chatflow && !chatflow.id) { - const settingsMenu = settings.children.filter((menu) => menu.id === 'loadChatflow') + const menus = isAgentCanvas ? agentsettings : settings + const settingsMenu = menus.children.filter((menu) => menu.id === 'loadChatflow') setSettingsMenu(settingsMenu) } else if (chatflow && chatflow.id) { - const settingsMenu = settings.children + const menus = isAgentCanvas ? agentsettings : settings + const settingsMenu = menus.children setSettingsMenu(settingsMenu) } - }, [chatflow]) + }, [chatflow, isAgentCanvas]) useEffect(() => { setOpen(isSettingsOpen) @@ -147,7 +150,8 @@ Settings.propTypes = { anchorEl: PropTypes.any, onSettingsItemClick: PropTypes.func, onUploadFile: PropTypes.func, - onClose: PropTypes.func + onClose: PropTypes.func, + isAgentCanvas: PropTypes.bool } export default Settings diff --git a/packages/ui/src/views/tools/index.jsx b/packages/ui/src/views/tools/index.jsx index 9a849a5c..358f1e48 100644 --- a/packages/ui/src/views/tools/index.jsx +++ b/packages/ui/src/views/tools/index.jsx @@ -165,7 +165,7 @@ const Tools = () => { ToolEmptySVG diff --git a/packages/ui/src/views/variables/index.jsx b/packages/ui/src/views/variables/index.jsx index 56f17758..e9a1fbf4 100644 --- a/packages/ui/src/views/variables/index.jsx +++ b/packages/ui/src/views/variables/index.jsx @@ -218,7 +218,7 @@ const Variables = () => { VariablesEmptySVG diff --git a/packages/ui/src/views/vectorstore/VectorStoreDialog.jsx b/packages/ui/src/views/vectorstore/VectorStoreDialog.jsx index 169313f7..9d0075c9 100644 --- a/packages/ui/src/views/vectorstore/VectorStoreDialog.jsx +++ b/packages/ui/src/views/vectorstore/VectorStoreDialog.jsx @@ -23,7 +23,7 @@ import { CheckboxInput } from '@/ui-component/checkbox/Checkbox' import { BackdropLoader } from '@/ui-component/loading/BackdropLoader' import { TableViewOnly } from '@/ui-component/table/Table' -import { IconX } from '@tabler/icons-react' +import { IconX, IconBulb } from '@tabler/icons-react' import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import pythonSVG from '@/assets/images/python.svg' import javascriptSVG from '@/assets/images/javascript.svg' @@ -216,6 +216,36 @@ query(formData).then((response) => { return '' } + const getMultiConfigCodeWithFormData = (codeLang) => { + if (codeLang === 'Python') { + return `# Specify multiple values for a config parameter by specifying the node id +body_data = { + "openAIApiKey": { + "chatOpenAI_0": "sk-my-openai-1st-key", + "openAIEmbeddings_0": "sk-my-openai-2nd-key" + } +}` + } else if (codeLang === 'JavaScript') { + return `// Specify multiple values for a config parameter by specifying the node id +formData.append("openAIApiKey[chatOpenAI_0]", "sk-my-openai-1st-key") +formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")` + } else if (codeLang === 'cURL') { + return `-F "openAIApiKey[chatOpenAI_0]=sk-my-openai-1st-key" \\ +-F "openAIApiKey[openAIEmbeddings_0]=sk-my-openai-2nd-key" \\` + } + } + + const getMultiConfigCode = () => { + return `{ + "overrideConfig": { + "openAIApiKey": { + "chatOpenAI_0": "sk-my-openai-1st-key", + "openAIEmbeddings_0": "sk-my-openai-2nd-key" + } + } +}` + } + const getLang = (codeLang) => { if (codeLang === 'Python') { return 'python' @@ -515,6 +545,44 @@ query(formData).then((response) => { showLineNumbers={false} wrapLines /> +
+
+ + + You can also specify multiple values for a config parameter by + specifying the node id + +
+
+ +
+
))}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adfba4f1..8e885ac9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,7 +32,7 @@ importers: version: 8.10.0(eslint@8.57.0) eslint-config-react-app: specifier: ^7.0.1 - version: 7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(typescript@4.9.5) + version: 7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4))(typescript@4.9.5) eslint-plugin-jsx-a11y: specifier: ^6.6.1 version: 6.8.0(eslint@8.57.0) @@ -96,12 +96,15 @@ importers: '@dqbd/tiktoken': specifier: ^1.0.7 version: 1.0.13 + '@e2b/code-interpreter': + specifier: ^0.0.5 + version: 0.0.5(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@elastic/elasticsearch': specifier: ^8.9.0 version: 8.12.2 '@getzep/zep-cloud': specifier: npm:@getzep/zep-js@next - version: '@getzep/zep-js@2.0.0-rc.4(@langchain/core@0.1.63)(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0))' + version: '@getzep/zep-js@2.0.0-rc.4(@langchain/core@0.1.63)(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)))' '@getzep/zep-js': specifier: ^0.9.0 version: 0.9.0 @@ -128,7 +131,7 @@ importers: version: 0.0.7(encoding@0.1.13) '@langchain/community': specifier: ^0.0.43 - version: 0.0.43(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0) + version: 0.0.43(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@langchain/core': specifier: ^0.1.63 version: 0.1.63 @@ -141,6 +144,9 @@ importers: '@langchain/groq': specifier: ^0.0.8 version: 0.0.8(encoding@0.1.13) + '@langchain/langgraph': + specifier: ^0.0.12 + version: 0.0.12 '@langchain/mistralai': specifier: ^0.0.19 version: 0.0.19(encoding@0.1.13) @@ -173,7 +179,7 @@ importers: version: 1.8.1(typescript@4.9.5) '@supabase/supabase-js': specifier: ^2.29.0 - version: 2.39.8 + version: 2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@types/js-yaml': specifier: ^4.0.5 version: 4.0.9 @@ -194,7 +200,7 @@ importers: version: 2.9.3 assemblyai: specifier: ^4.2.2 - version: 4.3.2 + version: 4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4) axios: specifier: 1.6.2 version: 1.6.2(debug@4.3.4) @@ -245,19 +251,19 @@ importers: version: 5.3.2 jsdom: specifier: ^22.1.0 - version: 22.1.0(canvas@2.11.2(encoding@0.1.13)) + version: 22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) jsonpointer: specifier: ^5.0.1 version: 5.0.1 langchain: specifier: ^0.1.37 - version: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0) + version: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) langfuse: specifier: 3.3.4 version: 3.3.4 langfuse-langchain: specifier: ^3.3.4 - version: 3.3.4(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0)) + version: 3.3.4(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))) langsmith: specifier: 0.1.6 version: 0.1.6 @@ -266,7 +272,7 @@ importers: version: 4.1.3 llamaindex: specifier: ^0.2.1 - version: 0.2.1(@google/generative-ai@0.7.0)(encoding@0.1.13)(gcp-metadata@6.1.0(encoding@0.1.13))(node-fetch@2.7.0(encoding@0.1.13))(socks@2.8.1)(typescript@4.9.5) + version: 0.2.1(@google/generative-ai@0.7.0)(bufferutil@4.0.8)(encoding@0.1.13)(gcp-metadata@6.1.0(encoding@0.1.13))(node-fetch@2.7.0(encoding@0.1.13))(socks@2.8.1)(typescript@4.9.5)(utf-8-validate@6.0.4) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -314,10 +320,10 @@ importers: version: 1.42.1 puppeteer: specifier: ^20.7.1 - version: 20.9.0(encoding@0.1.13)(typescript@4.9.5) + version: 20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4) pyodide: specifier: '>=0.21.0-alpha.2' - version: 0.25.0 + version: 0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) redis: specifier: ^4.6.7 version: 4.6.13 @@ -326,7 +332,7 @@ importers: version: 0.18.1 socket.io: specifier: ^4.6.1 - version: 4.7.4 + version: 4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) srt-parser-2: specifier: ^1.2.3 version: 1.2.3 @@ -344,7 +350,7 @@ importers: version: 3.12.0 ws: specifier: ^8.9.0 - version: 8.16.0 + version: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) zod: specifier: ^3.22.4 version: 3.22.4 @@ -486,7 +492,7 @@ importers: version: 2.12.1 socket.io: specifier: ^4.6.1 - version: 4.7.4 + version: 4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) sqlite3: specifier: ^5.1.6 version: 5.1.7 @@ -604,10 +610,10 @@ importers: version: 16.4.5 flowise-embed: specifier: latest - version: 1.2.6 + version: 1.2.6(bufferutil@4.0.8)(utf-8-validate@6.0.4) flowise-embed-react: specifier: latest - version: 1.0.2(@types/node@20.11.26)(flowise-embed@1.2.6)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.71.1)(terser@5.29.1)(typescript@4.9.5) + version: 1.0.2(@types/node@20.11.26)(flowise-embed@1.2.6(bufferutil@4.0.8)(utf-8-validate@6.0.4))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.71.1)(terser@5.29.1)(typescript@4.9.5) flowise-react-json-view: specifier: '*' version: 1.21.7(@types/react@18.2.65)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -679,7 +685,7 @@ importers: version: 4.2.1 rehype-mathjax: specifier: ^4.0.2 - version: 4.0.3(canvas@2.11.2(encoding@0.1.13)) + version: 4.0.3(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) rehype-raw: specifier: ^7.0.0 version: 7.0.0 @@ -691,7 +697,7 @@ importers: version: 5.1.1 socket.io-client: specifier: ^4.6.1 - version: 4.7.4 + version: 4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) uuid: specifier: ^9.0.1 version: 9.0.1 @@ -722,7 +728,7 @@ importers: version: 3.3.1(prettier@3.2.5) react-scripts: specifier: ^5.0.1 - version: 5.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(@swc/core@1.4.6)(@types/babel__core@7.20.5)(canvas@2.11.2(encoding@0.1.13))(eslint@8.57.0)(react@18.2.0)(sass@1.71.1)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(type-fest@4.12.0)(typescript@4.9.5) + version: 5.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(@swc/core@1.4.6)(@types/babel__core@7.20.5)(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(eslint@8.57.0)(react@18.2.0)(sass@1.71.1)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(type-fest@4.12.0)(typescript@4.9.5)(utf-8-validate@6.0.4) rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -2364,6 +2370,10 @@ packages: '@dqbd/tiktoken@1.0.13': resolution: { integrity: sha512-941kjlHjfI97l6NuH/AwuXV4mHuVnRooDcHNSlzi98hz+4ug3wT4gJcWjSwSZHqeGAEn90lC9sFD+8a9d5Jvxg== } + '@e2b/code-interpreter@0.0.5': + resolution: { integrity: sha512-ToFQ6N6EU8t91z3EJzh+mG+zf7uK8I1PRLWeu1f3bPS0pAJfM0puzBWOB3XlF9A9R5zZu/g8iO1gGPQXzXY5vA== } + engines: { node: '>=18' } + '@elastic/elasticsearch@8.12.2': resolution: { integrity: sha512-04NvH3LIgcv1Uwguorfw2WwzC9Lhfsqs9f0L6uq6MrCw0lqe/HOQ6E8vJ6EkHAA15iEfbhtxOtenbZVVcE+mAQ== } engines: { node: '>=18' } @@ -3576,6 +3586,10 @@ packages: resolution: { integrity: sha512-xqbe35K+12fiYtC/uqkaTT4AXxqL5uvhCrHzc+nBoFkTwM6YfTFE1ch95RZ5G2JnK1U9pKAre/trUSzlU1/6Kg== } engines: { node: '>=18' } + '@langchain/langgraph@0.0.12': + resolution: { integrity: sha512-f1N5eV3w7Y59P3rSjgNmjYoqghAPuxRUQTKX922OOhwYT0vmPVlmi99aduRHXK1oJDA3tVQCqrUkDV6D154Pnw== } + engines: { node: '>=18' } + '@langchain/mistralai@0.0.19': resolution: { integrity: sha512-Uin/jve1NCZLAFa9dpOKzE3Y2+uSnMJQX5ria9vO3lnTGRlvBwcMhyGDoTYdI+gnQgHH4ceBoIBzJDlVG+WVWw== } engines: { node: '>=18' } @@ -6315,6 +6329,10 @@ packages: buffer@6.0.3: resolution: { integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== } + bufferutil@4.0.8: + resolution: { integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw== } + engines: { node: '>=6.14.2' } + builtin-modules@3.3.0: resolution: { integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== } engines: { node: '>=6' } @@ -7586,6 +7604,10 @@ packages: duplexify@4.1.3: resolution: { integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA== } + e2b@0.16.1: + resolution: { integrity: sha512-2L1R/REEB+EezD4Q4MmcXXNATjvCYov2lv/69+PY6V95+wl1PZblIMTYAe7USxX6P6sqANxNs+kXqZr6RvXkSw== } + engines: { node: '>=18' } + each-props@1.3.2: resolution: { integrity: sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== } @@ -9830,6 +9852,11 @@ packages: isomorphic-fetch@3.0.0: resolution: { integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== } + isomorphic-ws@5.0.0: + resolution: { integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== } + peerDependencies: + ws: '*' + isstream@0.1.2: resolution: { integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== } @@ -11579,6 +11606,10 @@ packages: resolution: { integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== } engines: { node: '>= 6.13.0' } + node-gyp-build@4.8.1: + resolution: { integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== } + hasBin: true + node-gyp@8.4.1: resolution: { integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== } engines: { node: '>= 10.12.0' } @@ -11933,6 +11964,10 @@ packages: openapi-types@12.1.3: resolution: { integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw== } + openapi-typescript-fetch@1.1.3: + resolution: { integrity: sha512-smLZPck4OkKMNExcw8jMgrMOGgVGx2N/s6DbKL2ftNl77g5HfoGpZGFy79RBzU/EkaO0OZpwBnslfdBfh7ZcWg== } + engines: { node: '>= 12.0.0', npm: '>= 7.0.0' } + option-cache@3.5.0: resolution: { integrity: sha512-Hr14410H8ajAHeUirXZtuE9drwy8e85l0CssHB/k7Y6nRkleKsGAzB/gwltUzsnIqr9Y+7ZQ+H16GYWAJH3PVg== } engines: { node: '>=0.10.0' } @@ -12160,6 +12195,9 @@ packages: password-prompt@1.1.3: resolution: { integrity: sha512-HkrjG2aJlvF0t2BMH0e2LB/EHf3Lcq3fNMzy4GYHcQblAvOl+QQji1Lx7WRBMqpVK8p+KR7bCg7oqAMXtdgqyw== } + path-browserify@1.0.1: + resolution: { integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== } + path-dirname@1.0.2: resolution: { integrity: sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== } @@ -15398,6 +15436,10 @@ packages: resolution: { integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== } engines: { node: '>=0.10.0' } + utf-8-validate@6.0.4: + resolution: { integrity: sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ== } + engines: { node: '>=6.14.2' } + util-deprecate@1.0.2: resolution: { integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== } @@ -18735,6 +18777,15 @@ snapshots: '@dqbd/tiktoken@1.0.13': {} + '@e2b/code-interpreter@0.0.5(bufferutil@4.0.8)(utf-8-validate@6.0.4)': + dependencies: + e2b: 0.16.1 + isomorphic-ws: 5.0.0(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + '@elastic/elasticsearch@8.12.2': dependencies: '@elastic/transport': 8.4.1 @@ -19027,14 +19078,14 @@ snapshots: semver: 7.6.0 typescript: 5.4.2 - '@getzep/zep-js@2.0.0-rc.4(@langchain/core@0.1.63)(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0))': + '@getzep/zep-js@2.0.0-rc.4(@langchain/core@0.1.63)(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)))': dependencies: '@supercharge/promise-pool': 3.1.1 semver: 7.6.0 typescript: 5.4.2 optionalDependencies: '@langchain/core': 0.1.63 - langchain: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0) + langchain: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@gomomento/generated-types@0.106.1(encoding@0.1.13)': dependencies: @@ -19178,7 +19229,7 @@ snapshots: jest-util: 28.1.3 slash: 3.0.0 - '@jest/core@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))': + '@jest/core@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4)': dependencies: '@jest/console': 27.5.1 '@jest/reporters': 27.5.1 @@ -19192,13 +19243,13 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 27.5.1 - jest-config: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest-config: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) jest-haste-map: 27.5.1 jest-message-util: 27.5.1 jest-regex-util: 27.5.1 jest-resolve: 27.5.1 jest-resolve-dependencies: 27.5.1 - jest-runner: 27.5.1(canvas@2.11.2(encoding@0.1.13)) + jest-runner: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) jest-runtime: 27.5.1 jest-snapshot: 27.5.1 jest-util: 27.5.1 @@ -19459,7 +19510,7 @@ snapshots: transitivePeerDependencies: - encoding - '@langchain/community@0.0.43(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0)': + '@langchain/community@0.0.43(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@langchain/core': 0.1.63 '@langchain/openai': 0.0.30(encoding@0.1.13) @@ -19488,7 +19539,7 @@ snapshots: '@smithy/signature-v4': 2.1.4 '@smithy/util-utf8': 2.2.0 '@supabase/postgrest-js': 1.9.2 - '@supabase/supabase-js': 2.39.8 + '@supabase/supabase-js': 2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@upstash/redis': 1.22.1(encoding@0.1.13) '@upstash/vector': 1.0.7 '@xenova/transformers': 2.16.0 @@ -19500,7 +19551,7 @@ snapshots: google-auth-library: 9.6.3(encoding@0.1.13) html-to-text: 9.0.5 ioredis: 5.3.2 - jsdom: 22.1.0(canvas@2.11.2(encoding@0.1.13)) + jsdom: 22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) lodash: 4.17.21 lunary: 0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0) mongodb: 6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1) @@ -19511,11 +19562,11 @@ snapshots: replicate: 0.18.1 typeorm: 0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) weaviate-ts-client: 1.6.0(encoding@0.1.13)(graphql@16.8.1) - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - encoding - '@langchain/community@0.0.48(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0)': + '@langchain/community@0.0.48(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))': dependencies: '@langchain/core': 0.1.63 '@langchain/openai': 0.0.30(encoding@0.1.13) @@ -19545,7 +19596,7 @@ snapshots: '@smithy/signature-v4': 2.1.4 '@smithy/util-utf8': 2.2.0 '@supabase/postgrest-js': 1.9.2 - '@supabase/supabase-js': 2.39.8 + '@supabase/supabase-js': 2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@upstash/redis': 1.22.1(encoding@0.1.13) '@upstash/vector': 1.0.7 '@xenova/transformers': 2.16.0 @@ -19557,7 +19608,7 @@ snapshots: google-auth-library: 9.6.3(encoding@0.1.13) html-to-text: 9.0.5 ioredis: 5.3.2 - jsdom: 22.1.0(canvas@2.11.2(encoding@0.1.13)) + jsdom: 22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) lodash: 4.17.21 lunary: 0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0) mongodb: 6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1) @@ -19568,7 +19619,7 @@ snapshots: replicate: 0.18.1 typeorm: 0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) weaviate-ts-client: 1.6.0(encoding@0.1.13)(graphql@16.8.1) - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - encoding @@ -19629,6 +19680,10 @@ snapshots: transitivePeerDependencies: - encoding + '@langchain/langgraph@0.0.12': + dependencies: + '@langchain/core': 0.1.63 + '@langchain/mistralai@0.0.19(encoding@0.1.13)': dependencies: '@langchain/core': 0.1.63 @@ -20261,7 +20316,7 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@pmmmwh/react-refresh-webpack-plugin@0.5.11(react-refresh@0.11.0)(type-fest@4.12.0)(webpack-dev-server@4.15.1(webpack@5.90.3(@swc/core@1.4.6)))(webpack@5.90.3(@swc/core@1.4.6))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.11(react-refresh@0.11.0)(type-fest@4.12.0)(webpack-dev-server@4.15.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)(webpack@5.90.3(@swc/core@1.4.6)))(webpack@5.90.3(@swc/core@1.4.6))': dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 @@ -20276,7 +20331,7 @@ snapshots: webpack: 5.90.3(@swc/core@1.4.6) optionalDependencies: type-fest: 4.12.0 - webpack-dev-server: 4.15.1(webpack@5.90.3(@swc/core@1.4.6)) + webpack-dev-server: 4.15.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)(webpack@5.90.3(@swc/core@1.4.6)) '@popperjs/core@2.11.8': {} @@ -20890,12 +20945,12 @@ snapshots: dependencies: '@supabase/node-fetch': 2.6.15 - '@supabase/realtime-js@2.9.3': + '@supabase/realtime-js@2.9.3(bufferutil@4.0.8)(utf-8-validate@6.0.4)': dependencies: '@supabase/node-fetch': 2.6.15 '@types/phoenix': 1.6.4 '@types/ws': 8.5.10 - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -20904,13 +20959,13 @@ snapshots: dependencies: '@supabase/node-fetch': 2.6.15 - '@supabase/supabase-js@2.39.8': + '@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4)': dependencies: '@supabase/functions-js': 2.1.5 '@supabase/gotrue-js': 2.62.2 '@supabase/node-fetch': 2.6.15 '@supabase/postgrest-js': 1.9.2 - '@supabase/realtime-js': 2.9.3 + '@supabase/realtime-js': 2.9.3(bufferutil@4.0.8)(utf-8-validate@6.0.4) '@supabase/storage-js': 2.5.5 transitivePeerDependencies: - bufferutil @@ -22508,9 +22563,9 @@ snapshots: src-stream: 0.1.1 through2: 2.0.5 - assemblyai@4.3.2: + assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -23459,6 +23514,11 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + bufferutil@4.0.8: + dependencies: + node-gyp-build: 4.8.1 + optional: true + builtin-modules@3.3.0: {} builtins@1.0.3: {} @@ -24938,6 +24998,18 @@ snapshots: readable-stream: 3.6.2 stream-shift: 1.0.3 + e2b@0.16.1: + dependencies: + isomorphic-ws: 5.0.0(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) + normalize-path: 3.0.0 + openapi-typescript-fetch: 1.1.3 + path-browserify: 1.0.1 + platform: 1.3.6 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.4 + each-props@1.3.2: dependencies: is-plain-object: 2.0.4 @@ -25025,12 +25097,12 @@ snapshots: engine-utils@0.1.1: {} - engine.io-client@6.5.3: + engine.io-client@6.5.3(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: '@socket.io/component-emitter': 3.1.0 debug: 4.3.4(supports-color@5.5.0) engine.io-parser: 5.2.2 - ws: 8.11.0 + ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) xmlhttprequest-ssl: 2.0.0 transitivePeerDependencies: - bufferutil @@ -25039,7 +25111,7 @@ snapshots: engine.io-parser@5.2.2: {} - engine.io@6.5.4: + engine.io@6.5.4(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 @@ -25050,7 +25122,7 @@ snapshots: cors: 2.8.5 debug: 4.3.4(supports-color@5.5.0) engine.io-parser: 5.2.2 - ws: 8.11.0 + ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - supports-color @@ -25307,7 +25379,7 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(typescript@4.9.5): + eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4))(typescript@4.9.5): dependencies: '@babel/core': 7.24.0 '@babel/eslint-parser': 7.23.10(@babel/core@7.24.0)(eslint@8.57.0) @@ -25319,7 +25391,7 @@ snapshots: eslint: 8.57.0 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0) - eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(typescript@4.9.5) + eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4))(typescript@4.9.5) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.0(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) @@ -25387,13 +25459,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(typescript@4.9.5): + eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4))(typescript@4.9.5): dependencies: '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@4.9.5) eslint: 8.57.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5) - jest: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) transitivePeerDependencies: - supports-color - typescript @@ -26146,10 +26218,10 @@ snapshots: flatted@3.3.1: {} - flowise-embed-react@1.0.2(@types/node@20.11.26)(flowise-embed@1.2.6)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.71.1)(terser@5.29.1)(typescript@4.9.5): + flowise-embed-react@1.0.2(@types/node@20.11.26)(flowise-embed@1.2.6(bufferutil@4.0.8)(utf-8-validate@6.0.4))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.71.1)(terser@5.29.1)(typescript@4.9.5): dependencies: '@ladle/react': 2.5.1(@types/node@20.11.26)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.71.1)(terser@5.29.1)(typescript@4.9.5) - flowise-embed: 1.2.6 + flowise-embed: 1.2.6(bufferutil@4.0.8)(utf-8-validate@6.0.4) react: 18.2.0 transitivePeerDependencies: - '@types/node' @@ -26163,14 +26235,14 @@ snapshots: - terser - typescript - flowise-embed@1.2.6: + flowise-embed@1.2.6(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: '@babel/core': 7.24.0 '@ts-stack/markdown': 1.5.0 device-detector-js: 3.0.3 lodash: 4.17.21 prettier: 3.2.5 - socket.io-client: 4.7.4 + socket.io-client: 4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) solid-element: 1.7.0(solid-js@1.7.1) solid-js: 1.7.1 zod: 3.22.4 @@ -27857,6 +27929,10 @@ snapshots: transitivePeerDependencies: - encoding + isomorphic-ws@5.0.0(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)): + dependencies: + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) + isstream@0.1.2: {} istanbul-lib-coverage@3.2.2: {} @@ -27941,16 +28017,16 @@ snapshots: transitivePeerDependencies: - supports-color - jest-cli@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)): + jest-cli@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4): dependencies: - '@jest/core': 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + '@jest/core': 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest-config: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) jest-util: 27.5.1 jest-validate: 27.5.1 prompts: 2.4.2 @@ -27962,7 +28038,7 @@ snapshots: - ts-node - utf-8-validate - jest-config@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)): + jest-config@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4): dependencies: '@babel/core': 7.24.0 '@jest/test-sequencer': 27.5.1 @@ -27974,13 +28050,13 @@ snapshots: glob: 7.2.3 graceful-fs: 4.2.11 jest-circus: 27.5.1 - jest-environment-jsdom: 27.5.1(canvas@2.11.2(encoding@0.1.13)) + jest-environment-jsdom: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) jest-environment-node: 27.5.1 jest-get-type: 27.5.1 jest-jasmine2: 27.5.1 jest-regex-util: 27.5.1 jest-resolve: 27.5.1 - jest-runner: 27.5.1(canvas@2.11.2(encoding@0.1.13)) + jest-runner: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) jest-util: 27.5.1 jest-validate: 27.5.1 micromatch: 4.0.5 @@ -28022,7 +28098,7 @@ snapshots: jest-util: 27.5.1 pretty-format: 27.5.1 - jest-environment-jsdom@27.5.1(canvas@2.11.2(encoding@0.1.13)): + jest-environment-jsdom@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 @@ -28030,7 +28106,7 @@ snapshots: '@types/node': 20.11.26 jest-mock: 27.5.1 jest-util: 27.5.1 - jsdom: 16.7.0(canvas@2.11.2(encoding@0.1.13)) + jsdom: 16.7.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - canvas @@ -28178,7 +28254,7 @@ snapshots: resolve.exports: 1.1.1 slash: 3.0.0 - jest-runner@27.5.1(canvas@2.11.2(encoding@0.1.13)): + jest-runner@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: '@jest/console': 27.5.1 '@jest/environment': 27.5.1 @@ -28190,7 +28266,7 @@ snapshots: emittery: 0.8.1 graceful-fs: 4.2.11 jest-docblock: 27.5.1 - jest-environment-jsdom: 27.5.1(canvas@2.11.2(encoding@0.1.13)) + jest-environment-jsdom: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) jest-environment-node: 27.5.1 jest-haste-map: 27.5.1 jest-leak-detector: 27.5.1 @@ -28302,11 +28378,11 @@ snapshots: leven: 3.1.0 pretty-format: 27.5.1 - jest-watch-typeahead@1.1.0(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))): + jest-watch-typeahead@1.1.0(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4)): dependencies: ansi-escapes: 4.3.2 chalk: 4.1.2 - jest: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) jest-regex-util: 28.0.2 jest-watcher: 28.1.3 slash: 4.0.0 @@ -28352,11 +28428,11 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)): + jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4): dependencies: - '@jest/core': 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + '@jest/core': 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) import-local: 3.1.0 - jest-cli: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest-cli: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - canvas @@ -28427,7 +28503,7 @@ snapshots: strip-json-comments: 3.1.1 underscore: 1.13.6 - jsdom@16.7.0(canvas@2.11.2(encoding@0.1.13)): + jsdom@16.7.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: abab: 2.0.6 acorn: 8.11.3 @@ -28454,7 +28530,7 @@ snapshots: whatwg-encoding: 1.0.5 whatwg-mimetype: 2.3.0 whatwg-url: 8.7.0 - ws: 7.5.9 + ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@6.0.4) xml-name-validator: 3.0.0 optionalDependencies: canvas: 2.11.2(encoding@0.1.13) @@ -28463,7 +28539,7 @@ snapshots: - supports-color - utf-8-validate - jsdom@20.0.3(canvas@2.11.2(encoding@0.1.13)): + jsdom@20.0.3(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: abab: 2.0.6 acorn: 8.11.3 @@ -28489,7 +28565,7 @@ snapshots: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) xml-name-validator: 4.0.0 optionalDependencies: canvas: 2.11.2(encoding@0.1.13) @@ -28498,7 +28574,7 @@ snapshots: - supports-color - utf-8-validate - jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)): + jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: abab: 2.0.6 cssstyle: 3.0.0 @@ -28521,7 +28597,7 @@ snapshots: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 12.0.1 - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) xml-name-validator: 4.0.0 optionalDependencies: canvas: 2.11.2(encoding@0.1.13) @@ -28675,10 +28751,10 @@ snapshots: kuler@2.0.0: {} - langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0): + langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)): dependencies: '@anthropic-ai/sdk': 0.9.1(encoding@0.1.13) - '@langchain/community': 0.0.48(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0) + '@langchain/community': 0.0.48(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(encoding@0.1.13)(faiss-node@0.5.1)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(portkey-ai@0.1.16)(redis@4.6.13)(replicate@0.18.1)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) '@langchain/core': 0.1.63 '@langchain/openai': 0.0.30(encoding@0.1.13) '@langchain/textsplitters': 0.0.1 @@ -28703,9 +28779,9 @@ snapshots: '@google-ai/generativelanguage': 0.2.1(encoding@0.1.13) '@notionhq/client': 2.2.14(encoding@0.1.13) '@pinecone-database/pinecone': 2.2.0 - '@supabase/supabase-js': 2.39.8 + '@supabase/supabase-js': 2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4) apify-client: 2.9.3 - assemblyai: 4.3.2 + assemblyai: 4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4) axios: 1.6.2(debug@4.3.4) cheerio: 1.0.0-rc.12 chromadb: 1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)) @@ -28717,19 +28793,19 @@ snapshots: html-to-text: 9.0.5 ignore: 5.3.1 ioredis: 5.3.2 - jsdom: 22.1.0(canvas@2.11.2(encoding@0.1.13)) + jsdom: 22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) mammoth: 1.7.0 mongodb: 6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1) notion-to-md: 3.1.1(encoding@0.1.13) pdf-parse: 1.1.1 playwright: 1.42.1 - puppeteer: 20.9.0(encoding@0.1.13)(typescript@4.9.5) - pyodide: 0.25.0 + puppeteer: 20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4) + pyodide: 0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) redis: 4.6.13 srt-parser-2: 1.2.3 typeorm: 0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) weaviate-ts-client: 1.6.0(encoding@0.1.13)(graphql@16.8.1) - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - '@aws-crypto/sha256-js' - '@aws-sdk/client-bedrock-agent-runtime' @@ -28805,9 +28881,9 @@ snapshots: dependencies: mustache: 4.2.0 - langfuse-langchain@3.3.4(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0)): + langfuse-langchain@3.3.4(langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))): dependencies: - langchain: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8)(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2)(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(canvas@2.11.2(encoding@0.1.13)))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5))(pyodide@0.25.0)(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0) + langchain: 0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.422.0)(@aws-sdk/client-dynamodb@3.529.1)(@aws-sdk/client-s3@3.529.1)(@aws-sdk/credential-provider-node@3.529.1)(@datastax/astra-db-ts@0.1.4)(@elastic/elasticsearch@8.12.2)(@getzep/zep-js@0.9.0)(@gomomento/sdk-core@1.68.1)(@gomomento/sdk@1.68.1(encoding@0.1.13))(@google-ai/generativelanguage@0.2.1(encoding@0.1.13))(@huggingface/inference@2.6.4)(@notionhq/client@2.2.14(encoding@0.1.13))(@opensearch-project/opensearch@1.2.0)(@pinecone-database/pinecone@2.2.0)(@qdrant/js-client-rest@1.8.1(typescript@4.9.5))(@smithy/eventstream-codec@2.1.4)(@smithy/protocol-http@3.2.2)(@smithy/signature-v4@2.1.4)(@smithy/util-utf8@2.2.0)(@supabase/postgrest-js@1.9.2)(@supabase/supabase-js@2.39.8(bufferutil@4.0.8)(utf-8-validate@6.0.4))(@upstash/redis@1.22.1(encoding@0.1.13))(@upstash/vector@1.0.7)(@xenova/transformers@2.16.0)(@zilliz/milvus2-sdk-node@2.3.5)(apify-client@2.9.3)(assemblyai@4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4))(axios@1.6.2)(cheerio@1.0.0-rc.12)(chromadb@1.8.1(@google/generative-ai@0.7.0)(cohere-ai@6.2.2)(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)))(cohere-ai@6.2.2)(couchbase@4.3.1)(d3-dsv@2.0.0)(encoding@0.1.13)(faiss-node@0.5.1)(fast-xml-parser@4.3.5)(google-auth-library@9.6.3(encoding@0.1.13))(html-to-text@9.0.5)(ignore@5.3.1)(ioredis@5.3.2)(jsdom@22.1.0(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4))(lodash@4.17.21)(lunary@0.6.16(openai@4.38.3(encoding@0.1.13))(react@18.2.0))(mammoth@1.7.0)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(notion-to-md@3.1.1(encoding@0.1.13))(pdf-parse@1.1.1)(pg@8.11.3)(playwright@1.42.1)(portkey-ai@0.1.16)(puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4))(pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(redis@4.6.13)(replicate@0.18.1)(srt-parser-2@1.2.3)(typeorm@0.3.20(ioredis@5.3.2)(mongodb@6.3.0(gcp-metadata@6.1.0(encoding@0.1.13))(socks@2.8.1))(mysql2@3.9.2)(pg@8.11.3)(redis@4.6.13)(sqlite3@5.1.7)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(weaviate-ts-client@1.6.0(encoding@0.1.13)(graphql@16.8.1))(ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)) langfuse: 3.3.4 langfuse-core: 3.3.4 @@ -28959,7 +29035,7 @@ snapshots: optionalDependencies: enquirer: 2.4.1 - llamaindex@0.2.1(@google/generative-ai@0.7.0)(encoding@0.1.13)(gcp-metadata@6.1.0(encoding@0.1.13))(node-fetch@2.7.0(encoding@0.1.13))(socks@2.8.1)(typescript@4.9.5): + llamaindex@0.2.1(@google/generative-ai@0.7.0)(bufferutil@4.0.8)(encoding@0.1.13)(gcp-metadata@6.1.0(encoding@0.1.13))(node-fetch@2.7.0(encoding@0.1.13))(socks@2.8.1)(typescript@4.9.5)(utf-8-validate@6.0.4): dependencies: '@anthropic-ai/sdk': 0.18.0(encoding@0.1.13) '@aws-crypto/sha256-js': 5.2.0 @@ -28977,7 +29053,7 @@ snapshots: '@types/pg': 8.11.2 '@xenova/transformers': 2.16.0 '@zilliz/milvus2-sdk-node': 2.3.5 - assemblyai: 4.3.2 + assemblyai: 4.3.2(bufferutil@4.0.8)(utf-8-validate@6.0.4) chromadb: 1.7.3(@google/generative-ai@0.7.0)(cohere-ai@7.7.7(encoding@0.1.13))(encoding@0.1.13)(openai@4.38.3(encoding@0.1.13)) cohere-ai: 7.7.7(encoding@0.1.13) js-tiktoken: 1.0.10 @@ -30356,6 +30432,9 @@ snapshots: node-forge@1.3.1: {} + node-gyp-build@4.8.1: + optional: true + node-gyp@8.4.1: dependencies: env-paths: 2.2.1 @@ -30858,6 +30937,8 @@ snapshots: openapi-types@12.1.3: {} + openapi-typescript-fetch@1.1.3: {} + option-cache@3.5.0: dependencies: arr-flatten: 1.1.0 @@ -31184,6 +31265,8 @@ snapshots: ansi-escapes: 4.3.2 cross-spawn: 7.0.3 + path-browserify@1.0.1: {} + path-dirname@1.0.2: {} path-exists@2.1.0: @@ -32110,14 +32193,14 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@20.9.0(encoding@0.1.13)(typescript@4.9.5): + puppeteer-core@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4): dependencies: '@puppeteer/browsers': 1.4.6(typescript@4.9.5) chromium-bidi: 0.4.16(devtools-protocol@0.0.1147663) cross-fetch: 4.0.0(encoding@0.1.13) debug: 4.3.4(supports-color@5.5.0) devtools-protocol: 0.0.1147663 - ws: 8.13.0 + ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: @@ -32126,11 +32209,11 @@ snapshots: - supports-color - utf-8-validate - puppeteer@20.9.0(encoding@0.1.13)(typescript@4.9.5): + puppeteer@20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4): dependencies: '@puppeteer/browsers': 1.4.6(typescript@4.9.5) cosmiconfig: 8.2.0 - puppeteer-core: 20.9.0(encoding@0.1.13)(typescript@4.9.5) + puppeteer-core: 20.9.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@4.9.5)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - encoding @@ -32140,10 +32223,10 @@ snapshots: pure-color@1.3.0: {} - pyodide@0.25.0: + pyodide@0.25.0(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: base-64: 1.0.0 - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -32487,10 +32570,10 @@ snapshots: history: 5.3.0 react: 18.2.0 - react-scripts@5.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(@swc/core@1.4.6)(@types/babel__core@7.20.5)(canvas@2.11.2(encoding@0.1.13))(eslint@8.57.0)(react@18.2.0)(sass@1.71.1)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(type-fest@4.12.0)(typescript@4.9.5): + react-scripts@5.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(@swc/core@1.4.6)(@types/babel__core@7.20.5)(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(eslint@8.57.0)(react@18.2.0)(sass@1.71.1)(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(type-fest@4.12.0)(typescript@4.9.5)(utf-8-validate@6.0.4): dependencies: '@babel/core': 7.24.0 - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.11.0)(type-fest@4.12.0)(webpack-dev-server@4.15.1(webpack@5.90.3(@swc/core@1.4.6)))(webpack@5.90.3(@swc/core@1.4.6)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.11.0)(type-fest@4.12.0)(webpack-dev-server@4.15.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)(webpack@5.90.3(@swc/core@1.4.6)))(webpack@5.90.3(@swc/core@1.4.6)) '@svgr/webpack': 5.5.0 babel-jest: 27.5.1(@babel/core@7.24.0) babel-loader: 8.3.0(@babel/core@7.24.0)(webpack@5.90.3(@swc/core@1.4.6)) @@ -32505,15 +32588,15 @@ snapshots: dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.57.0 - eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)))(typescript@4.9.5) + eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.23.3(@babel/core@7.24.0))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.0))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4))(typescript@4.9.5) eslint-webpack-plugin: 3.2.0(eslint@8.57.0)(webpack@5.90.3(@swc/core@1.4.6)) file-loader: 6.2.0(webpack@5.90.3(@swc/core@1.4.6)) fs-extra: 10.1.0 html-webpack-plugin: 5.6.0(webpack@5.90.3(@swc/core@1.4.6)) identity-obj-proxy: 3.0.0 - jest: 27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) + jest: 27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4) jest-resolve: 27.5.1 - jest-watch-typeahead: 1.1.0(jest@27.5.1(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))) + jest-watch-typeahead: 1.1.0(jest@27.5.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5))(utf-8-validate@6.0.4)) mini-css-extract-plugin: 2.8.1(webpack@5.90.3(@swc/core@1.4.6)) postcss: 8.4.35 postcss-flexbugs-fixes: 5.0.2(postcss@8.4.35) @@ -32534,7 +32617,7 @@ snapshots: tailwindcss: 3.4.1(ts-node@10.9.2(@swc/core@1.4.6)(@types/node@20.11.26)(typescript@4.9.5)) terser-webpack-plugin: 5.3.10(@swc/core@1.4.6)(webpack@5.90.3(@swc/core@1.4.6)) webpack: 5.90.3(@swc/core@1.4.6) - webpack-dev-server: 4.15.1(webpack@5.90.3(@swc/core@1.4.6)) + webpack-dev-server: 4.15.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)(webpack@5.90.3(@swc/core@1.4.6)) webpack-manifest-plugin: 4.1.1(webpack@5.90.3(@swc/core@1.4.6)) workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.90.3(@swc/core@1.4.6)) optionalDependencies: @@ -32851,13 +32934,13 @@ snapshots: dependencies: jsesc: 0.5.0 - rehype-mathjax@4.0.3(canvas@2.11.2(encoding@0.1.13)): + rehype-mathjax@4.0.3(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4): dependencies: '@types/hast': 2.3.10 '@types/mathjax': 0.0.37 hast-util-from-dom: 4.2.0 hast-util-to-text: 3.1.2 - jsdom: 20.0.3(canvas@2.11.2(encoding@0.1.13)) + jsdom: 20.0.3(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.4) mathjax-full: 3.2.2 unified: 10.1.2 unist-util-visit: 4.1.2 @@ -33568,20 +33651,20 @@ snapshots: transitivePeerDependencies: - supports-color - socket.io-adapter@2.5.4: + socket.io-adapter@2.5.4(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: debug: 4.3.4(supports-color@5.5.0) - ws: 8.11.0 + ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - socket.io-client@4.7.4: + socket.io-client@4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: '@socket.io/component-emitter': 3.1.0 debug: 4.3.4(supports-color@5.5.0) - engine.io-client: 6.5.3 + engine.io-client: 6.5.3(bufferutil@4.0.8)(utf-8-validate@6.0.4) socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -33595,14 +33678,14 @@ snapshots: transitivePeerDependencies: - supports-color - socket.io@4.7.4: + socket.io@4.7.4(bufferutil@4.0.8)(utf-8-validate@6.0.4): dependencies: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 debug: 4.3.4(supports-color@5.5.0) - engine.io: 6.5.4 - socket.io-adapter: 2.5.4 + engine.io: 6.5.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) + socket.io-adapter: 2.5.4(bufferutil@4.0.8)(utf-8-validate@6.0.4) socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -35009,6 +35092,11 @@ snapshots: use@3.1.1: {} + utf-8-validate@6.0.4: + dependencies: + node-gyp-build: 4.8.1 + optional: true + util-deprecate@1.0.2: {} util.promisify@1.0.1: @@ -35355,7 +35443,7 @@ snapshots: schema-utils: 4.2.0 webpack: 5.90.3(@swc/core@1.4.6) - webpack-dev-server@4.15.1(webpack@5.90.3(@swc/core@1.4.6)): + webpack-dev-server@4.15.1(bufferutil@4.0.8)(utf-8-validate@6.0.4)(webpack@5.90.3(@swc/core@1.4.6)): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -35386,7 +35474,7 @@ snapshots: sockjs: 0.3.24 spdy: 4.0.2 webpack-dev-middleware: 5.3.3(webpack@5.90.3(@swc/core@1.4.6)) - ws: 8.16.0 + ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) optionalDependencies: webpack: 5.90.3(@swc/core@1.4.6) transitivePeerDependencies: @@ -35880,13 +35968,25 @@ snapshots: dependencies: mkdirp: 0.5.6 - ws@7.5.9: {} + ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@6.0.4): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.4 - ws@8.11.0: {} + ws@8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.4): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.4 - ws@8.13.0: {} + ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@6.0.4): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.4 - ws@8.16.0: {} + ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@6.0.4): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.4 xdg-default-browser@2.1.0: dependencies: