mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Feature/seq agents (#2798)
* update build functions * sequential agents * update langchain to 0.2, added sequential agent nodes * add marketplace templates * update howto wordings * Merge branch 'main' into feature/Seq-Agents # Conflicts: # pnpm-lock.yaml * update deprecated functions and add new sequential nodes * add marketplace templates * update marketplace templates, add structured output to llm node * add multi agents template * update llm node with bindmodels * update cypress version * update templates sticky note wordings * update tool node to include human in loop action * update structured outputs error from models * update cohere package to resolve google genai pipeThrough bug * update mistral package version, added message reconstruction before invoke seq agent * add HITL to agent * update state messages restructuring * update load and split methods for s3 directory
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import { INode, INodeData, INodeParams, ISeqAgentNode } from '../../../src/Interface'
|
||||
|
||||
class Loop_SeqAgents implements INode {
|
||||
label: string
|
||||
name: string
|
||||
version: number
|
||||
description: string
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
baseClasses: string[]
|
||||
credential: INodeParams
|
||||
inputs: INodeParams[]
|
||||
hideOutput: boolean
|
||||
|
||||
constructor() {
|
||||
this.label = 'Loop'
|
||||
this.name = 'seqLoop'
|
||||
this.version = 1.0
|
||||
this.type = 'Loop'
|
||||
this.icon = 'loop.svg'
|
||||
this.category = 'Sequential Agents'
|
||||
this.description = 'Loop back to the specific sequential node'
|
||||
this.baseClasses = [this.type]
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Start | Agent | LLM | Tool Node',
|
||||
name: 'sequentialNode',
|
||||
type: 'Start | Agent | LLMNode | ToolNode',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Loop To',
|
||||
name: 'loopToName',
|
||||
description: 'Name of the agent to loop back to',
|
||||
type: 'string',
|
||||
placeholder: 'agent1'
|
||||
}
|
||||
]
|
||||
this.hideOutput = true
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const sequentialNodes = nodeData.inputs?.sequentialNode as ISeqAgentNode[]
|
||||
const loopToNameLabel = nodeData.inputs?.loopToName as string
|
||||
|
||||
if (!sequentialNodes || !sequentialNodes.length) throw new Error('Loop must have a predecessor!')
|
||||
if (!loopToNameLabel) throw new Error('Loop to name is required')
|
||||
|
||||
const loopToName = loopToNameLabel.toLowerCase().replace(/\s/g, '_').trim()
|
||||
|
||||
const returnOutput: ISeqAgentNode = {
|
||||
id: nodeData.id,
|
||||
node: loopToName,
|
||||
name: loopToName,
|
||||
label: loopToNameLabel,
|
||||
type: 'agent',
|
||||
predecessorAgents: sequentialNodes,
|
||||
output: loopToName
|
||||
}
|
||||
|
||||
return returnOutput
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: Loop_SeqAgents }
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-back-up-double"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M13 14l-4 -4l4 -4" /><path d="M8 14l-4 -4l4 -4" /><path d="M9 10h7a4 4 0 1 1 0 8h-1" /></svg>
|
||||
|
After Width: | Height: | Size: 423 B |
Reference in New Issue
Block a user