Files
Flowise/packages/components/nodes/sequentialagents/End/End.ts
T
Henry Heng bca4de0c63 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
2024-07-22 17:46:14 +01:00

55 lines
1.5 KiB
TypeScript

import { END } from '@langchain/langgraph'
import { INode, INodeData, INodeParams, ISeqAgentNode } from '../../../src/Interface'
class End_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 = 'End'
this.name = 'seqEnd'
this.version = 1.0
this.type = 'End'
this.icon = 'end.svg'
this.category = 'Sequential Agents'
this.description = 'End conversation'
this.baseClasses = [this.type]
this.inputs = [
{
label: 'Start | Agent | LLM | Tool Node',
name: 'sequentialNode',
type: 'Start | Agent | LLMNode | ToolNode'
}
]
this.hideOutput = true
}
async init(nodeData: INodeData): Promise<any> {
const sequentialNode = nodeData.inputs?.sequentialNode as ISeqAgentNode
if (!sequentialNode) throw new Error('End must have a predecessor!')
const returnOutput: ISeqAgentNode = {
id: nodeData.id,
node: END,
name: END,
label: END,
type: 'end',
output: END,
predecessorAgents: [sequentialNode]
}
return returnOutput
}
}
module.exports = { nodeClass: End_SeqAgents }