Chore/Update issue templates and add new tools (#4687)

* Enhancement: Update issue templates and add new tools

- Updated bug report template to include a default label of 'bug'.
- Updated feature request template to include a default label of 'enhancement'.
- Added new credential class for Agentflow API.
- Enhanced Agent and HTTP nodes to improve tool management and error handling.
- Added deprecation badges to several agent and chain classes.
- Introduced new tools for handling requests (GET, POST, DELETE, PUT) with improved error handling.
- Added new chatflows and agentflows for various use cases, including document QnA and translation.
- Updated UI components for better handling of agent flows and marketplace interactions.
- Refactored utility functions for improved functionality and clarity.

* Refactor: Remove beta badge and streamline template title assignment

- Removed the 'BETA' badge from the ExtractMetadataRetriever class.
- Simplified the title assignment in the agentflowv2 generator by using a variable instead of inline string manipulation.
This commit is contained in:
Henry Heng
2025-06-19 18:11:24 +01:00
committed by GitHub
parent 15dd28356b
commit a107aa7a77
86 changed files with 9942 additions and 12634 deletions
@@ -0,0 +1,23 @@
import { INodeParams, INodeCredential } from '../src/Interface'
class AgentflowApi implements INodeCredential {
label: string
name: string
version: number
inputs: INodeParams[]
constructor() {
this.label = 'Agentflow API'
this.name = 'agentflowApi'
this.version = 1.0
this.inputs = [
{
label: 'Agentflow Api Key',
name: 'agentflowApiKey',
type: 'password'
}
]
}
}
module.exports = { credClass: AgentflowApi }
@@ -496,18 +496,21 @@ class Agent_Agentflow implements INode {
}
}
const toolInstance = await newToolNodeInstance.init(newNodeData, '', options)
if (tool.agentSelectedToolRequiresHumanInput) {
toolInstance.requiresHumanInput = true
}
// toolInstance might returns a list of tools like MCP tools
if (Array.isArray(toolInstance)) {
for (const subTool of toolInstance) {
const subToolInstance = subTool as Tool
;(subToolInstance as any).agentSelectedTool = tool.agentSelectedTool
if (tool.agentSelectedToolRequiresHumanInput) {
;(subToolInstance as any).requiresHumanInput = true
}
toolsInstance.push(subToolInstance)
}
} else {
if (tool.agentSelectedToolRequiresHumanInput) {
toolInstance.requiresHumanInput = true
}
toolsInstance.push(toolInstance as Tool)
}
}
@@ -929,7 +932,14 @@ class Agent_Agentflow implements INode {
}
// Prepare final response and output object
const finalResponse = (response.content as string) ?? JSON.stringify(response, null, 2)
let finalResponse = ''
if (response.content && Array.isArray(response.content)) {
finalResponse = response.content.map((item: any) => item.text).join('\n')
} else if (response.content && typeof response.content === 'string') {
finalResponse = response.content
} else {
finalResponse = JSON.stringify(response, null, 2)
}
const output = this.prepareOutputObject(
response,
availableTools,
@@ -1374,6 +1384,7 @@ class Agent_Agentflow implements INode {
const usedTools: IUsedTool[] = []
let sourceDocuments: Array<any> = []
let artifacts: any[] = []
let isWaitingForHumanInput: boolean | undefined
// Process each tool call
for (let i = 0; i < response.tool_calls.length; i++) {
@@ -1536,7 +1547,8 @@ class Agent_Agentflow implements INode {
usedTools: recursiveUsedTools,
sourceDocuments: recursiveSourceDocuments,
artifacts: recursiveArtifacts,
totalTokens: recursiveTokens
totalTokens: recursiveTokens,
isWaitingForHumanInput: recursiveIsWaitingForHumanInput
} = await this.handleToolCalls({
response: newResponse,
messages,
@@ -1558,9 +1570,10 @@ class Agent_Agentflow implements INode {
sourceDocuments = [...sourceDocuments, ...recursiveSourceDocuments]
artifacts = [...artifacts, ...recursiveArtifacts]
totalTokens += recursiveTokens
isWaitingForHumanInput = recursiveIsWaitingForHumanInput
}
return { response: newResponse, usedTools, sourceDocuments, artifacts, totalTokens }
return { response: newResponse, usedTools, sourceDocuments, artifacts, totalTokens, isWaitingForHumanInput }
}
/**
@@ -1660,7 +1673,14 @@ class Agent_Agentflow implements INode {
if (humanInput.type === 'reject') {
messages.pop()
toolsInstance = toolsInstance.filter((tool) => tool.name !== toolCall.name)
const toBeRemovedTool = toolsInstance.find((tool) => tool.name === toolCall.name)
if (toBeRemovedTool) {
toolsInstance = toolsInstance.filter((tool) => tool.name !== toolCall.name)
// Remove other tools with the same agentSelectedTool such as MCP tools
toolsInstance = toolsInstance.filter(
(tool) => (tool as any).agentSelectedTool !== (toBeRemovedTool as any).agentSelectedTool
)
}
}
if (humanInput.type === 'proceed') {
let toolIds: ICommonObject | undefined
@@ -336,6 +336,9 @@ class HTTP_Agentflow implements INode {
} catch (error) {
console.error('HTTP Request Error:', error)
const errorMessage =
error.response?.data?.message || error.response?.data?.error || error.message || 'An error occurred during the HTTP request'
// Format error response
const errorResponse: any = {
id: nodeData.id,
@@ -353,7 +356,7 @@ class HTTP_Agentflow implements INode {
},
error: {
name: error.name || 'Error',
message: error.message || 'An error occurred during the HTTP request'
message: errorMessage
},
state
}
@@ -366,7 +369,7 @@ class HTTP_Agentflow implements INode {
errorResponse.error.headers = error.response.headers
}
throw new Error(error)
throw new Error(errorMessage)
}
}
}
+21 -3
View File
@@ -262,6 +262,7 @@ class LLM_Agentflow implements INode {
}`,
description: 'JSON schema for the structured output',
optional: true,
hideCodeExecute: true,
show: {
'llmStructuredOutput[$index].type': 'jsonArray'
}
@@ -486,8 +487,15 @@ class LLM_Agentflow implements INode {
}
// Prepare final response and output object
const finalResponse = (response.content as string) ?? JSON.stringify(response, null, 2)
const output = this.prepareOutputObject(response, finalResponse, startTime, endTime, timeDelta)
let finalResponse = ''
if (response.content && Array.isArray(response.content)) {
finalResponse = response.content.map((item: any) => item.text).join('\n')
} else if (response.content && typeof response.content === 'string') {
finalResponse = response.content
} else {
finalResponse = JSON.stringify(response, null, 2)
}
const output = this.prepareOutputObject(response, finalResponse, startTime, endTime, timeDelta, isStructuredOutput)
// End analytics tracking
if (analyticHandlers && llmIds) {
@@ -853,7 +861,8 @@ class LLM_Agentflow implements INode {
finalResponse: string,
startTime: number,
endTime: number,
timeDelta: number
timeDelta: number,
isStructuredOutput: boolean
): any {
const output: any = {
content: finalResponse,
@@ -872,6 +881,15 @@ class LLM_Agentflow implements INode {
output.usageMetadata = response.usage_metadata
}
if (isStructuredOutput && typeof response === 'object') {
const structuredOutput = response as Record<string, any>
for (const key in structuredOutput) {
if (structuredOutput[key]) {
output[key] = structuredOutput[key]
}
}
}
return output
}
@@ -23,6 +23,7 @@ class AutoGPT_Agents implements INode {
category: string
baseClasses: string[]
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'AutoGPT'
@@ -30,6 +31,7 @@ class AutoGPT_Agents implements INode {
this.version = 2.0
this.type = 'AutoGPT'
this.category = 'Agents'
this.badge = 'DEPRECATING'
this.icon = 'autogpt.svg'
this.description = 'Autonomous agent with chain of thoughts for self-guided task completion'
this.baseClasses = ['AutoGPT']
@@ -15,6 +15,7 @@ class BabyAGI_Agents implements INode {
category: string
baseClasses: string[]
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'BabyAGI'
@@ -23,6 +24,7 @@ class BabyAGI_Agents implements INode {
this.type = 'BabyAGI'
this.category = 'Agents'
this.icon = 'babyagi.svg'
this.badge = 'DEPRECATING'
this.description = 'Task Driven Autonomous Agent which creates new task and reprioritizes task list based on objective'
this.baseClasses = ['BabyAGI']
this.inputs = [
@@ -26,6 +26,7 @@ class GETApiChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'GET API Chain'
@@ -34,6 +35,7 @@ class GETApiChain_Chains implements INode {
this.type = 'GETApiChain'
this.icon = 'get.svg'
this.category = 'Chains'
this.badge = 'DEPRECATING'
this.description = 'Chain to run queries against GET API'
this.baseClasses = [this.type, ...getBaseClasses(APIChain)]
this.inputs = [
@@ -17,6 +17,7 @@ class OpenApiChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'OpenAPI Chain'
@@ -25,6 +26,7 @@ class OpenApiChain_Chains implements INode {
this.type = 'OpenAPIChain'
this.icon = 'openapi.svg'
this.category = 'Chains'
this.badge = 'DEPRECATING'
this.description = 'Chain that automatically select and call APIs based only on an OpenAPI spec'
this.baseClasses = [this.type, ...getBaseClasses(APIChain)]
this.inputs = [
@@ -15,6 +15,7 @@ class POSTApiChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'POST API Chain'
@@ -23,6 +24,7 @@ class POSTApiChain_Chains implements INode {
this.type = 'POSTApiChain'
this.icon = 'post.svg'
this.category = 'Chains'
this.badge = 'DEPRECATING'
this.description = 'Chain to run queries against POST API'
this.baseClasses = [this.type, ...getBaseClasses(APIChain)]
this.inputs = [
@@ -16,11 +16,13 @@ class MultiPromptChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'Multi Prompt Chain'
this.name = 'multiPromptChain'
this.version = 2.0
this.badge = 'DEPRECATING'
this.type = 'MultiPromptChain'
this.icon = 'prompt.svg'
this.category = 'Chains'
@@ -15,12 +15,14 @@ class MultiRetrievalQAChain_Chains implements INode {
category: string
baseClasses: string[]
description: string
badge: string
inputs: INodeParams[]
constructor() {
this.label = 'Multi Retrieval QA Chain'
this.name = 'multiRetrievalQAChain'
this.version = 2.0
this.badge = 'DEPRECATING'
this.type = 'MultiRetrievalQAChain'
this.icon = 'qa.svg'
this.category = 'Chains'
@@ -17,6 +17,7 @@ class RetrievalQAChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'Retrieval QA Chain'
@@ -24,6 +25,7 @@ class RetrievalQAChain_Chains implements INode {
this.version = 2.0
this.type = 'RetrievalQAChain'
this.icon = 'qa.svg'
this.badge = 'DEPRECATING'
this.category = 'Chains'
this.description = 'QA chain to answer a question based on the retrieved documents'
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)]
@@ -17,6 +17,7 @@ class VectorDBQAChain_Chains implements INode {
baseClasses: string[]
description: string
inputs: INodeParams[]
badge: string
constructor() {
this.label = 'VectorDB QA Chain'
@@ -25,6 +26,7 @@ class VectorDBQAChain_Chains implements INode {
this.type = 'VectorDBQAChain'
this.icon = 'vectordb.svg'
this.category = 'Chains'
this.badge = 'DEPRECATING'
this.description = 'QA chain for vector databases'
this.baseClasses = [this.type, ...getBaseClasses(VectorDBQAChain)]
this.inputs = [
@@ -31,7 +31,6 @@ class ExtractMetadataRetriever_Retrievers implements INode {
this.category = 'Retrievers'
this.description = 'Extract keywords/metadata from the query and use it to filter documents'
this.baseClasses = [this.type, 'BaseRetriever']
this.badge = 'BETA'
this.inputs = [
{
label: 'Vector Store',
@@ -0,0 +1,381 @@
import { DataSource } from 'typeorm'
import { z } from 'zod'
import { NodeVM } from '@flowiseai/nodevm'
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 { availableDependencies, defaultAllowBuiltInDep, getCredentialData, getCredentialParam } from '../../../src/utils'
import { v4 as uuidv4 } from 'uuid'
class AgentAsTool_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 = 'Agent as Tool'
this.name = 'agentAsTool'
this.version = 1.0
this.type = 'AgentAsTool'
this.icon = 'agentastool.svg'
this.category = 'Tools'
this.description = 'Use as a tool to execute another agentflow'
this.baseClasses = [this.type, 'Tool']
this.credential = {
label: 'Connect Credential',
name: 'credential',
type: 'credential',
credentialNames: ['agentflowApi'],
optional: true
}
this.inputs = [
{
label: 'Select Agent',
name: 'selectedAgentflow',
type: 'asyncOptions',
loadMethod: 'listAgentflows'
},
{
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: 'Return Direct',
name: 'returnDirect',
type: 'boolean',
optional: true
},
{
label: 'Override Config',
name: 'overrideConfig',
description: 'Override the config passed to the Agentflow.',
type: 'json',
optional: true,
additionalParams: true
},
{
label: 'Base URL',
name: 'baseURL',
type: 'string',
description:
'Base URL to Flowise. By default, it is the URL of the incoming request. Useful when you need to execute the Agentflow through an alternative route.',
placeholder: 'http://localhost:3000',
optional: true,
additionalParams: true
},
{
label: 'Start new session per message',
name: 'startNewSession',
type: 'boolean',
description:
'Whether to continue the session with the Agentflow tool or start a new one with each interaction. Useful for Agentflows with memory if you want to avoid it.',
default: false,
optional: true,
additionalParams: true
},
{
label: 'Use Question from Chat',
name: 'useQuestionFromChat',
type: 'boolean',
description:
'Whether to use the question from the chat as input to the agentflow. 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 agentflow. Leave empty to let LLM decides the input.',
optional: true,
additionalParams: true,
show: {
useQuestionFromChat: false
}
}
]
}
//@ts-ignore
loadMethods = {
async listAgentflows(_: INodeData, options: ICommonObject): Promise<INodeOptionsValue[]> {
const returnData: INodeOptionsValue[] = []
const appDataSource = options.appDataSource as DataSource
const databaseEntities = options.databaseEntities as IDatabaseEntity
if (appDataSource === undefined || !appDataSource) {
return returnData
}
const searchOptions = options.searchOptions || {}
const agentflows = await appDataSource.getRepository(databaseEntities['ChatFlow']).findBy({
...searchOptions,
type: 'AGENTFLOW'
})
for (let i = 0; i < agentflows.length; i += 1) {
const data = {
label: agentflows[i].name,
name: agentflows[i].id
} as INodeOptionsValue
returnData.push(data)
}
return returnData
}
}
async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {
const selectedAgentflowId = nodeData.inputs?.selectedAgentflow as string
const _name = nodeData.inputs?.name as string
const description = nodeData.inputs?.description as string
const useQuestionFromChat = nodeData.inputs?.useQuestionFromChat as boolean
const returnDirect = nodeData.inputs?.returnDirect as boolean
const customInput = nodeData.inputs?.customInput as string
const overrideConfig =
typeof nodeData.inputs?.overrideConfig === 'string' &&
nodeData.inputs.overrideConfig.startsWith('{') &&
nodeData.inputs.overrideConfig.endsWith('}')
? JSON.parse(nodeData.inputs.overrideConfig)
: nodeData.inputs?.overrideConfig
const startNewSession = nodeData.inputs?.startNewSession as boolean
const baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const agentflowApiKey = getCredentialParam('agentflowApiKey', credentialData, nodeData)
if (selectedAgentflowId === options.chatflowid) throw new Error('Cannot call the same agentflow!')
let headers = {}
if (agentflowApiKey) headers = { Authorization: `Bearer ${agentflowApiKey}` }
let toolInput = ''
if (useQuestionFromChat) {
toolInput = input
} else if (customInput) {
toolInput = customInput
}
let name = _name || 'agentflow_tool'
return new AgentflowTool({
name,
baseURL,
description,
returnDirect,
agentflowid: selectedAgentflowId,
startNewSession,
headers,
input: toolInput,
overrideConfig
})
}
}
class AgentflowTool extends StructuredTool {
static lc_name() {
return 'AgentflowTool'
}
name = 'agentflow_tool'
description = 'Execute another agentflow'
input = ''
agentflowid = ''
startNewSession = false
baseURL = 'http://localhost:3000'
headers = {}
overrideConfig?: object
schema = z.object({
input: z.string().describe('input question')
// overrideConfig: z.record(z.any()).optional().describe('override config'), // This will be passed to the Agent, so comment it for now.
}) as any
constructor({
name,
description,
returnDirect,
input,
agentflowid,
startNewSession,
baseURL,
headers,
overrideConfig
}: {
name: string
description: string
returnDirect: boolean
input: string
agentflowid: string
startNewSession: boolean
baseURL: string
headers: ICommonObject
overrideConfig?: object
}) {
super()
this.name = name
this.description = description
this.input = input
this.baseURL = baseURL
this.startNewSession = startNewSession
this.headers = headers
this.agentflowid = agentflowid
this.overrideConfig = overrideConfig
this.returnDirect = returnDirect
}
async call(
arg: z.infer<typeof this.schema>,
configArg?: RunnableConfig | Callbacks,
tags?: string[],
flowConfig?: { sessionId?: string; chatId?: string; input?: string }
): Promise<string> {
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
}
if (result && typeof result !== 'string') {
result = JSON.stringify(result)
}
await runManager?.handleToolEnd(result)
return result
}
// @ts-ignore
protected async _call(
arg: z.infer<typeof this.schema>,
_?: CallbackManagerForToolRun,
flowConfig?: { sessionId?: string; chatId?: string; input?: string }
): Promise<string> {
const inputQuestion = this.input || arg.input
const body = {
question: inputQuestion,
chatId: this.startNewSession ? uuidv4() : flowConfig?.chatId,
overrideConfig: {
sessionId: this.startNewSession ? uuidv4() : flowConfig?.sessionId,
...(this.overrideConfig ?? {}),
...(arg.overrideConfig ?? {})
}
}
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'flowise-tool': 'true',
...this.headers
},
body: JSON.stringify(body)
}
let sandbox = {
$callOptions: options,
$callBody: body,
util: undefined,
Symbol: undefined,
child_process: undefined,
fs: undefined,
process: undefined
}
const code = `
const fetch = require('node-fetch');
const url = "${this.baseURL}/api/v1/prediction/${this.agentflowid}";
const body = $callBody;
const options = $callOptions;
try {
const response = await fetch(url, options);
const resp = await response.json();
return resp.text;
} catch (error) {
console.error(error);
return '';
}
`
const builtinDeps = process.env.TOOL_FUNCTION_BUILTIN_DEP
? defaultAllowBuiltInDep.concat(process.env.TOOL_FUNCTION_BUILTIN_DEP.split(','))
: defaultAllowBuiltInDep
const externalDeps = process.env.TOOL_FUNCTION_EXTERNAL_DEP ? process.env.TOOL_FUNCTION_EXTERNAL_DEP.split(',') : []
const deps = availableDependencies.concat(externalDeps)
const vmOptions = {
console: 'inherit',
sandbox,
require: {
external: { modules: deps },
builtin: builtinDeps
},
eval: false,
wasm: false,
timeout: 10000
} as any
const vm = new NodeVM(vmOptions)
const response = await vm.run(`module.exports = async function() {${code}}()`, __dirname)
return response
}
}
module.exports = { nodeClass: AgentAsTool_Tools }
@@ -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-users-group"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1" /><path d="M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M17 10h2a2 2 0 0 1 2 2v1" /><path d="M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M3 13v-1a2 2 0 0 1 2 -2h2" /></svg>

After

Width:  |  Height:  |  Size: 588 B

@@ -0,0 +1,144 @@
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { ArxivParameters, desc, ArxivTool } from './core'
class Arxiv_Tools implements INode {
label: string
name: string
version: number
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]
constructor() {
this.label = 'Arxiv'
this.name = 'arxiv'
this.version = 1.0
this.type = 'Arxiv'
this.icon = 'arxiv.png'
this.category = 'Tools'
this.description = 'Search and read content from academic papers on Arxiv'
this.baseClasses = [this.type, ...getBaseClasses(ArxivTool)]
this.inputs = [
{
label: 'Name',
name: 'arxivName',
type: 'string',
default: 'arxiv_search',
description: 'Name of the tool',
additionalParams: true,
optional: true
},
{
label: 'Description',
name: 'arxivDescription',
type: 'string',
rows: 4,
default: desc,
description: 'Describe to LLM when it should use this tool',
additionalParams: true,
optional: true
},
{
label: 'Top K Results',
name: 'topKResults',
type: 'number',
description: 'Number of top results to return from Arxiv search',
default: '3',
step: 1,
optional: true,
additionalParams: true
},
{
label: 'Max Query Length',
name: 'maxQueryLength',
type: 'number',
description: 'Maximum length of the search query',
default: '300',
step: 1,
optional: true,
additionalParams: true
},
{
label: 'Max Content Length',
name: 'docContentCharsMax',
type: 'number',
description: 'Maximum length of the returned content. Set to 0 for unlimited',
default: '10000',
step: 1,
optional: true,
additionalParams: true
},
{
label: 'Load Full Content',
name: 'loadFullContent',
type: 'boolean',
description:
'Download PDFs and extract full paper content instead of just summaries. Warning: This is slower and uses more resources.',
default: false,
optional: true,
additionalParams: true
},
{
label: 'Continue On Failure',
name: 'continueOnFailure',
type: 'boolean',
description:
'Continue processing other papers if one fails to download/parse (only applies when Load Full Content is enabled)',
default: false,
optional: true,
additionalParams: true
},
{
label: 'Use Legacy Build',
name: 'legacyBuild',
type: 'boolean',
description: 'Use legacy PDF.js build for PDF parsing (only applies when Load Full Content is enabled)',
default: false,
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const name = (nodeData.inputs?.name as string) || (nodeData.inputs?.arxivName as string)
const description = (nodeData.inputs?.description as string) || (nodeData.inputs?.arxivDescription as string)
const topKResults = nodeData.inputs?.topKResults as string
const maxQueryLength = nodeData.inputs?.maxQueryLength as string
const docContentCharsMax = nodeData.inputs?.docContentCharsMax as string
const loadFullContent = nodeData.inputs?.loadFullContent as boolean
const continueOnFailure = nodeData.inputs?.continueOnFailure as boolean
const legacyBuild = nodeData.inputs?.legacyBuild as boolean
let logger
const orgId = options.orgId
if (process.env.DEBUG === 'true') {
logger = options.logger
}
const obj: ArxivParameters = {}
if (description) obj.description = description
if (name)
obj.name = name
.toLowerCase()
.replace(/ /g, '_')
.replace(/[^a-z0-9_-]/g, '')
if (topKResults) obj.topKResults = parseInt(topKResults, 10)
if (maxQueryLength) obj.maxQueryLength = parseInt(maxQueryLength, 10)
if (docContentCharsMax) {
const maxChars = parseInt(docContentCharsMax, 10)
obj.docContentCharsMax = maxChars === 0 ? undefined : maxChars
}
if (loadFullContent !== undefined) obj.loadFullContent = loadFullContent
if (continueOnFailure !== undefined) obj.continueOnFailure = continueOnFailure
if (legacyBuild !== undefined) obj.legacyBuild = legacyBuild
return new ArxivTool(obj, logger, orgId)
}
}
module.exports = { nodeClass: Arxiv_Tools }
Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@@ -0,0 +1,266 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { PDFLoader } from '@langchain/community/document_loaders/fs/pdf'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
export const desc = `Use this tool to search for academic papers on Arxiv. You can search by keywords, topics, authors, or specific Arxiv IDs. The tool can return either paper summaries or download and extract full paper content.`
export interface ArxivParameters {
topKResults?: number
maxQueryLength?: number
docContentCharsMax?: number
loadFullContent?: boolean
continueOnFailure?: boolean
legacyBuild?: boolean
name?: string
description?: string
}
interface ArxivResult {
id: string
title: string
authors: string[]
summary: string
published: string
updated: string
entryId: string
}
// Schema for Arxiv search
const createArxivSchema = () => {
return z.object({
query: z
.string()
.describe('Search query for Arxiv papers. Can be keywords, topics, authors, or specific Arxiv IDs (e.g., 2301.12345)')
})
}
export class ArxivTool extends DynamicStructuredTool {
topKResults = 3
maxQueryLength = 300
docContentCharsMax = 4000
loadFullContent = false
continueOnFailure = false
legacyBuild = false
logger?: any
orgId?: string
constructor(args?: ArxivParameters, logger?: any, orgId?: string) {
const schema = createArxivSchema()
const toolInput = {
name: args?.name || 'arxiv_search',
description: args?.description || desc,
schema: schema,
baseUrl: '',
method: 'GET',
headers: {}
}
super(toolInput)
this.topKResults = args?.topKResults ?? this.topKResults
this.maxQueryLength = args?.maxQueryLength ?? this.maxQueryLength
this.docContentCharsMax = args?.docContentCharsMax ?? this.docContentCharsMax
this.loadFullContent = args?.loadFullContent ?? this.loadFullContent
this.continueOnFailure = args?.continueOnFailure ?? this.continueOnFailure
this.legacyBuild = args?.legacyBuild ?? this.legacyBuild
this.logger = logger
this.orgId = orgId
}
private isArxivIdentifier(query: string): boolean {
const arxivIdentifierPattern = /\d{2}(0[1-9]|1[0-2])\.\d{4,5}(v\d+|)|\d{7}.*/
const queryItems = query.substring(0, this.maxQueryLength).split(/\s+/)
for (const queryItem of queryItems) {
const match = queryItem.match(arxivIdentifierPattern)
if (!match || match[0] !== queryItem) {
return false
}
}
return true
}
private parseArxivResponse(xmlText: string): ArxivResult[] {
const results: ArxivResult[] = []
// Simple XML parsing for Arxiv API response
const entryRegex = /<entry>(.*?)<\/entry>/gs
const entries = xmlText.match(entryRegex) || []
for (const entry of entries) {
try {
const id = this.extractXmlValue(entry, 'id')
const title = this.extractXmlValue(entry, 'title')?.replace(/\n\s+/g, ' ').trim()
const summary = this.extractXmlValue(entry, 'summary')?.replace(/\n\s+/g, ' ').trim()
const published = this.extractXmlValue(entry, 'published')
const updated = this.extractXmlValue(entry, 'updated')
// Extract authors
const authorRegex = /<author><name>(.*?)<\/name><\/author>/g
const authors: string[] = []
let authorMatch
while ((authorMatch = authorRegex.exec(entry)) !== null) {
authors.push(authorMatch[1])
}
if (id && title && summary) {
results.push({
id,
title,
authors,
summary,
published: published || '',
updated: updated || '',
entryId: id
})
}
} catch (error) {
console.warn('Error parsing Arxiv entry:', error)
}
}
return results
}
private extractXmlValue(xml: string, tag: string): string | undefined {
const regex = new RegExp(`<${tag}[^>]*>(.*?)</${tag}>`, 's')
const match = xml.match(regex)
return match ? match[1] : undefined
}
private async fetchResults(query: string): Promise<ArxivResult[]> {
const baseUrl = 'http://export.arxiv.org/api/query'
let searchParams: URLSearchParams
if (this.isArxivIdentifier(query)) {
// Search by ID
const ids = query.split(/\s+/).join(',')
searchParams = new URLSearchParams({
id_list: ids,
max_results: this.topKResults.toString()
})
} else {
// Search by query
// Remove problematic characters that can cause search issues
const cleanedQuery = query.replace(/[:-]/g, '').substring(0, this.maxQueryLength)
searchParams = new URLSearchParams({
search_query: `all:${cleanedQuery}`,
max_results: this.topKResults.toString(),
sortBy: 'relevance',
sortOrder: 'descending'
})
}
const url = `${baseUrl}?${searchParams.toString()}`
this.logger?.info(`[${this.orgId}]: Making Arxiv API call to: ${url}`)
const response = await fetch(url)
if (!response.ok) {
throw new Error(`Arxiv API error: ${response.status} ${response.statusText}`)
}
const xmlText = await response.text()
return this.parseArxivResponse(xmlText)
}
private async downloadAndExtractPdf(arxivId: string): Promise<string> {
// Extract clean arxiv ID from full URL if needed
const cleanId = arxivId.replace('http://arxiv.org/abs/', '').replace('https://arxiv.org/abs/', '')
const pdfUrl = `https://arxiv.org/pdf/${cleanId}.pdf`
this.logger?.info(`[${this.orgId}]: Downloading PDF from: ${pdfUrl}`)
const response = await fetch(pdfUrl)
if (!response.ok) {
throw new Error(`Failed to download PDF: ${response.status} ${response.statusText}`)
}
// Get PDF buffer and create blob
const buffer = await response.buffer()
const blob = new Blob([buffer])
// Use PDFLoader to extract text (same as Pdf.ts)
const loader = new PDFLoader(blob, {
splitPages: false,
pdfjs: () =>
// @ts-ignore
this.legacyBuild ? import('pdfjs-dist/legacy/build/pdf.js') : import('pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js')
})
const docs = await loader.load()
return docs.map((doc) => doc.pageContent).join('\n')
}
/** @ignore */
async _call(arg: any): Promise<string> {
const { query } = arg
if (!query) {
throw new Error('Query is required for Arxiv search')
}
try {
const results = await this.fetchResults(query)
if (results.length === 0) {
return 'No good Arxiv Result was found'
}
if (!this.loadFullContent) {
// Return summaries only (original behavior)
const docs = results.map((result) => {
const publishedDate = result.published ? new Date(result.published).toISOString().split('T')[0] : 'Unknown'
return `Published: ${publishedDate}\nTitle: ${result.title}\nAuthors: ${result.authors.join(', ')}\nSummary: ${
result.summary
}`
})
const fullText = docs.join('\n\n')
return this.docContentCharsMax ? fullText.substring(0, this.docContentCharsMax) : fullText
} else {
// Download PDFs and extract full content
const docs: string[] = []
for (const result of results) {
try {
this.logger?.info(`[${this.orgId}]: Processing paper: ${result.title}`)
// Download and extract PDF content
const fullText = await this.downloadAndExtractPdf(result.id)
const publishedDate = result.published ? new Date(result.published).toISOString().split('T')[0] : 'Unknown'
// Format with metadata and full content
const docContent = `Published: ${publishedDate}\nTitle: ${result.title}\nAuthors: ${result.authors.join(
', '
)}\nSummary: ${result.summary}\n\nFull Content:\n${fullText}`
const truncatedContent = this.docContentCharsMax ? docContent.substring(0, this.docContentCharsMax) : docContent
docs.push(truncatedContent)
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
console.error(`Error processing paper ${result.title}:`, errorMessage)
if (!this.continueOnFailure) {
throw new Error(`Failed to process paper "${result.title}": ${errorMessage}`)
} else {
// Add error notice and continue with summary only
const publishedDate = result.published ? new Date(result.published).toISOString().split('T')[0] : 'Unknown'
const fallbackContent = `Published: ${publishedDate}\nTitle: ${result.title}\nAuthors: ${result.authors.join(
', '
)}\nSummary: ${result.summary}\n\n[ERROR: Could not load full content - ${errorMessage}]`
docs.push(fallbackContent)
}
}
}
return docs.join('\n\n---\n\n')
}
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
console.error('Arxiv search error:', errorMessage)
throw new Error(`Failed to search Arxiv: ${errorMessage}`)
}
}
}
@@ -23,7 +23,7 @@ class ChatflowTool_Tools implements INode {
constructor() {
this.label = 'Chatflow Tool'
this.name = 'ChatflowTool'
this.version = 5.0
this.version = 5.1
this.type = 'ChatflowTool'
this.icon = 'chatflowTool.svg'
this.category = 'Tools'
@@ -106,7 +106,10 @@ class ChatflowTool_Tools implements INode {
type: 'string',
description: 'Custom input to be passed to the chatflow. Leave empty to let LLM decides the input.',
optional: true,
additionalParams: true
additionalParams: true,
show: {
useQuestionFromChat: false
}
}
]
}
@@ -126,9 +129,20 @@ class ChatflowTool_Tools implements INode {
const chatflows = await appDataSource.getRepository(databaseEntities['ChatFlow']).findBy(searchOptions)
for (let i = 0; i < chatflows.length; i += 1) {
let type = chatflows[i].type
if (type === 'AGENTFLOW') {
type = 'AgentflowV2'
} else if (type === 'MULTIAGENT') {
type = 'AgentflowV1'
} else if (type === 'ASSISTANT') {
type = 'Custom Assistant'
} else {
type = 'Chatflow'
}
const data = {
label: chatflows[i].name,
name: chatflows[i].id
name: chatflows[i].id,
description: type
} as INodeOptionsValue
returnData.push(data)
}
@@ -243,6 +243,9 @@ const getTools = (
const methods = paths[path]
for (const method in methods) {
// example of method: "get"
if (method !== 'get' && method !== 'post' && method !== 'put' && method !== 'delete' && method !== 'patch') {
continue
}
const spec = methods[method]
const toolName = spec.operationId
const toolDesc = spec.description || spec.summary || toolName
@@ -318,7 +321,7 @@ const getTools = (
dynamicStructuredTool.setVariables(variables)
dynamicStructuredTool.setFlowObject(flow)
dynamicStructuredTool.returnDirect = returnDirect
tools.push(dynamicStructuredTool)
if (toolName && toolDesc) tools.push(dynamicStructuredTool)
}
}
return tools
@@ -0,0 +1,141 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, stripHTMLFromToolInput } from '../../../src/utils'
import { desc, RequestParameters, RequestsDeleteTool } from './core'
const codeExample = `{
"id": {
"type": "string",
"required": true,
"in": "path",
"description": "ID of the item to delete. /:id"
},
"force": {
"type": "string",
"in": "query",
"description": "Force delete the item. ?force=true"
}
}`
class RequestsDelete_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 Delete'
this.name = 'requestsDelete'
this.version = 1.0
this.type = 'RequestsDelete'
this.icon = 'del.png'
this.category = 'Tools'
this.description = 'Execute HTTP DELETE requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsDeleteTool)]
this.inputs = [
{
label: 'URL',
name: 'requestsDeleteUrl',
type: 'string',
acceptVariable: true
},
{
label: 'Name',
name: 'requestsDeleteName',
type: 'string',
default: 'requests_delete',
description: 'Name of the tool',
additionalParams: true,
optional: true
},
{
label: 'Description',
name: 'requestsDeleteDescription',
type: 'string',
rows: 4,
default: desc,
description: 'Describe to LLM when it should use this tool',
additionalParams: true,
optional: true
},
{
label: 'Headers',
name: 'requestsDeleteHeaders',
type: 'string',
rows: 4,
acceptVariable: true,
additionalParams: true,
optional: true,
placeholder: `{
"Authorization": "Bearer <token>"
}`
},
{
label: 'Query Params Schema',
name: 'requestsDeleteQueryParamsSchema',
type: 'code',
description: 'Description of the available query params to enable LLM to figure out which query params to use',
placeholder: `{
"id": {
"type": "string",
"required": true,
"in": "path",
"description": "ID of the item to delete. /:id"
},
"force": {
"type": "string",
"in": "query",
"description": "Force delete the item. ?force=true"
}
}`,
optional: true,
hideCodeExecute: true,
additionalParams: true,
codeExample: codeExample
},
{
label: 'Max Output Length',
name: 'requestsDeleteMaxOutputLength',
type: 'number',
description: 'Max length of the output. Remove this if you want to return the entire response',
default: '2000',
step: 1,
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
const headers = (nodeData.inputs?.headers as string) || (nodeData.inputs?.requestsDeleteHeaders as string)
const url = (nodeData.inputs?.url as string) || (nodeData.inputs?.requestsDeleteUrl as string)
const description = (nodeData.inputs?.description as string) || (nodeData.inputs?.requestsDeleteDescription as string)
const name = (nodeData.inputs?.name as string) || (nodeData.inputs?.requestsDeleteName as string)
const queryParamsSchema =
(nodeData.inputs?.queryParamsSchema as string) || (nodeData.inputs?.requestsDeleteQueryParamsSchema as string)
const maxOutputLength = nodeData.inputs?.requestsDeleteMaxOutputLength as string
const obj: RequestParameters = {}
if (url) obj.url = stripHTMLFromToolInput(url)
if (description) obj.description = description
if (name)
obj.name = name
.toLowerCase()
.replace(/ /g, '_')
.replace(/[^a-z0-9_-]/g, '')
if (queryParamsSchema) obj.queryParamsSchema = queryParamsSchema
if (maxOutputLength) obj.maxOutputLength = parseInt(maxOutputLength, 10)
if (headers) {
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(stripHTMLFromToolInput(headers))
obj.headers = parsedHeaders
}
return new RequestsDeleteTool(obj)
}
}
module.exports = { nodeClass: RequestsDelete_Tools }
@@ -0,0 +1,184 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
export const desc = `Use this when you need to execute a DELETE request to remove data from a website.`
export interface Headers {
[key: string]: string
}
export interface RequestParameters {
headers?: Headers
url?: string
name?: string
queryParamsSchema?: string
description?: string
maxOutputLength?: number
}
// Base schema for DELETE request
const createRequestsDeleteSchema = (queryParamsSchema?: string) => {
// If queryParamsSchema is provided, parse it and add dynamic query params
if (queryParamsSchema) {
try {
const parsedSchema = JSON.parse(queryParamsSchema)
const queryParamsObject: Record<string, z.ZodTypeAny> = {}
Object.entries(parsedSchema).forEach(([key, config]: [string, any]) => {
let zodType: z.ZodTypeAny = z.string()
// Handle different types
if (config.type === 'number') {
zodType = z.string().transform((val) => Number(val))
} else if (config.type === 'boolean') {
zodType = z.string().transform((val) => val === 'true')
}
// Add description
if (config.description) {
zodType = zodType.describe(config.description)
}
// Make optional if not required
if (!config.required) {
zodType = zodType.optional()
}
queryParamsObject[key] = zodType
})
if (Object.keys(queryParamsObject).length > 0) {
return z.object({
queryParams: z.object(queryParamsObject).optional().describe('Query parameters for the request')
})
}
} catch (error) {
console.warn('Failed to parse queryParamsSchema:', error)
}
}
// Fallback to generic query params
return z.object({
queryParams: z.record(z.string()).optional().describe('Optional query parameters to include in the request')
})
}
export class RequestsDeleteTool extends DynamicStructuredTool {
url = ''
maxOutputLength = Infinity
headers = {}
queryParamsSchema?: string
constructor(args?: RequestParameters) {
const schema = createRequestsDeleteSchema(args?.queryParamsSchema)
const toolInput = {
name: args?.name || 'requests_delete',
description: args?.description || desc,
schema: schema,
baseUrl: '',
method: 'DELETE',
headers: args?.headers || {}
}
super(toolInput)
this.url = args?.url ?? this.url
this.headers = args?.headers ?? this.headers
this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength
this.queryParamsSchema = args?.queryParamsSchema
}
/** @ignore */
async _call(arg: any): Promise<string> {
const params = { ...arg }
const inputUrl = this.url
if (!inputUrl) {
throw new Error('URL is required for DELETE request')
}
const requestHeaders = {
...(params.headers || {}),
...this.headers
}
// Process URL and query parameters based on schema
let finalUrl = inputUrl
const queryParams: Record<string, string> = {}
if (this.queryParamsSchema && params.queryParams && Object.keys(params.queryParams).length > 0) {
try {
const parsedSchema = JSON.parse(this.queryParamsSchema)
const pathParams: Array<{ key: string; value: string }> = []
Object.entries(params.queryParams).forEach(([key, value]) => {
const paramConfig = parsedSchema[key]
if (paramConfig && value !== undefined && value !== null) {
if (paramConfig.in === 'path') {
// Check if URL contains path parameter placeholder
const pathPattern = new RegExp(`:${key}\\b`, 'g')
if (finalUrl.includes(`:${key}`)) {
// Replace path parameters in URL (e.g., /:id -> /123)
finalUrl = finalUrl.replace(pathPattern, encodeURIComponent(String(value)))
} else {
// Collect path parameters to append to URL
pathParams.push({ key, value: String(value) })
}
} else if (paramConfig.in === 'query') {
// Add to query parameters
queryParams[key] = String(value)
}
}
})
// Append path parameters to URL if any exist
if (pathParams.length > 0) {
let urlPath = finalUrl
// Remove trailing slash if present
if (urlPath.endsWith('/')) {
urlPath = urlPath.slice(0, -1)
}
// Append each path parameter
pathParams.forEach(({ value }) => {
urlPath += `/${encodeURIComponent(value)}`
})
finalUrl = urlPath
}
// Add query parameters to URL if any exist
if (Object.keys(queryParams).length > 0) {
const url = new URL(finalUrl)
Object.entries(queryParams).forEach(([key, value]) => {
url.searchParams.append(key, value)
})
finalUrl = url.toString()
}
} catch (error) {
console.warn('Failed to process queryParamsSchema:', error)
}
} else if (params.queryParams && Object.keys(params.queryParams).length > 0) {
// Fallback: treat all parameters as query parameters if no schema is defined
const url = new URL(finalUrl)
Object.entries(params.queryParams).forEach(([key, value]) => {
url.searchParams.append(key, String(value))
})
finalUrl = url.toString()
}
try {
const res = await fetch(finalUrl, {
method: 'DELETE',
headers: requestHeaders
})
if (!res.ok) {
throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)
}
const text = await res.text()
return text.slice(0, this.maxOutputLength)
} catch (error) {
throw new Error(`Failed to make DELETE request: ${error instanceof Error ? error.message : 'Unknown error'}`)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

@@ -1,7 +1,21 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { getBaseClasses, stripHTMLFromToolInput } from '../../../src/utils'
import { desc, RequestParameters, RequestsGetTool } from './core'
const codeExample = `{
"id": {
"type": "string",
"required": true,
"in": "path",
"description": "ID of the item to get. /:id"
},
"limit": {
"type": "string",
"in": "query",
"description": "Limit the number of items to get. ?limit=10"
}
}`
class RequestsGet_Tools implements INode {
label: string
name: string
@@ -16,52 +30,107 @@ class RequestsGet_Tools implements INode {
constructor() {
this.label = 'Requests Get'
this.name = 'requestsGet'
this.version = 1.0
this.version = 2.0
this.type = 'RequestsGet'
this.icon = 'requestsget.svg'
this.icon = 'get.png'
this.category = 'Tools'
this.description = 'Execute HTTP GET requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsGetTool)]
this.inputs = [
{
label: 'URL',
name: 'url',
name: 'requestsGetUrl',
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',
acceptVariable: true
},
{
label: 'Name',
name: 'requestsGetName',
type: 'string',
default: 'requests_get',
description: 'Name of the tool',
additionalParams: true,
optional: true
},
{
label: 'Description',
name: 'description',
name: 'requestsGetDescription',
type: 'string',
rows: 4,
default: desc,
description: 'Acts like a prompt to tell agent when it should use this tool',
description: 'Describe to LLM when it should use this tool',
additionalParams: true,
optional: true
},
{
label: 'Headers',
name: 'headers',
type: 'json',
name: 'requestsGetHeaders',
type: 'string',
rows: 4,
acceptVariable: true,
additionalParams: true,
optional: true
optional: true,
placeholder: `{
"Authorization": "Bearer <token>"
}`
},
{
label: 'Query Params Schema',
name: 'requestsGetQueryParamsSchema',
type: 'code',
description: 'Description of the available query params to enable LLM to figure out which query params to use',
placeholder: `{
"id": {
"type": "string",
"required": true,
"in": "path",
"description": "ID of the item to get. /:id"
},
"limit": {
"type": "string",
"in": "query",
"description": "Limit the number of items to get. ?limit=10"
}
}`,
optional: true,
hideCodeExecute: true,
additionalParams: true,
codeExample: codeExample
},
{
label: 'Max Output Length',
name: 'requestsGetMaxOutputLength',
type: 'number',
description: 'Max length of the output. Remove this if you want to return the entire response',
default: '2000',
step: 1,
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
const headers = nodeData.inputs?.headers as string
const url = nodeData.inputs?.url as string
const description = nodeData.inputs?.description as string
const headers = (nodeData.inputs?.headers as string) || (nodeData.inputs?.requestsGetHeaders as string)
const url = (nodeData.inputs?.url as string) || (nodeData.inputs?.requestsGetUrl as string)
const description = (nodeData.inputs?.description as string) || (nodeData.inputs?.requestsGetDescription as string)
const name = (nodeData.inputs?.name as string) || (nodeData.inputs?.requestsGetName as string)
const queryParamsSchema =
(nodeData.inputs?.queryParamsSchema as string) || (nodeData.inputs?.requestsGetQueryParamsSchema as string)
const maxOutputLength = nodeData.inputs?.requestsGetMaxOutputLength as string
const obj: RequestParameters = {}
if (url) obj.url = url
if (url) obj.url = stripHTMLFromToolInput(url)
if (description) obj.description = description
if (name)
obj.name = name
.toLowerCase()
.replace(/ /g, '_')
.replace(/[^a-z0-9_-]/g, '')
if (queryParamsSchema) obj.queryParamsSchema = queryParamsSchema
if (maxOutputLength) obj.maxOutputLength = parseInt(maxOutputLength, 10)
if (headers) {
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(headers)
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(stripHTMLFromToolInput(headers))
obj.headers = parsedHeaders
}
@@ -1,8 +1,8 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { Tool } from '@langchain/core/tools'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
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 const desc = `Use this when you need to execute a GET request to get data from a website.`
export interface Headers {
[key: string]: string
@@ -11,36 +11,173 @@ export interface Headers {
export interface RequestParameters {
headers?: Headers
url?: string
name?: string
queryParamsSchema?: string
description?: string
maxOutputLength?: number
}
export class RequestsGetTool extends Tool {
name = 'requests_get'
// Base schema for GET request
const createRequestsGetSchema = (queryParamsSchema?: string) => {
// If queryParamsSchema is provided, parse it and add dynamic query params
if (queryParamsSchema) {
try {
const parsedSchema = JSON.parse(queryParamsSchema)
const queryParamsObject: Record<string, z.ZodTypeAny> = {}
Object.entries(parsedSchema).forEach(([key, config]: [string, any]) => {
let zodType: z.ZodTypeAny = z.string()
// Handle different types
if (config.type === 'number') {
zodType = z.string().transform((val) => Number(val))
} else if (config.type === 'boolean') {
zodType = z.string().transform((val) => val === 'true')
}
// Add description
if (config.description) {
zodType = zodType.describe(config.description)
}
// Make optional if not required
if (!config.required) {
zodType = zodType.optional()
}
queryParamsObject[key] = zodType
})
if (Object.keys(queryParamsObject).length > 0) {
return z.object({
queryParams: z.object(queryParamsObject).optional().describe('Query parameters for the request')
})
}
} catch (error) {
console.warn('Failed to parse queryParamsSchema:', error)
}
}
// Fallback to generic query params
return z.object({
queryParams: z.record(z.string()).optional().describe('Optional query parameters to include in the request')
})
}
export class RequestsGetTool extends DynamicStructuredTool {
url = ''
description = desc
maxOutputLength = 2000
maxOutputLength = Infinity
headers = {}
queryParamsSchema?: string
constructor(args?: RequestParameters) {
super()
const schema = createRequestsGetSchema(args?.queryParamsSchema)
const toolInput = {
name: args?.name || 'requests_get',
description: args?.description || desc,
schema: schema,
baseUrl: '',
method: 'GET',
headers: args?.headers || {}
}
super(toolInput)
this.url = args?.url ?? this.url
this.headers = args?.headers ?? this.headers
this.description = args?.description ?? this.description
this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength
this.queryParamsSchema = args?.queryParamsSchema
}
/** @ignore */
async _call(input: string) {
const inputUrl = !this.url ? input : this.url
async _call(arg: any): Promise<string> {
const params = { ...arg }
if (process.env.DEBUG === 'true') console.info(`Making GET API call to ${inputUrl}`)
const inputUrl = this.url
if (!inputUrl) {
throw new Error('URL is required for GET request')
}
const res = await fetch(inputUrl, {
headers: this.headers
})
const requestHeaders = {
...(params.headers || {}),
...this.headers
}
const text = await res.text()
return text.slice(0, this.maxOutputLength)
// Process URL and query parameters based on schema
let finalUrl = inputUrl
const queryParams: Record<string, string> = {}
if (this.queryParamsSchema && params.queryParams && Object.keys(params.queryParams).length > 0) {
try {
const parsedSchema = JSON.parse(this.queryParamsSchema)
const pathParams: Array<{ key: string; value: string }> = []
Object.entries(params.queryParams).forEach(([key, value]) => {
const paramConfig = parsedSchema[key]
if (paramConfig && value !== undefined && value !== null) {
if (paramConfig.in === 'path') {
// Check if URL contains path parameter placeholder
const pathPattern = new RegExp(`:${key}\\b`, 'g')
if (finalUrl.includes(`:${key}`)) {
// Replace path parameters in URL (e.g., /:id -> /123)
finalUrl = finalUrl.replace(pathPattern, encodeURIComponent(String(value)))
} else {
// Collect path parameters to append to URL
pathParams.push({ key, value: String(value) })
}
} else if (paramConfig.in === 'query') {
// Add to query parameters
queryParams[key] = String(value)
}
}
})
// Append path parameters to URL if any exist
if (pathParams.length > 0) {
let urlPath = finalUrl
// Remove trailing slash if present
if (urlPath.endsWith('/')) {
urlPath = urlPath.slice(0, -1)
}
// Append each path parameter
pathParams.forEach(({ value }) => {
urlPath += `/${encodeURIComponent(value)}`
})
finalUrl = urlPath
}
// Add query parameters to URL if any exist
if (Object.keys(queryParams).length > 0) {
const url = new URL(finalUrl)
Object.entries(queryParams).forEach(([key, value]) => {
url.searchParams.append(key, value)
})
finalUrl = url.toString()
}
} catch (error) {
console.warn('Failed to process queryParamsSchema:', error)
}
} else if (params.queryParams && Object.keys(params.queryParams).length > 0) {
// Fallback: treat all parameters as query parameters if no schema is defined
const url = new URL(finalUrl)
Object.entries(params.queryParams).forEach(([key, value]) => {
url.searchParams.append(key, String(value))
})
finalUrl = url.toString()
}
try {
const res = await fetch(finalUrl, {
headers: requestHeaders
})
if (!res.ok) {
throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)
}
const text = await res.text()
return text.slice(0, this.maxOutputLength)
} catch (error) {
throw new Error(`Failed to make GET request: ${error instanceof Error ? error.message : 'Unknown error'}`)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

@@ -1,6 +0,0 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5 20.5C10.5 20.5 10 20 9 20C7.067 20 6 21.567 6 23.5C6 25.433 7.067 27 9 27C10 27 10.7037 26.4812 11 26V24H10" stroke="#110000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M18.5 20H14V27H18.5M14 23.5H17.5" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23.5 27V20M21 20H26" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M19.1112 15.2076L17.482 13.3556C15.4506 14.3228 13.0464 14.0464 11.477 12.477C10.1962 11.1962 9.77656 9.35939 10.1913 7.62299C10.3492 6.9619 11.1601 6.82676 11.6407 7.30737L13.5196 9.18628C14.1962 9.86283 15.3416 9.81433 16.078 9.07795C16.8143 8.34157 16.8628 7.19616 16.1863 6.51961L14.3074 4.64071C13.8268 4.16009 13.9619 3.34916 14.623 3.19127C16.3594 2.77656 18.1962 3.19622 19.477 4.477C21.0464 6.04639 21.3228 8.45065 20.3556 10.482L22.2076 12.1112" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,7 +1,19 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { getBaseClasses, stripHTMLFromToolInput } from '../../../src/utils'
import { RequestParameters, desc, RequestsPostTool } from './core'
const codeExample = `{
"name": {
"type": "string",
"required": true,
"description": "Name of the item"
},
"date": {
"type": "string",
"description": "Date of the item"
}
}`
class RequestsPost_Tools implements INode {
label: string
name: string
@@ -16,62 +28,119 @@ class RequestsPost_Tools implements INode {
constructor() {
this.label = 'Requests Post'
this.name = 'requestsPost'
this.version = 1.0
this.version = 2.0
this.type = 'RequestsPost'
this.icon = 'requestspost.svg'
this.icon = 'post.png'
this.category = 'Tools'
this.description = 'Execute HTTP POST requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsPostTool)]
this.inputs = [
{
label: 'URL',
name: 'url',
name: 'requestsPostUrl',
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
acceptVariable: 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',
label: 'Name',
name: 'requestsPostName',
type: 'string',
default: 'requests_post',
description: 'Name of the tool',
additionalParams: true,
optional: true
},
{
label: 'Description',
name: 'description',
name: 'requestsPostDescription',
type: 'string',
rows: 4,
default: desc,
description: 'Acts like a prompt to tell agent when it should use this tool',
description: 'Describe to LLM when it should use this tool',
additionalParams: true,
optional: true
},
{
label: 'Headers',
name: 'headers',
type: 'json',
name: 'requestsPostHeaders',
type: 'string',
rows: 4,
acceptVariable: true,
additionalParams: true,
optional: true
optional: true,
placeholder: `{
"Authorization": "Bearer <token>"
}`
},
{
label: 'Body',
name: 'requestPostBody',
type: 'string',
rows: 4,
description: 'JSON body for the POST request. This will override the body generated by the LLM',
additionalParams: true,
acceptVariable: true,
optional: true,
placeholder: `{
"name": "John Doe",
"age": 30
}`
},
{
label: 'Body Schema',
name: 'requestsPostBodySchema',
type: 'code',
description: 'Description of the available body params to enable LLM to figure out which body params to use',
placeholder: `{
"name": {
"type": "string",
"required": true,
"description": "Name of the item"
},
"date": {
"type": "string",
"description": "Date of the item"
}
}`,
optional: true,
hideCodeExecute: true,
additionalParams: true,
codeExample: codeExample
},
{
label: 'Max Output Length',
name: 'requestsPostMaxOutputLength',
type: 'number',
description: 'Max length of the output. Remove this if you want to return the entire response',
default: '2000',
step: 1,
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
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 headers = (nodeData.inputs?.headers as string) || (nodeData.inputs?.requestsPostHeaders as string)
const url = (nodeData.inputs?.url as string) || (nodeData.inputs?.requestsPostUrl as string)
const name = (nodeData.inputs?.name as string) || (nodeData.inputs?.requestsPostName as string)
const description = (nodeData.inputs?.description as string) || (nodeData.inputs?.requestsPostDescription as string)
const body = (nodeData.inputs?.body as string) || (nodeData.inputs?.requestPostBody as string)
const bodySchema = nodeData.inputs?.requestsPostBodySchema as string
const maxOutputLength = (nodeData.inputs?.maxOutputLength as string) || (nodeData.inputs?.requestsPostMaxOutputLength as string)
const obj: RequestParameters = {}
if (url) obj.url = url
if (url) obj.url = stripHTMLFromToolInput(url)
if (description) obj.description = description
if (name)
obj.name = name
.toLowerCase()
.replace(/ /g, '_')
.replace(/[^a-z0-9_-]/g, '')
if (bodySchema) obj.bodySchema = stripHTMLFromToolInput(bodySchema)
if (maxOutputLength) obj.maxOutputLength = parseInt(maxOutputLength, 10)
if (headers) {
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(headers)
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(stripHTMLFromToolInput(headers))
obj.headers = parsedHeaders
}
if (body) {
@@ -1,12 +1,8 @@
import { Tool } from '@langchain/core/tools'
import { z } from 'zod'
import fetch from 'node-fetch'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
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 const desc = `Use this when you want to execute a POST request to create or update a resource.`
export interface Headers {
[key: string]: string
@@ -21,52 +17,129 @@ export interface RequestParameters {
body?: Body
url?: string
description?: string
name?: string
bodySchema?: string
maxOutputLength?: number
}
export class RequestsPostTool extends Tool {
name = 'requests_post'
// Base schema for POST request
const createRequestsPostSchema = (bodySchema?: string) => {
// If bodySchema is provided, parse it and add dynamic body params
if (bodySchema) {
try {
const parsedSchema = JSON.parse(bodySchema)
const bodyParamsObject: Record<string, z.ZodTypeAny> = {}
Object.entries(parsedSchema).forEach(([key, config]: [string, any]) => {
let zodType: z.ZodTypeAny = z.string()
// Handle different types
if (config.type === 'number') {
zodType = z.number()
} else if (config.type === 'boolean') {
zodType = z.boolean()
} else if (config.type === 'object') {
zodType = z.record(z.any())
} else if (config.type === 'array') {
zodType = z.array(z.any())
}
// Add description
if (config.description) {
zodType = zodType.describe(config.description)
}
// Make optional if not required
if (!config.required) {
zodType = zodType.optional()
}
bodyParamsObject[key] = zodType
})
if (Object.keys(bodyParamsObject).length > 0) {
return z.object({
body: z.object(bodyParamsObject).describe('Request body parameters')
})
}
} catch (error) {
console.warn('Failed to parse bodySchema:', error)
}
}
// Fallback to generic body
return z.object({
body: z.record(z.any()).optional().describe('Optional body data to include in the request')
})
}
export class RequestsPostTool extends DynamicStructuredTool {
url = ''
description = desc
maxOutputLength = Infinity
headers = {}
body = {}
bodySchema?: string
constructor(args?: RequestParameters) {
super()
const schema = createRequestsPostSchema(args?.bodySchema)
const toolInput = {
name: args?.name || 'requests_post',
description: args?.description || desc,
schema: schema,
baseUrl: '',
method: 'POST',
headers: args?.headers || {}
}
super(toolInput)
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
this.bodySchema = args?.bodySchema
}
/** @ignore */
async _call(input: string) {
async _call(arg: any): Promise<string> {
const params = { ...arg }
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
const inputUrl = this.url
if (!inputUrl) {
throw new Error('URL is required for POST request')
}
if (process.env.DEBUG === 'true') console.info(`Making POST API call to ${inputUrl} with body ${JSON.stringify(inputBody)}`)
let inputBody = {
...this.body
}
if (this.bodySchema && params.body && Object.keys(params.body).length > 0) {
inputBody = {
...inputBody,
...params.body
}
}
const requestHeaders = {
'Content-Type': 'application/json',
...(params.headers || {}),
...this.headers
}
const res = await fetch(inputUrl, {
method: 'POST',
headers: this.headers,
headers: requestHeaders,
body: JSON.stringify(inputBody)
})
if (!res.ok) {
throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)
}
const text = await res.text()
return text.slice(0, this.maxOutputLength)
} catch (error) {
return `${error}`
throw new Error(`Failed to make POST request: ${error instanceof Error ? error.message : 'Unknown error'}`)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -1,7 +0,0 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 27V20H6.5C7.60457 20 8.5 20.8954 8.5 22C8.5 23.1046 7.60457 24 6.5 24H4" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M27 27V20M25 20H29" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M22.5644 20.4399C21.6769 19.7608 19 19.6332 19 21.7961C19 24.1915 23 22.5657 23 25.0902C23 26.9875 20.33 27.5912 19 26.3537" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11 23.5C11 20.7 12.6667 20 13.5 20C14.3333 20 16 20.7 16 23.5C16 26.3 14.3333 27 13.5 27C12.6667 27 11 26.3 11 23.5Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M19.1112 15.2076L17.482 13.3556C15.4506 14.3228 13.0464 14.0464 11.477 12.477C10.1962 11.1962 9.77656 9.35939 10.1913 7.62299C10.3492 6.9619 11.1601 6.82676 11.6407 7.30737L13.5196 9.18628C14.1962 9.86283 15.3416 9.81433 16.078 9.07795C16.8143 8.34157 16.8628 7.19616 16.1863 6.51961L14.3074 4.64071C13.8268 4.16009 13.9619 3.34916 14.623 3.19127C16.3594 2.77656 18.1962 3.19622 19.477 4.477C21.0464 6.04639 21.3228 8.45065 20.3556 10.482L22.2076 12.1112" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,155 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, stripHTMLFromToolInput } from '../../../src/utils'
import { RequestParameters, desc, RequestsPutTool } from './core'
const codeExample = `{
"name": {
"type": "string",
"required": true,
"description": "Name of the item"
},
"date": {
"type": "string",
"description": "Date of the item"
}
}`
class RequestsPut_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 Put'
this.name = 'requestsPut'
this.version = 1.0
this.type = 'RequestsPut'
this.icon = 'put.png'
this.category = 'Tools'
this.description = 'Execute HTTP PUT requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsPutTool)]
this.inputs = [
{
label: 'URL',
name: 'requestsPutUrl',
type: 'string',
acceptVariable: true
},
{
label: 'Name',
name: 'requestsPutName',
type: 'string',
default: 'requests_put',
description: 'Name of the tool',
additionalParams: true,
optional: true
},
{
label: 'Description',
name: 'requestsPutDescription',
type: 'string',
rows: 4,
default: desc,
description: 'Describe to LLM when it should use this tool',
additionalParams: true,
optional: true
},
{
label: 'Headers',
name: 'requestsPutHeaders',
type: 'string',
rows: 4,
acceptVariable: true,
additionalParams: true,
optional: true,
placeholder: `{
"Authorization": "Bearer <token>"
}`
},
{
label: 'Body',
name: 'requestPutBody',
type: 'string',
rows: 4,
description: 'JSON body for the PUT request. This will override the body generated by the LLM',
additionalParams: true,
acceptVariable: true,
optional: true,
placeholder: `{
"name": "John Doe",
"age": 30
}`
},
{
label: 'Body Schema',
name: 'requestsPutBodySchema',
type: 'code',
description: 'Description of the available body params to enable LLM to figure out which body params to use',
placeholder: `{
"name": {
"type": "string",
"required": true,
"description": "Name of the item"
},
"date": {
"type": "string",
"description": "Date of the item"
}
}`,
optional: true,
hideCodeExecute: true,
additionalParams: true,
codeExample: codeExample
},
{
label: 'Max Output Length',
name: 'requestsPutMaxOutputLength',
type: 'number',
description: 'Max length of the output. Remove this if you want to return the entire response',
default: '2000',
step: 1,
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
const headers = (nodeData.inputs?.headers as string) || (nodeData.inputs?.requestsPutHeaders as string)
const url = (nodeData.inputs?.url as string) || (nodeData.inputs?.requestsPutUrl as string)
const name = (nodeData.inputs?.name as string) || (nodeData.inputs?.requestsPutName as string)
const description = (nodeData.inputs?.description as string) || (nodeData.inputs?.requestsPutDescription as string)
const body = (nodeData.inputs?.body as string) || (nodeData.inputs?.requestPutBody as string)
const bodySchema = nodeData.inputs?.requestsPutBodySchema as string
const maxOutputLength = (nodeData.inputs?.maxOutputLength as string) || (nodeData.inputs?.requestsPutMaxOutputLength as string)
const obj: RequestParameters = {}
if (url) obj.url = stripHTMLFromToolInput(url)
if (description) obj.description = description
if (name)
obj.name = name
.toLowerCase()
.replace(/ /g, '_')
.replace(/[^a-z0-9_-]/g, '')
if (bodySchema) obj.bodySchema = stripHTMLFromToolInput(bodySchema)
if (maxOutputLength) obj.maxOutputLength = parseInt(maxOutputLength, 10)
if (headers) {
const parsedHeaders = typeof headers === 'object' ? headers : JSON.parse(stripHTMLFromToolInput(headers))
obj.headers = parsedHeaders
}
if (body) {
const parsedBody = typeof body === 'object' ? body : JSON.parse(body)
obj.body = parsedBody
}
return new RequestsPutTool(obj)
}
}
module.exports = { nodeClass: RequestsPut_Tools }
@@ -0,0 +1,145 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
export const desc = `Use this when you want to execute a PUT request to update or replace a resource.`
export interface Headers {
[key: string]: string
}
export interface Body {
[key: string]: any
}
export interface RequestParameters {
headers?: Headers
body?: Body
url?: string
description?: string
name?: string
bodySchema?: string
maxOutputLength?: number
}
// Base schema for PUT request
const createRequestsPutSchema = (bodySchema?: string) => {
// If bodySchema is provided, parse it and add dynamic body params
if (bodySchema) {
try {
const parsedSchema = JSON.parse(bodySchema)
const bodyParamsObject: Record<string, z.ZodTypeAny> = {}
Object.entries(parsedSchema).forEach(([key, config]: [string, any]) => {
let zodType: z.ZodTypeAny = z.string()
// Handle different types
if (config.type === 'number') {
zodType = z.number()
} else if (config.type === 'boolean') {
zodType = z.boolean()
} else if (config.type === 'object') {
zodType = z.record(z.any())
} else if (config.type === 'array') {
zodType = z.array(z.any())
}
// Add description
if (config.description) {
zodType = zodType.describe(config.description)
}
// Make optional if not required
if (!config.required) {
zodType = zodType.optional()
}
bodyParamsObject[key] = zodType
})
if (Object.keys(bodyParamsObject).length > 0) {
return z.object({
body: z.object(bodyParamsObject).describe('Request body parameters')
})
}
} catch (error) {
console.warn('Failed to parse bodySchema:', error)
}
}
// Fallback to generic body
return z.object({
body: z.record(z.any()).optional().describe('Optional body data to include in the request')
})
}
export class RequestsPutTool extends DynamicStructuredTool {
url = ''
maxOutputLength = Infinity
headers = {}
body = {}
bodySchema?: string
constructor(args?: RequestParameters) {
const schema = createRequestsPutSchema(args?.bodySchema)
const toolInput = {
name: args?.name || 'requests_put',
description: args?.description || desc,
schema: schema,
baseUrl: '',
method: 'PUT',
headers: args?.headers || {}
}
super(toolInput)
this.url = args?.url ?? this.url
this.headers = args?.headers ?? this.headers
this.body = args?.body ?? this.body
this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength
this.bodySchema = args?.bodySchema
}
/** @ignore */
async _call(arg: any): Promise<string> {
const params = { ...arg }
try {
const inputUrl = this.url
if (!inputUrl) {
throw new Error('URL is required for PUT request')
}
let inputBody = {
...this.body
}
if (this.bodySchema && params.body && Object.keys(params.body).length > 0) {
inputBody = {
...inputBody,
...params.body
}
}
const requestHeaders = {
'Content-Type': 'application/json',
...(params.headers || {}),
...this.headers
}
const res = await fetch(inputUrl, {
method: 'PUT',
headers: requestHeaders,
body: JSON.stringify(inputBody)
})
if (!res.ok) {
throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)
}
const text = await res.text()
return text.slice(0, this.maxOutputLength)
} catch (error) {
throw new Error(`Failed to make PUT request: ${error instanceof Error ? error.message : 'Unknown error'}`)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

+7 -3
View File
@@ -1048,17 +1048,21 @@ export const getS3Config = () => {
const customURL = process.env.S3_ENDPOINT_URL
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true' ? true : false
if (!region || !Bucket) {
if (!region || region.trim() === '' || !Bucket || Bucket.trim() === '') {
throw new Error('S3 storage configuration is missing')
}
const s3Config: S3ClientConfig = {
region: region,
endpoint: customURL,
forcePathStyle: forcePathStyle
}
if (accessKeyId && secretAccessKey) {
// Only include endpoint if customURL is not empty
if (customURL && customURL.trim() !== '') {
s3Config.endpoint = customURL
}
if (accessKeyId && accessKeyId.trim() !== '' && secretAccessKey && secretAccessKey.trim() !== '') {
s3Config.credentials = {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey
+9
View File
@@ -4,6 +4,7 @@ import * as fs from 'fs'
import * as path from 'path'
import { JSDOM } from 'jsdom'
import { z } from 'zod'
import TurndownService from 'turndown'
import { DataSource, Equal } from 'typeorm'
import { ICommonObject, IDatabaseEntity, IFileUpload, IMessage, INodeData, IVariable, MessageContentImageUrl } from './Interface'
import { AES, enc } from 'crypto-js'
@@ -1309,3 +1310,11 @@ export const refreshOAuth2Token = async (
// Token is not expired, return original data
return credentialData
}
export const stripHTMLFromToolInput = (input: string) => {
const turndownService = new TurndownService()
let cleanedInput = turndownService.turndown(input)
// After conversion, replace any escaped underscores with regular underscores
cleanedInput = cleanedInput.replace(/\\_/g, '_')
return cleanedInput
}
@@ -1,6 +1,6 @@
{
"description": "An agent based approach using AgentflowV2 to perform self-correcting question answering over documents",
"usecases": ["Reflective Agent"],
"usecases": ["Reflective Agent", "Documents QnA"],
"nodes": [
{
"id": "startAgentflow_0",
@@ -1,13 +1,13 @@
{
"description": "An agent capable of performing research, synthesizing information, and generating in-depth, well-structured white papers on any given topic",
"usecases": ["Agent"],
"description": "Deep research system that conducts multi-turn agent conversations to perform web search, synthesize insights and generate well-structured white papers",
"usecases": ["Deep Research"],
"nodes": [
{
"id": "startAgentflow_0",
"type": "agentFlow",
"position": {
"x": -275.0799323960054,
"y": 31.301887150099603
"x": -397.64170181617976,
"y": 87.52288229696859
},
"data": {
"id": "startAgentflow_0",
@@ -188,19 +188,19 @@
"selected": false
},
"width": 103,
"height": 65,
"height": 66,
"selected": false,
"positionAbsolute": {
"x": -275.0799323960054,
"y": 31.301887150099603
"x": -397.64170181617976,
"y": 87.52288229696859
},
"dragging": false
},
{
"id": "llmAgentflow_0",
"position": {
"x": -59.13383952997965,
"y": 28.495983624910906
"x": -242.41428370877253,
"y": 85.84139867471725
},
"data": {
"id": "llmAgentflow_0",
@@ -513,19 +513,19 @@
},
"type": "agentFlow",
"width": 175,
"height": 71,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": -59.13383952997965,
"y": 28.495983624910906
"x": -242.41428370877253,
"y": 85.84139867471725
},
"dragging": false
},
{
"id": "agentAgentflow_0",
"position": {
"x": 209.99147630894493,
"y": 100.7933285478893
"x": -26.136703307904796,
"y": 72.89650466398558
},
"data": {
"id": "agentAgentflow_0",
@@ -824,13 +824,6 @@
}
],
"agentTools": [
{
"agentSelectedTool": "braveSearchAPI",
"agentSelectedToolRequiresHumanInput": "",
"agentSelectedToolConfig": {
"agentSelectedTool": "braveSearchAPI"
}
},
{
"agentSelectedTool": "webScraperTool",
"agentSelectedToolRequiresHumanInput": "",
@@ -842,6 +835,13 @@
"description": "",
"agentSelectedTool": "webScraperTool"
}
},
{
"agentSelectedTool": "braveSearchAPI",
"agentSelectedToolRequiresHumanInput": "",
"agentSelectedToolConfig": {
"agentSelectedTool": "braveSearchAPI"
}
}
],
"agentKnowledgeDocumentStores": "",
@@ -879,20 +879,20 @@
"selected": false
},
"type": "agentFlow",
"width": 199,
"height": 103,
"width": 200,
"height": 100,
"selected": false,
"positionAbsolute": {
"x": 209.99147630894493,
"y": 100.7933285478893
"x": -26.136703307904796,
"y": 72.89650466398558
},
"dragging": false
},
{
"id": "agentAgentflow_1",
"position": {
"x": 203.50865583557328,
"y": -75.13070214403373
"x": 210.25517525319754,
"y": 73.29272504370039
},
"data": {
"id": "agentAgentflow_1",
@@ -1191,13 +1191,6 @@
}
],
"agentTools": [
{
"agentSelectedTool": "braveSearchAPI",
"agentSelectedToolRequiresHumanInput": "",
"agentSelectedToolConfig": {
"agentSelectedTool": "braveSearchAPI"
}
},
{
"agentSelectedTool": "webScraperTool",
"agentSelectedToolRequiresHumanInput": "",
@@ -1209,6 +1202,13 @@
"description": "",
"agentSelectedTool": "webScraperTool"
}
},
{
"agentSelectedTool": "braveSearchAPI",
"agentSelectedToolRequiresHumanInput": "",
"agentSelectedToolConfig": {
"agentSelectedTool": "braveSearchAPI"
}
}
],
"agentKnowledgeDocumentStores": "",
@@ -1246,24 +1246,24 @@
"selected": false
},
"type": "agentFlow",
"width": 199,
"height": 103,
"width": 200,
"height": 100,
"selected": false,
"positionAbsolute": {
"x": 203.50865583557328,
"y": -75.13070214403373
"x": 210.25517525319754,
"y": 73.29272504370039
},
"dragging": false
},
{
"id": "conditionAgentflow_0",
"position": {
"x": 497.07879661792845,
"y": 29.068421396935392
"x": 457.0277025649177,
"y": 83.6060813840138
},
"data": {
"id": "conditionAgentflow_0",
"label": "Condition",
"label": "Check Iterations",
"version": 1,
"name": "conditionAgentflow",
"type": "Condition",
@@ -1520,24 +1520,24 @@
"selected": false
},
"type": "agentFlow",
"width": 134,
"width": 178,
"height": 80,
"selected": false,
"positionAbsolute": {
"x": 497.07879661792845,
"y": 29.068421396935392
"x": 457.0277025649177,
"y": 83.6060813840138
},
"dragging": false
},
{
"id": "loopAgentflow_0",
"position": {
"x": 710.6354115635097,
"y": -61.015932400168076
"x": 690.1837890683553,
"y": 22.494859455045713
},
"data": {
"id": "loopAgentflow_0",
"label": "Loop",
"label": "Loop Back to Agent 0",
"version": 1,
"name": "loopAgentflow",
"type": "Loop",
@@ -1575,13 +1575,13 @@
"selected": false
},
"type": "agentFlow",
"width": 104,
"height": 65,
"width": 211,
"height": 66,
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": 710.6354115635097,
"y": -61.015932400168076
"x": 690.1837890683553,
"y": 22.494859455045713
}
},
{
@@ -1900,8 +1900,8 @@
"selected": false
},
"type": "agentFlow",
"width": 199,
"height": 71,
"width": 200,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 693.0529196789191,
@@ -1912,8 +1912,8 @@
{
"id": "stickyNoteAgentflow_0",
"position": {
"x": -320.62033146052283,
"y": -110.15285265313359
"x": -445.43094068657194,
"y": -61.80279682682627
},
"data": {
"id": "stickyNoteAgentflow_0",
@@ -1952,20 +1952,20 @@
"selected": false
},
"type": "stickyNote",
"width": 203,
"height": 122,
"width": 210,
"height": 123,
"selected": false,
"positionAbsolute": {
"x": -320.62033146052283,
"y": -110.15285265313359
"x": -445.43094068657194,
"y": -61.80279682682627
},
"dragging": false
},
{
"id": "stickyNoteAgentflow_1",
"position": {
"x": 466.8306744858025,
"y": -189.9009582021492
"x": 454.90056136362915,
"y": -146.44126039994615
},
"data": {
"id": "stickyNoteAgentflow_1",
@@ -2004,12 +2004,12 @@
"selected": false
},
"type": "stickyNote",
"width": 203,
"height": 202,
"width": 210,
"height": 203,
"selected": false,
"positionAbsolute": {
"x": 466.8306744858025,
"y": -189.9009582021492
"x": 454.90056136362915,
"y": -146.44126039994615
},
"dragging": false
},
@@ -2056,8 +2056,8 @@
"selected": false
},
"type": "stickyNote",
"width": 203,
"height": 283,
"width": 210,
"height": 263,
"selected": false,
"positionAbsolute": {
"x": 693.7511120802441,
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,13 +1,13 @@
{
"description": "An email reply HITL (human in the loop) agent that can proceed or refine the email with user input",
"usecases": ["Human In Loop"],
"description": "A basic RAG agent that can retrieve documents from document store and answer questions",
"usecases": ["Documents QnA"],
"nodes": [
{
"id": "startAgentflow_0",
"type": "agentFlow",
"position": {
"x": -212.0817769699585,
"y": 95.2304753249555
"x": 64,
"y": 98.5
},
"data": {
"id": "startAgentflow_0",
@@ -133,7 +133,9 @@
"name": "startEphemeralMemory",
"type": "boolean",
"description": "Start fresh for every execution without past chat history",
"optional": true
"optional": true,
"id": "startAgentflow_0-input-startEphemeralMemory-boolean",
"display": true
},
{
"label": "Flow State",
@@ -152,7 +154,8 @@
"label": "Value",
"name": "value",
"type": "string",
"placeholder": "Bar"
"placeholder": "Bar",
"optional": true
}
],
"id": "startAgentflow_0-input-startState-array",
@@ -174,7 +177,9 @@
"formTitle": "",
"formDescription": "",
"formInputTypes": "",
"startState": ""
"startEphemeralMemory": "",
"startState": "",
"startPersistState": ""
},
"outputAnchors": [
{
@@ -186,24 +191,24 @@
"outputs": {},
"selected": false
},
"width": 101,
"height": 65,
"selected": false,
"width": 103,
"height": 66,
"positionAbsolute": {
"x": -212.0817769699585,
"y": 95.2304753249555
"x": 64,
"y": 98.5
},
"selected": false,
"dragging": false
},
{
"id": "agentAgentflow_0",
"position": {
"x": -62.25,
"y": 76
"x": 216.75,
"y": 96.5
},
"data": {
"id": "agentAgentflow_0",
"label": "Email Reply Agent",
"label": "QnA",
"version": 1,
"name": "agentAgentflow",
"type": "Agent",
@@ -494,24 +499,18 @@
"agentMessages": [
{
"role": "system",
"content": "<p>You are a customer support agent working in Flowise Inc. Write a professional email reply to user's query. Use the web search tools to get more details about the prospect.</p>"
"content": "<p>You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.</p><p>If there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.</p>"
}
],
"agentTools": [
"agentTools": "",
"agentKnowledgeDocumentStores": [
{
"agentSelectedTool": "googleCustomSearch",
"agentSelectedToolConfig": {
"agentSelectedTool": "googleCustomSearch"
}
},
{
"agentSelectedTool": "currentDateTime",
"agentSelectedToolConfig": {
"agentSelectedTool": "currentDateTime"
}
"documentStore": "25429b8f-0377-4762-9cda-0d5366cf022c:AI-Paper",
"docStoreDescription": "This paper provides an extensive overview of artificial intelligence-generated content (AIGC), including its definition, capabilities, applications, challenges, and future directions, serving as a valuable resource for researchers and industry professionals to understand and harness AIGC's potential.",
"returnSourceDocuments": true
}
],
"agentKnowledgeDocumentStores": "",
"agentKnowledgeVSEmbeddings": "",
"agentEnableMemory": true,
"agentMemoryType": "allMessages",
"agentUserMessage": "",
@@ -549,250 +548,64 @@
"selected": false
},
"type": "agentFlow",
"width": 182,
"height": 103,
"width": 175,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": -62.25,
"y": 76
"x": 216.75,
"y": 96.5
},
"dragging": false
},
{
"id": "humanInputAgentflow_0",
"id": "stickyNoteAgentflow_0",
"position": {
"x": 156.05666363734434,
"y": 86.62266545493773
"x": 209.875,
"y": -61.25
},
"data": {
"id": "humanInputAgentflow_0",
"label": "Human Input 0",
"id": "stickyNoteAgentflow_0",
"label": "Sticky Note",
"version": 1,
"name": "humanInputAgentflow",
"type": "HumanInput",
"color": "#6E6EFD",
"baseClasses": ["HumanInput"],
"name": "stickyNoteAgentflow",
"type": "StickyNote",
"color": "#fee440",
"baseClasses": ["StickyNote"],
"category": "Agent Flows",
"description": "Request human input, approval or rejection during execution",
"description": "Add notes to the agent flow",
"inputParams": [
{
"label": "Description Type",
"name": "humanInputDescriptionType",
"type": "options",
"options": [
{
"label": "Fixed",
"name": "fixed",
"description": "Specify a fixed description"
},
{
"label": "Dynamic",
"name": "dynamic",
"description": "Use LLM to generate a description"
}
],
"id": "humanInputAgentflow_0-input-humanInputDescriptionType-options",
"display": true
},
{
"label": "Description",
"name": "humanInputDescription",
"label": "",
"name": "note",
"type": "string",
"placeholder": "Are you sure you want to proceed?",
"acceptVariable": true,
"rows": 4,
"show": {
"humanInputDescriptionType": "fixed"
},
"id": "humanInputAgentflow_0-input-humanInputDescription-string",
"display": true
},
{
"label": "Model",
"name": "humanInputModel",
"type": "asyncOptions",
"loadMethod": "listModels",
"loadConfig": true,
"show": {
"humanInputDescriptionType": "dynamic"
},
"id": "humanInputAgentflow_0-input-humanInputModel-asyncOptions",
"display": false
},
{
"label": "Prompt",
"name": "humanInputModelPrompt",
"type": "string",
"default": "<p>Summarize the conversation between the user and the assistant, reiterate the last message from the assistant, and ask if user would like to proceed or if they have any feedback. </p>\n<ul>\n<li>Begin by capturing the key points of the conversation, ensuring that you reflect the main ideas and themes discussed.</li>\n<li>Then, clearly reproduce the last message sent by the assistant to maintain continuity. Make sure the whole message is reproduced.</li>\n<li>Finally, ask the user if they would like to proceed, or provide any feedback on the last assistant message</li>\n</ul>\n<h2 id=\"output-format-the-output-should-be-structured-in-three-parts-\">Output Format The output should be structured in three parts in text:</h2>\n<ul>\n<li>A summary of the conversation (1-3 sentences).</li>\n<li>The last assistant message (exactly as it appeared).</li>\n<li>Ask the user if they would like to proceed, or provide any feedback on last assistant message. No other explanation and elaboration is needed.</li>\n</ul>\n",
"acceptVariable": true,
"generateInstruction": true,
"rows": 4,
"show": {
"humanInputDescriptionType": "dynamic"
},
"id": "humanInputAgentflow_0-input-humanInputModelPrompt-string",
"display": false
},
{
"label": "Enable Feedback",
"name": "humanInputEnableFeedback",
"type": "boolean",
"default": true,
"id": "humanInputAgentflow_0-input-humanInputEnableFeedback-boolean",
"rows": 1,
"placeholder": "Type something here",
"optional": true,
"id": "stickyNoteAgentflow_0-input-note-string",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"humanInputDescriptionType": "fixed",
"humanInputEnableFeedback": true,
"humanInputModelConfig": {
"cache": "",
"modelName": "gpt-4o-mini",
"temperature": 0.9,
"streaming": true,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"strictToolCalling": "",
"stopSequence": "",
"basepath": "",
"proxyUrl": "",
"baseOptions": "",
"allowImageUploads": "",
"imageResolution": "low",
"reasoningEffort": "medium",
"humanInputModel": "chatOpenAI"
},
"humanInputDescription": "<p>Are you sure you want to proceed?</p>"
"note": "Agent can retrieve documents from upserted document store, and directly from vector database"
},
"outputAnchors": [
{
"id": "humanInputAgentflow_0-output-0",
"label": "Human Input",
"name": "humanInputAgentflow"
},
{
"id": "humanInputAgentflow_0-output-1",
"label": "Human Input",
"name": "humanInputAgentflow"
"id": "stickyNoteAgentflow_0-output-stickyNoteAgentflow",
"label": "Sticky Note",
"name": "stickyNoteAgentflow"
}
],
"outputs": {
"humanInputAgentflow": ""
},
"selected": false
},
"type": "agentFlow",
"width": 161,
"height": 80,
"selected": false,
"positionAbsolute": {
"x": 156.05666363734434,
"y": 86.62266545493773
},
"dragging": false
},
{
"id": "directReplyAgentflow_0",
"position": {
"x": 363.0101864947954,
"y": 35.15053748988734
},
"data": {
"id": "directReplyAgentflow_0",
"label": "Direct Reply 0",
"version": 1,
"name": "directReplyAgentflow",
"type": "DirectReply",
"color": "#4DDBBB",
"hideOutput": true,
"baseClasses": ["DirectReply"],
"category": "Agent Flows",
"description": "Directly reply to the user with a message",
"inputParams": [
{
"label": "Message",
"name": "directReplyMessage",
"type": "string",
"rows": 4,
"acceptVariable": true,
"id": "directReplyAgentflow_0-input-directReplyMessage-string",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"directReplyMessage": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"agentAgentflow_0\" data-label=\"agentAgentflow_0\">{{ agentAgentflow_0 }}</span> </p>"
},
"outputAnchors": [],
"outputs": {},
"selected": false
},
"type": "agentFlow",
"width": 155,
"height": 65,
"type": "stickyNote",
"width": 210,
"height": 143,
"selected": false,
"positionAbsolute": {
"x": 363.0101864947954,
"y": 35.15053748988734
},
"dragging": false
},
{
"id": "loopAgentflow_0",
"position": {
"x": 366.5975521223236,
"y": 130.12266545493773
},
"data": {
"id": "loopAgentflow_0",
"label": "Loop 0",
"version": 1,
"name": "loopAgentflow",
"type": "Loop",
"color": "#FFA07A",
"hideOutput": true,
"baseClasses": ["Loop"],
"category": "Agent Flows",
"description": "Loop back to a previous node",
"inputParams": [
{
"label": "Loop Back To",
"name": "loopBackToNode",
"type": "asyncOptions",
"loadMethod": "listPreviousNodes",
"freeSolo": true,
"id": "loopAgentflow_0-input-loopBackToNode-asyncOptions",
"display": true
},
{
"label": "Max Loop Count",
"name": "maxLoopCount",
"type": "number",
"default": 5,
"id": "loopAgentflow_0-input-maxLoopCount-number",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"loopBackToNode": "agentAgentflow_0-Email Reply Agent",
"maxLoopCount": 5
},
"outputAnchors": [],
"outputs": {},
"selected": false
},
"type": "agentFlow",
"width": 113,
"height": 65,
"selected": false,
"positionAbsolute": {
"x": 366.5975521223236,
"y": 130.12266545493773
"x": 209.875,
"y": -61.25
},
"dragging": false
}
@@ -810,47 +623,6 @@
},
"type": "agentFlow",
"id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0"
},
{
"source": "agentAgentflow_0",
"sourceHandle": "agentAgentflow_0-output-agentAgentflow",
"target": "humanInputAgentflow_0",
"targetHandle": "humanInputAgentflow_0",
"data": {
"sourceColor": "#4DD0E1",
"targetColor": "#6E6EFD",
"isHumanInput": false
},
"type": "agentFlow",
"id": "agentAgentflow_0-agentAgentflow_0-output-agentAgentflow-humanInputAgentflow_0-humanInputAgentflow_0"
},
{
"source": "humanInputAgentflow_0",
"sourceHandle": "humanInputAgentflow_0-output-0",
"target": "directReplyAgentflow_0",
"targetHandle": "directReplyAgentflow_0",
"data": {
"sourceColor": "#6E6EFD",
"targetColor": "#4DDBBB",
"edgeLabel": "proceed",
"isHumanInput": true
},
"type": "agentFlow",
"id": "humanInputAgentflow_0-humanInputAgentflow_0-output-0-directReplyAgentflow_0-directReplyAgentflow_0"
},
{
"source": "humanInputAgentflow_0",
"sourceHandle": "humanInputAgentflow_0-output-1",
"target": "loopAgentflow_0",
"targetHandle": "loopAgentflow_0",
"data": {
"sourceColor": "#6E6EFD",
"targetColor": "#FFA07A",
"edgeLabel": "reject",
"isHumanInput": true
},
"type": "agentFlow",
"id": "humanInputAgentflow_0-humanInputAgentflow_0-output-1-loopAgentflow_0-loopAgentflow_0"
}
]
}
@@ -0,0 +1,549 @@
{
"description": "Return structured output from LLM",
"usecases": ["Extraction"],
"nodes": [
{
"id": "startAgentflow_0",
"type": "agentFlow",
"position": {
"x": 64,
"y": 98.5
},
"data": {
"id": "startAgentflow_0",
"label": "Start",
"version": 1.1,
"name": "startAgentflow",
"type": "Start",
"color": "#7EE787",
"hideInput": true,
"baseClasses": ["Start"],
"category": "Agent Flows",
"description": "Starting point of the agentflow",
"inputParams": [
{
"label": "Input Type",
"name": "startInputType",
"type": "options",
"options": [
{
"label": "Chat Input",
"name": "chatInput",
"description": "Start the conversation with chat input"
},
{
"label": "Form Input",
"name": "formInput",
"description": "Start the workflow with form inputs"
}
],
"default": "chatInput",
"id": "startAgentflow_0-input-startInputType-options",
"display": true
},
{
"label": "Form Title",
"name": "formTitle",
"type": "string",
"placeholder": "Please Fill Out The Form",
"show": {
"startInputType": "formInput"
},
"id": "startAgentflow_0-input-formTitle-string",
"display": false
},
{
"label": "Form Description",
"name": "formDescription",
"type": "string",
"placeholder": "Complete all fields below to continue",
"show": {
"startInputType": "formInput"
},
"id": "startAgentflow_0-input-formDescription-string",
"display": false
},
{
"label": "Form Input Types",
"name": "formInputTypes",
"description": "Specify the type of form input",
"type": "array",
"show": {
"startInputType": "formInput"
},
"array": [
{
"label": "Type",
"name": "type",
"type": "options",
"options": [
{
"label": "String",
"name": "string"
},
{
"label": "Number",
"name": "number"
},
{
"label": "Boolean",
"name": "boolean"
},
{
"label": "Options",
"name": "options"
}
],
"default": "string"
},
{
"label": "Label",
"name": "label",
"type": "string",
"placeholder": "Label for the input"
},
{
"label": "Variable Name",
"name": "name",
"type": "string",
"placeholder": "Variable name for the input (must be camel case)",
"description": "Variable name must be camel case. For example: firstName, lastName, etc."
},
{
"label": "Add Options",
"name": "addOptions",
"type": "array",
"show": {
"formInputTypes[$index].type": "options"
},
"array": [
{
"label": "Option",
"name": "option",
"type": "string"
}
]
}
],
"id": "startAgentflow_0-input-formInputTypes-array",
"display": false
},
{
"label": "Ephemeral Memory",
"name": "startEphemeralMemory",
"type": "boolean",
"description": "Start fresh for every execution without past chat history",
"optional": true,
"id": "startAgentflow_0-input-startEphemeralMemory-boolean",
"display": true
},
{
"label": "Flow State",
"name": "startState",
"description": "Runtime state during the execution of the workflow",
"type": "array",
"optional": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "string",
"placeholder": "Foo"
},
{
"label": "Value",
"name": "value",
"type": "string",
"placeholder": "Bar",
"optional": true
}
],
"id": "startAgentflow_0-input-startState-array",
"display": true
},
{
"label": "Persist State",
"name": "startPersistState",
"type": "boolean",
"description": "Persist the state in the same session",
"optional": true,
"id": "startAgentflow_0-input-startPersistState-boolean",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"startInputType": "chatInput",
"formTitle": "",
"formDescription": "",
"formInputTypes": "",
"startEphemeralMemory": "",
"startState": "",
"startPersistState": ""
},
"outputAnchors": [
{
"id": "startAgentflow_0-output-startAgentflow",
"label": "Start",
"name": "startAgentflow"
}
],
"outputs": {},
"selected": false
},
"width": 103,
"height": 66,
"positionAbsolute": {
"x": 64,
"y": 98.5
},
"selected": false,
"dragging": false
},
{
"id": "llmAgentflow_0",
"position": {
"x": 234.5,
"y": 95.75
},
"data": {
"id": "llmAgentflow_0",
"label": "Strutured Output",
"version": 1,
"name": "llmAgentflow",
"type": "LLM",
"color": "#64B5F6",
"baseClasses": ["LLM"],
"category": "Agent Flows",
"description": "Large language models to analyze user-provided inputs and generate responses",
"inputParams": [
{
"label": "Model",
"name": "llmModel",
"type": "asyncOptions",
"loadMethod": "listModels",
"loadConfig": true,
"id": "llmAgentflow_0-input-llmModel-asyncOptions",
"display": true
},
{
"label": "Messages",
"name": "llmMessages",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Role",
"name": "role",
"type": "options",
"options": [
{
"label": "System",
"name": "system"
},
{
"label": "Assistant",
"name": "assistant"
},
{
"label": "Developer",
"name": "developer"
},
{
"label": "User",
"name": "user"
}
]
},
{
"label": "Content",
"name": "content",
"type": "string",
"acceptVariable": true,
"generateInstruction": true,
"rows": 4
}
],
"id": "llmAgentflow_0-input-llmMessages-array",
"display": true
},
{
"label": "Enable Memory",
"name": "llmEnableMemory",
"type": "boolean",
"description": "Enable memory for the conversation thread",
"default": true,
"optional": true,
"id": "llmAgentflow_0-input-llmEnableMemory-boolean",
"display": true
},
{
"label": "Memory Type",
"name": "llmMemoryType",
"type": "options",
"options": [
{
"label": "All Messages",
"name": "allMessages",
"description": "Retrieve all messages from the conversation"
},
{
"label": "Window Size",
"name": "windowSize",
"description": "Uses a fixed window size to surface the last N messages"
},
{
"label": "Conversation Summary",
"name": "conversationSummary",
"description": "Summarizes the whole conversation"
},
{
"label": "Conversation Summary Buffer",
"name": "conversationSummaryBuffer",
"description": "Summarize conversations once token limit is reached. Default to 2000"
}
],
"optional": true,
"default": "allMessages",
"show": {
"llmEnableMemory": true
},
"id": "llmAgentflow_0-input-llmMemoryType-options",
"display": false
},
{
"label": "Window Size",
"name": "llmMemoryWindowSize",
"type": "number",
"default": "20",
"description": "Uses a fixed window size to surface the last N messages",
"show": {
"llmMemoryType": "windowSize"
},
"id": "llmAgentflow_0-input-llmMemoryWindowSize-number",
"display": false
},
{
"label": "Max Token Limit",
"name": "llmMemoryMaxTokenLimit",
"type": "number",
"default": "2000",
"description": "Summarize conversations once token limit is reached. Default to 2000",
"show": {
"llmMemoryType": "conversationSummaryBuffer"
},
"id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number",
"display": false
},
{
"label": "Input Message",
"name": "llmUserMessage",
"type": "string",
"description": "Add an input message as user message at the end of the conversation",
"rows": 4,
"optional": true,
"acceptVariable": true,
"show": {
"llmEnableMemory": true
},
"id": "llmAgentflow_0-input-llmUserMessage-string",
"display": false
},
{
"label": "Return Response As",
"name": "llmReturnResponseAs",
"type": "options",
"options": [
{
"label": "User Message",
"name": "userMessage"
},
{
"label": "Assistant Message",
"name": "assistantMessage"
}
],
"default": "userMessage",
"id": "llmAgentflow_0-input-llmReturnResponseAs-options",
"display": true
},
{
"label": "JSON Structured Output",
"name": "llmStructuredOutput",
"description": "Instruct the LLM to give output in a JSON structured schema",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "string"
},
{
"label": "Type",
"name": "type",
"type": "options",
"options": [
{
"label": "String",
"name": "string"
},
{
"label": "String Array",
"name": "stringArray"
},
{
"label": "Number",
"name": "number"
},
{
"label": "Boolean",
"name": "boolean"
},
{
"label": "Enum",
"name": "enum"
},
{
"label": "JSON Array",
"name": "jsonArray"
}
]
},
{
"label": "Enum Values",
"name": "enumValues",
"type": "string",
"placeholder": "value1, value2, value3",
"description": "Enum values. Separated by comma",
"optional": true,
"show": {
"llmStructuredOutput[$index].type": "enum"
}
},
{
"label": "JSON Schema",
"name": "jsonSchema",
"type": "code",
"placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}",
"description": "JSON schema for the structured output",
"optional": true,
"show": {
"llmStructuredOutput[$index].type": "jsonArray"
}
},
{
"label": "Description",
"name": "description",
"type": "string",
"placeholder": "Description of the key"
}
],
"id": "llmAgentflow_0-input-llmStructuredOutput-array",
"display": true
},
{
"label": "Update Flow State",
"name": "llmUpdateState",
"description": "Update runtime state during the execution of the workflow",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "asyncOptions",
"loadMethod": "listRuntimeStateKeys",
"freeSolo": true
},
{
"label": "Value",
"name": "value",
"type": "string",
"acceptVariable": true,
"acceptNodeOutputAsVariable": true
}
],
"id": "llmAgentflow_0-input-llmUpdateState-array",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"llmModel": "chatAnthropic",
"llmMessages": [
{
"role": "system",
"content": "<p>Given user query, return result only in JSON format, without exception.</p><p>When asked to self-correct, output only the corrected JSON and no other text.</p>"
},
{
"role": "user",
"content": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"question\" data-label=\"question\">{{ question }}</span> </p>"
}
],
"llmEnableMemory": false,
"llmReturnResponseAs": "userMessage",
"llmStructuredOutput": [
{
"key": "output",
"type": "jsonArray",
"enumValues": "",
"jsonSchema": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n }\n}",
"description": "answer and its reason to the question"
}
],
"llmUpdateState": "",
"llmModelConfig": {
"credential": "",
"modelName": "claude-sonnet-4-0",
"temperature": 0.9,
"streaming": true,
"maxTokensToSample": "",
"topP": "",
"topK": "",
"extendedThinking": "",
"budgetTokens": 1024,
"allowImageUploads": "",
"llmModel": "chatAnthropic"
}
},
"outputAnchors": [
{
"id": "llmAgentflow_0-output-llmAgentflow",
"label": "LLM",
"name": "llmAgentflow"
}
],
"outputs": {},
"selected": false
},
"type": "agentFlow",
"width": 213,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 234.5,
"y": 95.75
},
"dragging": false
}
],
"edges": [
{
"source": "startAgentflow_0",
"sourceHandle": "startAgentflow_0-output-startAgentflow",
"target": "llmAgentflow_0",
"targetHandle": "llmAgentflow_0",
"data": {
"sourceColor": "#7EE787",
"targetColor": "#64B5F6",
"isHumanInput": false
},
"type": "agentFlow",
"id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0"
}
]
}
@@ -6,8 +6,8 @@
"id": "startAgentflow_0",
"type": "agentFlow",
"position": {
"x": -234.25083179589828,
"y": 89.8928676312403
"x": -198.4357561998925,
"y": 90.62378754136287
},
"data": {
"id": "startAgentflow_0",
@@ -195,12 +195,12 @@
"outputs": {},
"selected": false
},
"width": 101,
"height": 65,
"width": 103,
"height": 66,
"selected": false,
"positionAbsolute": {
"x": -234.25083179589828,
"y": 89.8928676312403
"x": -198.4357561998925,
"y": 90.62378754136287
},
"dragging": false
},
@@ -483,7 +483,7 @@
"selected": false
},
"type": "agentFlow",
"width": 184,
"width": 194,
"height": 100,
"selected": false,
"positionAbsolute": {
@@ -787,11 +787,11 @@
],
"inputAnchors": [],
"inputs": {
"agentModel": "azureChatOpenAI",
"agentModel": "chatOpenAI",
"agentMessages": [
{
"role": "system",
"content": "<p>As a Senior Software Engineer, 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.</p><p>Your goal is to lead the development of high-quality software solutions.</p><p>Utilize 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.</p><p>Design 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.</p><p>The 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.</p>"
"content": "<p>As a Senior Software Engineer, 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.</p><p>Your goal is to lead the development of high-quality software solutions.</p><p>Utilize 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.</p><p>Design and implement new feature for the given task, ensuring it integrates seamlessly with existing systems and meets performance requirements. Use your understanding of React, Tailwindcss, NodeJS to build this feature. Make sure to adhere to our coding standards and follow best practices.</p><p>The output should be a fully functional, well-documented feature that enhances our product's capabilities. Include detailed comments in the code.</p>"
}
],
"agentTools": "",
@@ -803,20 +803,23 @@
"agentUpdateState": "",
"agentModelConfig": {
"credential": "",
"modelName": "gpt-4.1",
"modelName": "gpt-4o-mini",
"temperature": 0.9,
"maxTokens": "",
"streaming": true,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"strictToolCalling": "",
"stopSequence": "",
"basepath": "",
"proxyUrl": "",
"baseOptions": "",
"allowImageUploads": "",
"imageResolution": "low",
"reasoningEffort": "medium",
"agentModel": "azureChatOpenAI"
"agentModel": "chatOpenAI"
}
},
"outputAnchors": [
@@ -830,8 +833,8 @@
"selected": false
},
"type": "agentFlow",
"width": 183,
"height": 71,
"width": 191,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 352.5679347768288,
@@ -842,8 +845,8 @@
{
"id": "agentAgentflow_2",
"position": {
"x": 358.5981605238689,
"y": 87.38558154725587
"x": 359.32908043399146,
"y": 88.11650145737843
},
"data": {
"id": "agentAgentflow_2",
@@ -1134,11 +1137,11 @@
],
"inputAnchors": [],
"inputs": {
"agentModel": "chatDeepseek",
"agentModel": "chatOpenAI",
"agentMessages": [
{
"role": "system",
"content": "<p>As a Quality Assurance Engineer, 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.</p><p>Your goal is to ensure the delivery of high-quality software through thorough code review and testing.</p><p>Review 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.</p><p>With 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.</p><p>Always pass back the review and feedback to Senior Software Engineer.</p>"
"content": "<p>As a Quality Assurance Engineer, 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.</p><p>Your goal is to ensure the delivery of high-quality software through thorough code review and testing.</p><p>Review 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.</p><p>With 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.</p>"
}
],
"agentTools": "",
@@ -1150,17 +1153,23 @@
"agentUpdateState": "",
"agentModelConfig": {
"credential": "",
"modelName": "deepseek-reasoner",
"temperature": 0.7,
"modelName": "gpt-4o-mini",
"temperature": 0.9,
"streaming": true,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"strictToolCalling": "",
"stopSequence": "",
"basepath": "",
"proxyUrl": "",
"baseOptions": "",
"agentModel": "chatDeepseek"
"allowImageUploads": "",
"imageResolution": "low",
"reasoningEffort": "medium",
"agentModel": "chatOpenAI"
}
},
"outputAnchors": [
@@ -1174,12 +1183,12 @@
"selected": false
},
"type": "agentFlow",
"width": 206,
"height": 71,
"width": 175,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 358.5981605238689,
"y": 87.38558154725587
"x": 359.32908043399146,
"y": 88.11650145737843
},
"dragging": false
},
@@ -1478,27 +1487,29 @@
],
"inputAnchors": [],
"inputs": {
"agentModel": "chatAnthropic",
"agentModel": "chatGoogleGenerativeAI",
"agentMessages": "",
"agentTools": "",
"agentKnowledgeDocumentStores": "",
"agentEnableMemory": true,
"agentMemoryType": "allMessages",
"agentUserMessage": "<p>Given the above conversations, generate a detail solution developed by the software engineer and code reviewer. Include full code, improvements and review.</p>",
"agentUserMessage": "<p>Given the above conversations, generate a detail solution developed by the software engineer and code reviewer. </p><p>Your guiding principles:</p><ol><li><p><strong>Preserve Full Context</strong><br>Include all code implementations, improvements and review from the conversation. Do not omit, summarize, or oversimplify key information.</p></li><li><p><strong>Markdown Output Only</strong><br>Your final output must be in Markdown format.</p></li></ol>",
"agentReturnResponseAs": "userMessage",
"agentUpdateState": "",
"agentModelConfig": {
"credential": "",
"modelName": "claude-3-7-sonnet-latest",
"modelName": "gemini-2.5-flash-preview-05-20",
"customModelName": "",
"temperature": 0.9,
"streaming": true,
"maxTokensToSample": "",
"maxOutputTokens": "",
"topP": "",
"topK": "",
"extendedThinking": "",
"budgetTokens": 1024,
"harmCategory": "",
"harmBlockThreshold": "",
"baseUrl": "",
"allowImageUploads": "",
"agentModel": "chatAnthropic"
"agentModel": "chatGoogleGenerativeAI"
}
},
"outputAnchors": [
@@ -1512,8 +1523,8 @@
"selected": false
},
"type": "agentFlow",
"width": 231,
"height": 71,
"width": 283,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 357.60470406099364,
@@ -1524,8 +1535,8 @@
{
"id": "loopAgentflow_0",
"position": {
"x": 574.050701666824,
"y": -20.0960840521807
"x": 572.5888618465789,
"y": -20.827003962303266
},
"data": {
"id": "loopAgentflow_0",
@@ -1567,20 +1578,20 @@
"selected": false
},
"type": "agentFlow",
"width": 186,
"height": 65,
"width": 195,
"height": 66,
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": 574.050701666824,
"y": -20.0960840521807
"x": 572.5888618465789,
"y": -20.827003962303266
}
},
{
"id": "loopAgentflow_1",
"position": {
"x": 600.379151793432,
"y": 90.25732743474846
"x": 566.7568359277939,
"y": 90.98824734487103
},
"data": {
"id": "loopAgentflow_1",
@@ -1622,20 +1633,20 @@
"selected": false
},
"type": "agentFlow",
"width": 186,
"height": 65,
"width": 195,
"height": 66,
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": 600.379151793432,
"y": 90.25732743474846
"x": 566.7568359277939,
"y": 90.98824734487103
}
},
{
"id": "llmAgentflow_0",
"position": {
"x": -78.28788541792727,
"y": 87.1528514813091
"x": -60.01488766486309,
"y": 87.88377139143167
},
"data": {
"id": "llmAgentflow_0",
@@ -1950,7 +1961,7 @@
],
"llmModelConfig": {
"cache": "",
"modelName": "gpt-4o-mini",
"modelName": "gpt-4.1",
"temperature": 0.9,
"streaming": true,
"maxTokens": "",
@@ -1964,7 +1975,6 @@
"proxyUrl": "",
"baseOptions": "",
"allowImageUploads": "",
"imageResolution": "low",
"reasoningEffort": "medium",
"llmModel": "chatOpenAI"
}
@@ -1980,12 +1990,12 @@
"selected": false
},
"type": "agentFlow",
"width": 168,
"height": 71,
"width": 148,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": -78.28788541792727,
"y": 87.1528514813091
"x": -60.01488766486309,
"y": 87.88377139143167
},
"dragging": false
}
@@ -0,0 +1,544 @@
{
"description": "Translate text from one language to another",
"usecases": ["Basic"],
"nodes": [
{
"id": "startAgentflow_0",
"type": "agentFlow",
"position": {
"x": 64,
"y": 98.5
},
"data": {
"id": "startAgentflow_0",
"label": "Start",
"version": 1.1,
"name": "startAgentflow",
"type": "Start",
"color": "#7EE787",
"hideInput": true,
"baseClasses": ["Start"],
"category": "Agent Flows",
"description": "Starting point of the agentflow",
"inputParams": [
{
"label": "Input Type",
"name": "startInputType",
"type": "options",
"options": [
{
"label": "Chat Input",
"name": "chatInput",
"description": "Start the conversation with chat input"
},
{
"label": "Form Input",
"name": "formInput",
"description": "Start the workflow with form inputs"
}
],
"default": "chatInput",
"id": "startAgentflow_0-input-startInputType-options",
"display": true
},
{
"label": "Form Title",
"name": "formTitle",
"type": "string",
"placeholder": "Please Fill Out The Form",
"show": {
"startInputType": "formInput"
},
"id": "startAgentflow_0-input-formTitle-string",
"display": false
},
{
"label": "Form Description",
"name": "formDescription",
"type": "string",
"placeholder": "Complete all fields below to continue",
"show": {
"startInputType": "formInput"
},
"id": "startAgentflow_0-input-formDescription-string",
"display": false
},
{
"label": "Form Input Types",
"name": "formInputTypes",
"description": "Specify the type of form input",
"type": "array",
"show": {
"startInputType": "formInput"
},
"array": [
{
"label": "Type",
"name": "type",
"type": "options",
"options": [
{
"label": "String",
"name": "string"
},
{
"label": "Number",
"name": "number"
},
{
"label": "Boolean",
"name": "boolean"
},
{
"label": "Options",
"name": "options"
}
],
"default": "string"
},
{
"label": "Label",
"name": "label",
"type": "string",
"placeholder": "Label for the input"
},
{
"label": "Variable Name",
"name": "name",
"type": "string",
"placeholder": "Variable name for the input (must be camel case)",
"description": "Variable name must be camel case. For example: firstName, lastName, etc."
},
{
"label": "Add Options",
"name": "addOptions",
"type": "array",
"show": {
"formInputTypes[$index].type": "options"
},
"array": [
{
"label": "Option",
"name": "option",
"type": "string"
}
]
}
],
"id": "startAgentflow_0-input-formInputTypes-array",
"display": false
},
{
"label": "Ephemeral Memory",
"name": "startEphemeralMemory",
"type": "boolean",
"description": "Start fresh for every execution without past chat history",
"optional": true,
"id": "startAgentflow_0-input-startEphemeralMemory-boolean",
"display": true
},
{
"label": "Flow State",
"name": "startState",
"description": "Runtime state during the execution of the workflow",
"type": "array",
"optional": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "string",
"placeholder": "Foo"
},
{
"label": "Value",
"name": "value",
"type": "string",
"placeholder": "Bar",
"optional": true
}
],
"id": "startAgentflow_0-input-startState-array",
"display": true
},
{
"label": "Persist State",
"name": "startPersistState",
"type": "boolean",
"description": "Persist the state in the same session",
"optional": true,
"id": "startAgentflow_0-input-startPersistState-boolean",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"startInputType": "chatInput",
"formTitle": "",
"formDescription": "",
"formInputTypes": "",
"startEphemeralMemory": "",
"startState": "",
"startPersistState": ""
},
"outputAnchors": [
{
"id": "startAgentflow_0-output-startAgentflow",
"label": "Start",
"name": "startAgentflow"
}
],
"outputs": {},
"selected": false
},
"width": 103,
"height": 66,
"positionAbsolute": {
"x": 64,
"y": 98.5
},
"selected": false,
"dragging": false
},
{
"id": "llmAgentflow_0",
"position": {
"x": 234.5,
"y": 96.25
},
"data": {
"id": "llmAgentflow_0",
"label": "Translator",
"version": 1,
"name": "llmAgentflow",
"type": "LLM",
"color": "#64B5F6",
"baseClasses": ["LLM"],
"category": "Agent Flows",
"description": "Large language models to analyze user-provided inputs and generate responses",
"inputParams": [
{
"label": "Model",
"name": "llmModel",
"type": "asyncOptions",
"loadMethod": "listModels",
"loadConfig": true,
"id": "llmAgentflow_0-input-llmModel-asyncOptions",
"display": true
},
{
"label": "Messages",
"name": "llmMessages",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Role",
"name": "role",
"type": "options",
"options": [
{
"label": "System",
"name": "system"
},
{
"label": "Assistant",
"name": "assistant"
},
{
"label": "Developer",
"name": "developer"
},
{
"label": "User",
"name": "user"
}
]
},
{
"label": "Content",
"name": "content",
"type": "string",
"acceptVariable": true,
"generateInstruction": true,
"rows": 4
}
],
"id": "llmAgentflow_0-input-llmMessages-array",
"display": true
},
{
"label": "Enable Memory",
"name": "llmEnableMemory",
"type": "boolean",
"description": "Enable memory for the conversation thread",
"default": true,
"optional": true,
"id": "llmAgentflow_0-input-llmEnableMemory-boolean",
"display": true
},
{
"label": "Memory Type",
"name": "llmMemoryType",
"type": "options",
"options": [
{
"label": "All Messages",
"name": "allMessages",
"description": "Retrieve all messages from the conversation"
},
{
"label": "Window Size",
"name": "windowSize",
"description": "Uses a fixed window size to surface the last N messages"
},
{
"label": "Conversation Summary",
"name": "conversationSummary",
"description": "Summarizes the whole conversation"
},
{
"label": "Conversation Summary Buffer",
"name": "conversationSummaryBuffer",
"description": "Summarize conversations once token limit is reached. Default to 2000"
}
],
"optional": true,
"default": "allMessages",
"show": {
"llmEnableMemory": true
},
"id": "llmAgentflow_0-input-llmMemoryType-options",
"display": false
},
{
"label": "Window Size",
"name": "llmMemoryWindowSize",
"type": "number",
"default": "20",
"description": "Uses a fixed window size to surface the last N messages",
"show": {
"llmMemoryType": "windowSize"
},
"id": "llmAgentflow_0-input-llmMemoryWindowSize-number",
"display": false
},
{
"label": "Max Token Limit",
"name": "llmMemoryMaxTokenLimit",
"type": "number",
"default": "2000",
"description": "Summarize conversations once token limit is reached. Default to 2000",
"show": {
"llmMemoryType": "conversationSummaryBuffer"
},
"id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number",
"display": false
},
{
"label": "Input Message",
"name": "llmUserMessage",
"type": "string",
"description": "Add an input message as user message at the end of the conversation",
"rows": 4,
"optional": true,
"acceptVariable": true,
"show": {
"llmEnableMemory": true
},
"id": "llmAgentflow_0-input-llmUserMessage-string",
"display": false
},
{
"label": "Return Response As",
"name": "llmReturnResponseAs",
"type": "options",
"options": [
{
"label": "User Message",
"name": "userMessage"
},
{
"label": "Assistant Message",
"name": "assistantMessage"
}
],
"default": "userMessage",
"id": "llmAgentflow_0-input-llmReturnResponseAs-options",
"display": true
},
{
"label": "JSON Structured Output",
"name": "llmStructuredOutput",
"description": "Instruct the LLM to give output in a JSON structured schema",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "string"
},
{
"label": "Type",
"name": "type",
"type": "options",
"options": [
{
"label": "String",
"name": "string"
},
{
"label": "String Array",
"name": "stringArray"
},
{
"label": "Number",
"name": "number"
},
{
"label": "Boolean",
"name": "boolean"
},
{
"label": "Enum",
"name": "enum"
},
{
"label": "JSON Array",
"name": "jsonArray"
}
]
},
{
"label": "Enum Values",
"name": "enumValues",
"type": "string",
"placeholder": "value1, value2, value3",
"description": "Enum values. Separated by comma",
"optional": true,
"show": {
"llmStructuredOutput[$index].type": "enum"
}
},
{
"label": "JSON Schema",
"name": "jsonSchema",
"type": "code",
"placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}",
"description": "JSON schema for the structured output",
"optional": true,
"show": {
"llmStructuredOutput[$index].type": "jsonArray"
}
},
{
"label": "Description",
"name": "description",
"type": "string",
"placeholder": "Description of the key"
}
],
"id": "llmAgentflow_0-input-llmStructuredOutput-array",
"display": true
},
{
"label": "Update Flow State",
"name": "llmUpdateState",
"description": "Update runtime state during the execution of the workflow",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "asyncOptions",
"loadMethod": "listRuntimeStateKeys",
"freeSolo": true
},
{
"label": "Value",
"name": "value",
"type": "string",
"acceptVariable": true,
"acceptNodeOutputAsVariable": true
}
],
"id": "llmAgentflow_0-input-llmUpdateState-array",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"llmModel": "chatGoogleGenerativeAI",
"llmMessages": [
{
"role": "system",
"content": "<p>You are a helpful assistant that translates English to Japanese language. Return only Japanese language</p>"
},
{
"role": "user",
"content": "<p>English:</p><p><span class=\"variable\" data-type=\"mention\" data-id=\"question\" data-label=\"question\">{{ question }}</span> </p><p>Japanese:</p><p></p>"
}
],
"llmEnableMemory": false,
"llmReturnResponseAs": "userMessage",
"llmStructuredOutput": "",
"llmUpdateState": "",
"llmModelConfig": {
"cache": "",
"contextCache": "",
"modelName": "gemini-2.0-flash",
"customModelName": "",
"temperature": 0.9,
"streaming": true,
"maxOutputTokens": "",
"topP": "",
"topK": "",
"harmCategory": "",
"harmBlockThreshold": "",
"baseUrl": "",
"allowImageUploads": "",
"llmModel": "chatGoogleGenerativeAI"
}
},
"outputAnchors": [
{
"id": "llmAgentflow_0-output-llmAgentflow",
"label": "LLM",
"name": "llmAgentflow"
}
],
"outputs": {},
"selected": false
},
"type": "agentFlow",
"width": 200,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": 234.5,
"y": 96.25
},
"dragging": false
}
],
"edges": [
{
"source": "startAgentflow_0",
"sourceHandle": "startAgentflow_0-output-startAgentflow",
"target": "llmAgentflow_0",
"targetHandle": "llmAgentflow_0",
"data": {
"sourceColor": "#7EE787",
"targetColor": "#64B5F6",
"isHumanInput": false
},
"type": "agentFlow",
"id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0"
}
]
}
@@ -1,5 +1,5 @@
{
"description": "An agent that can post message to Slack channel",
"description": "An agent that can post AI responses to Workplace channels like Slack and Teams",
"usecases": ["Agent"],
"nodes": [
{
@@ -186,8 +186,8 @@
"outputs": {},
"selected": false
},
"width": 101,
"height": 65,
"width": 103,
"height": 66,
"selected": false,
"positionAbsolute": {
"x": -192.5,
@@ -508,8 +508,8 @@
"selected": false
},
"type": "agentFlow",
"width": 168,
"height": 71,
"width": 175,
"height": 72,
"selected": false,
"positionAbsolute": {
"x": -31.25,
@@ -520,12 +520,12 @@
{
"id": "toolAgentflow_0",
"position": {
"x": 182.75,
"y": 64.5
"x": 181.67112630208328,
"y": 28.357731119791666
},
"data": {
"id": "toolAgentflow_0",
"label": "Slack Reply",
"label": "Post to Slack",
"version": 1.1,
"name": "toolAgentflow",
"type": "Tool",
@@ -627,20 +627,20 @@
"selected": false
},
"type": "agentFlow",
"width": 142,
"height": 71,
"width": 156,
"height": 68,
"selected": false,
"positionAbsolute": {
"x": 182.75,
"y": 64.5
"x": 181.67112630208328,
"y": 28.357731119791666
},
"dragging": false
},
{
"id": "directReplyAgentflow_0",
"position": {
"x": 366.75,
"y": 67.5
"x": 373.22324218750003,
"y": 66.96056315104161
},
"data": {
"id": "directReplyAgentflow_0",
@@ -673,12 +673,138 @@
"selected": false
},
"type": "agentFlow",
"width": 194,
"height": 65,
"width": 204,
"height": 66,
"selected": false,
"positionAbsolute": {
"x": 366.75,
"y": 67.5
"x": 373.22324218750003,
"y": 66.96056315104161
},
"dragging": false
},
{
"id": "toolAgentflow_1",
"position": {
"x": 177.461181640625,
"y": 108.73382161458332
},
"data": {
"id": "toolAgentflow_1",
"label": "Post to Teams",
"version": 1.1,
"name": "toolAgentflow",
"type": "Tool",
"color": "#d4a373",
"baseClasses": ["Tool"],
"category": "Agent Flows",
"description": "Tools allow LLM to interact with external systems",
"inputParams": [
{
"label": "Tool",
"name": "toolAgentflowSelectedTool",
"type": "asyncOptions",
"loadMethod": "listTools",
"loadConfig": true,
"id": "toolAgentflow_1-input-toolAgentflowSelectedTool-asyncOptions",
"display": true
},
{
"label": "Tool Input Arguments",
"name": "toolInputArgs",
"type": "array",
"acceptVariable": true,
"refresh": true,
"array": [
{
"label": "Input Argument Name",
"name": "inputArgName",
"type": "asyncOptions",
"loadMethod": "listToolInputArgs",
"refresh": true
},
{
"label": "Input Argument Value",
"name": "inputArgValue",
"type": "string",
"acceptVariable": true
}
],
"show": {
"toolAgentflowSelectedTool": ".+"
},
"id": "toolAgentflow_1-input-toolInputArgs-array",
"display": true
},
{
"label": "Update Flow State",
"name": "toolUpdateState",
"description": "Update runtime state during the execution of the workflow",
"type": "array",
"optional": true,
"acceptVariable": true,
"array": [
{
"label": "Key",
"name": "key",
"type": "asyncOptions",
"loadMethod": "listRuntimeStateKeys",
"freeSolo": true
},
{
"label": "Value",
"name": "value",
"type": "string",
"acceptVariable": true,
"acceptNodeOutputAsVariable": true
}
],
"id": "toolAgentflow_1-input-toolUpdateState-array",
"display": true
}
],
"inputAnchors": [],
"inputs": {
"toolAgentflowSelectedTool": "microsoftTeams",
"toolInputArgs": [
{
"inputArgName": "teamId",
"inputArgValue": "<p>&lt;your-team-id&gt;</p>"
},
{
"inputArgName": "chatChannelId",
"inputArgValue": "<p>&lt;your-channel-id&gt;</p>"
},
{
"inputArgName": "messageBody",
"inputArgValue": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"llmAgentflow_0\" data-label=\"llmAgentflow_0\">{{ llmAgentflow_0 }}</span> </p>"
}
],
"toolUpdateState": "",
"toolAgentflowSelectedToolConfig": {
"credential": "",
"teamsType": "chatMessage",
"chatMessageActions": "[\"sendMessage\"]",
"toolAgentflowSelectedTool": "microsoftTeams",
"chatChannelIdSendMessage": "ABCDEFG"
}
},
"outputAnchors": [
{
"id": "toolAgentflow_1-output-toolAgentflow",
"label": "Tool",
"name": "toolAgentflow"
}
],
"outputs": {},
"selected": false
},
"type": "agentFlow",
"width": 163,
"height": 68,
"selected": false,
"positionAbsolute": {
"x": 177.461181640625,
"y": 108.73382161458332
},
"dragging": false
}
@@ -722,6 +848,32 @@
},
"type": "agentFlow",
"id": "toolAgentflow_0-toolAgentflow_0-output-toolAgentflow-directReplyAgentflow_0-directReplyAgentflow_0"
},
{
"source": "llmAgentflow_0",
"sourceHandle": "llmAgentflow_0-output-llmAgentflow",
"target": "toolAgentflow_1",
"targetHandle": "toolAgentflow_1",
"data": {
"sourceColor": "#64B5F6",
"targetColor": "#d4a373",
"isHumanInput": false
},
"type": "agentFlow",
"id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-toolAgentflow_1-toolAgentflow_1"
},
{
"source": "toolAgentflow_1",
"sourceHandle": "toolAgentflow_1-output-toolAgentflow",
"target": "directReplyAgentflow_0",
"targetHandle": "directReplyAgentflow_0",
"data": {
"sourceColor": "#d4a373",
"targetColor": "#4DDBBB",
"isHumanInput": false
},
"type": "agentFlow",
"id": "toolAgentflow_1-toolAgentflow_1-output-toolAgentflow-directReplyAgentflow_0-directReplyAgentflow_0"
}
]
}
@@ -1,533 +0,0 @@
{
"description": "Output antonym of given user input using few-shot prompt template built with examples",
"framework": ["Langchain"],
"usecases": ["Basic"],
"nodes": [
{
"width": 300,
"height": 956,
"id": "fewShotPromptTemplate_1",
"position": {
"x": 886.3229032369354,
"y": -32.18537399495787
},
"type": "customNode",
"data": {
"id": "fewShotPromptTemplate_1",
"label": "Few Shot Prompt Template",
"version": 1,
"name": "fewShotPromptTemplate",
"type": "FewShotPromptTemplate",
"baseClasses": ["FewShotPromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
"category": "Prompts",
"description": "Prompt template you can build with examples",
"inputParams": [
{
"label": "Examples",
"name": "examples",
"type": "string",
"rows": 4,
"placeholder": "[\n { \"word\": \"happy\", \"antonym\": \"sad\" },\n { \"word\": \"tall\", \"antonym\": \"short\" },\n]",
"id": "fewShotPromptTemplate_1-input-examples-string"
},
{
"label": "Prefix",
"name": "prefix",
"type": "string",
"rows": 4,
"placeholder": "Give the antonym of every input",
"id": "fewShotPromptTemplate_1-input-prefix-string"
},
{
"label": "Suffix",
"name": "suffix",
"type": "string",
"rows": 4,
"placeholder": "Word: {input}\nAntonym:",
"id": "fewShotPromptTemplate_1-input-suffix-string"
},
{
"label": "Example Separator",
"name": "exampleSeparator",
"type": "string",
"placeholder": "\n\n",
"id": "fewShotPromptTemplate_1-input-exampleSeparator-string"
},
{
"label": "Template Format",
"name": "templateFormat",
"type": "options",
"options": [
{
"label": "f-string",
"name": "f-string"
},
{
"label": "jinja-2",
"name": "jinja-2"
}
],
"default": "f-string",
"id": "fewShotPromptTemplate_1-input-templateFormat-options"
}
],
"inputAnchors": [
{
"label": "Example Prompt",
"name": "examplePrompt",
"type": "PromptTemplate",
"id": "fewShotPromptTemplate_1-input-examplePrompt-PromptTemplate"
}
],
"inputs": {
"examples": "[\n { \"word\": \"happy\", \"antonym\": \"sad\" },\n { \"word\": \"tall\", \"antonym\": \"short\" }\n]",
"examplePrompt": "{{promptTemplate_0.data.instance}}",
"prefix": "Give the antonym of every input",
"suffix": "Word: {input}\\nAntonym:",
"exampleSeparator": "\\n\\n",
"templateFormat": "f-string"
},
"outputAnchors": [
{
"id": "fewShotPromptTemplate_1-output-fewShotPromptTemplate-FewShotPromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
"name": "fewShotPromptTemplate",
"label": "FewShotPromptTemplate",
"type": "FewShotPromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 886.3229032369354,
"y": -32.18537399495787
},
"dragging": false
},
{
"width": 300,
"height": 513,
"id": "promptTemplate_0",
"position": {
"x": 540.0140796251119,
"y": -33.31673494170347
},
"type": "customNode",
"data": {
"id": "promptTemplate_0",
"label": "Prompt Template",
"version": 1,
"name": "promptTemplate",
"type": "PromptTemplate",
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
"category": "Prompts",
"description": "Schema to represent a basic prompt for an LLM",
"inputParams": [
{
"label": "Template",
"name": "template",
"type": "string",
"rows": 4,
"placeholder": "What is a good name for a company that makes {product}?",
"id": "promptTemplate_0-input-template-string"
},
{
"label": "Format Prompt Values",
"name": "promptValues",
"type": "json",
"optional": true,
"acceptVariable": true,
"list": true,
"id": "promptTemplate_0-input-promptValues-json"
}
],
"inputAnchors": [],
"inputs": {
"template": "Word: {word}\\nAntonym: {antonym}\\n",
"promptValues": ""
},
"outputAnchors": [
{
"id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
"name": "promptTemplate",
"label": "PromptTemplate",
"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 540.0140796251119,
"y": -33.31673494170347
},
"dragging": false
},
{
"width": 300,
"height": 508,
"id": "llmChain_0",
"position": {
"x": 1609.3428158423485,
"y": 409.3763727612179
},
"type": "customNode",
"data": {
"id": "llmChain_0",
"label": "LLM Chain",
"version": 3,
"name": "llmChain",
"type": "LLMChain",
"baseClasses": ["LLMChain", "BaseChain", "Runnable"],
"category": "Chains",
"description": "Chain to run queries against LLMs",
"inputParams": [
{
"label": "Chain Name",
"name": "chainName",
"type": "string",
"placeholder": "Name Your Chain",
"optional": true,
"id": "llmChain_0-input-chainName-string"
}
],
"inputAnchors": [
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "llmChain_0-input-model-BaseLanguageModel"
},
{
"label": "Prompt",
"name": "prompt",
"type": "BasePromptTemplate",
"id": "llmChain_0-input-prompt-BasePromptTemplate"
},
{
"label": "Output Parser",
"name": "outputParser",
"type": "BaseLLMOutputParser",
"optional": true,
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
},
{
"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": "llmChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"model": "{{chatOpenAI_0.data.instance}}",
"prompt": "{{fewShotPromptTemplate_1.data.instance}}",
"outputParser": "",
"chainName": "",
"inputModeration": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"options": [
{
"id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
"name": "llmChain",
"label": "LLM Chain",
"type": "LLMChain | BaseChain | Runnable"
},
{
"id": "llmChain_0-output-outputPrediction-string|json",
"name": "outputPrediction",
"label": "Output Prediction",
"type": "string | json"
}
],
"default": "llmChain"
}
],
"outputs": {
"output": "llmChain"
},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1609.3428158423485,
"y": 409.3763727612179
},
"dragging": false
},
{
"id": "chatOpenAI_0",
"position": {
"x": 1220.4459070421062,
"y": -80.75004891987845
},
"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-3.5-turbo",
"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": 670,
"selected": false,
"positionAbsolute": {
"x": 1220.4459070421062,
"y": -80.75004891987845
},
"dragging": false
},
{
"id": "stickyNote_0",
"position": {
"x": 1607.723380325684,
"y": 245.15558433515412
},
"type": "stickyNote",
"data": {
"id": "stickyNote_0",
"label": "Sticky Note",
"version": 2,
"name": "stickyNote",
"type": "StickyNote",
"baseClasses": ["StickyNote"],
"tags": ["Utilities"],
"category": "Utilities",
"description": "Add a sticky note",
"inputParams": [
{
"label": "",
"name": "note",
"type": "string",
"rows": 1,
"placeholder": "Type something here",
"optional": true,
"id": "stickyNote_0-input-note-string"
}
],
"inputAnchors": [],
"inputs": {
"note": "Using few shot examples, we let LLM learns from the examples.\n\nThis template showcase how we can let LLM gives output as an antonym for given input"
},
"outputAnchors": [
{
"id": "stickyNote_0-output-stickyNote-StickyNote",
"name": "stickyNote",
"label": "StickyNote",
"description": "Add a sticky note",
"type": "StickyNote"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 143,
"selected": false,
"positionAbsolute": {
"x": 1607.723380325684,
"y": 245.15558433515412
},
"dragging": false
}
],
"edges": [
{
"source": "promptTemplate_0",
"sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
"target": "fewShotPromptTemplate_1",
"targetHandle": "fewShotPromptTemplate_1-input-examplePrompt-PromptTemplate",
"type": "buttonedge",
"id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-fewShotPromptTemplate_1-fewShotPromptTemplate_1-input-examplePrompt-PromptTemplate",
"data": {
"label": ""
}
},
{
"source": "fewShotPromptTemplate_1",
"sourceHandle": "fewShotPromptTemplate_1-output-fewShotPromptTemplate-FewShotPromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
"type": "buttonedge",
"id": "fewShotPromptTemplate_1-fewShotPromptTemplate_1-output-fewShotPromptTemplate-FewShotPromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
"data": {
"label": ""
}
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel"
}
]
}
@@ -1,7 +1,6 @@
{
"description": "Answer question based on retrieved documents (context) while remembering previous conversations",
"framework": ["LlamaIndex"],
"badge": "POPULAR",
"usecases": ["Documents QnA"],
"nodes": [
{
@@ -1,8 +1,7 @@
{
"description": "Basic example of Conversation Chain with built-in memory - works exactly like ChatGPT",
"usecases": ["Chatbot"],
"usecases": ["Basic"],
"framework": ["Langchain"],
"badge": "POPULAR",
"nodes": [
{
"width": 300,
@@ -1,6 +1,5 @@
{
"description": "Documents QnA using Retrieval Augmented Generation (RAG) with Mistral and FAISS for similarity search",
"badge": "POPULAR",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"nodes": [
@@ -1,6 +1,5 @@
{
"description": "Flowise Docs Github QnA using Retrieval Augmented Generation (RAG)",
"badge": "POPULAR",
"description": "Github Docs QnA using Retrieval Augmented Generation (RAG)",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"nodes": [
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,5 @@
{
"description": "QnA chain using Ollama local LLM, LocalAI embedding model, and Faiss local vector store",
"badge": "POPULAR",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"nodes": [
@@ -1,499 +0,0 @@
{
"description": "A chain that automatically picks an appropriate prompt from multiple prompts",
"usecases": ["Basic"],
"framework": ["Langchain"],
"nodes": [
{
"width": 300,
"height": 632,
"id": "promptRetriever_0",
"position": {
"x": 197.46642699727397,
"y": 25.945621297410923
},
"type": "customNode",
"data": {
"id": "promptRetriever_0",
"label": "Prompt Retriever",
"name": "promptRetriever",
"version": 1,
"type": "PromptRetriever",
"baseClasses": ["PromptRetriever"],
"category": "Retrievers",
"description": "Store prompt template with name & description to be later queried by MultiPromptChain",
"inputParams": [
{
"label": "Prompt Name",
"name": "name",
"type": "string",
"placeholder": "physics-qa",
"id": "promptRetriever_0-input-name-string"
},
{
"label": "Prompt Description",
"name": "description",
"type": "string",
"rows": 3,
"description": "Description of what the prompt does and when it should be used",
"placeholder": "Good for answering questions about physics",
"id": "promptRetriever_0-input-description-string"
},
{
"label": "Prompt System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
"id": "promptRetriever_0-input-systemMessage-string"
}
],
"inputAnchors": [],
"inputs": {
"name": "physics",
"description": "Good for answering questions about physics",
"systemMessage": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know."
},
"outputAnchors": [
{
"id": "promptRetriever_0-output-promptRetriever-PromptRetriever",
"name": "promptRetriever",
"label": "PromptRetriever",
"type": "PromptRetriever"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 197.46642699727397,
"y": 25.945621297410923
},
"dragging": false
},
{
"width": 300,
"height": 280,
"id": "multiPromptChain_0",
"position": {
"x": 1619.1305522575494,
"y": 210.28103293821243
},
"type": "customNode",
"data": {
"id": "multiPromptChain_0",
"label": "Multi Prompt Chain",
"name": "multiPromptChain",
"version": 2,
"type": "MultiPromptChain",
"baseClasses": ["MultiPromptChain", "MultiRouteChain", "BaseChain", "BaseLangChain"],
"category": "Chains",
"description": "Chain automatically picks an appropriate prompt from multiple prompt templates",
"inputParams": [],
"inputAnchors": [
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "multiPromptChain_0-input-model-BaseLanguageModel"
},
{
"label": "Prompt Retriever",
"name": "promptRetriever",
"type": "PromptRetriever",
"list": true,
"id": "multiPromptChain_0-input-promptRetriever-PromptRetriever"
},
{
"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": "multiPromptChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"inputModeration": "",
"model": "{{chatOpenAI_0.data.instance}}",
"promptRetriever": [
"{{promptRetriever_0.data.instance}}",
"{{promptRetriever_2.data.instance}}",
"{{promptRetriever_1.data.instance}}"
]
},
"outputAnchors": [
{
"id": "multiPromptChain_0-output-multiPromptChain-MultiPromptChain|MultiRouteChain|BaseChain|BaseLangChain",
"name": "multiPromptChain",
"label": "MultiPromptChain",
"type": "MultiPromptChain | MultiRouteChain | BaseChain | BaseLangChain"
}
],
"outputs": {},
"selected": false
},
"positionAbsolute": {
"x": 1619.1305522575494,
"y": 210.28103293821243
},
"selected": false,
"dragging": false
},
{
"width": 300,
"height": 632,
"id": "promptRetriever_1",
"position": {
"x": 539.1322780233141,
"y": -250.72967142925938
},
"type": "customNode",
"data": {
"id": "promptRetriever_1",
"label": "Prompt Retriever",
"name": "promptRetriever",
"version": 1,
"type": "PromptRetriever",
"baseClasses": ["PromptRetriever"],
"category": "Retrievers",
"description": "Store prompt template with name & description to be later queried by MultiPromptChain",
"inputParams": [
{
"label": "Prompt Name",
"name": "name",
"type": "string",
"placeholder": "physics-qa",
"id": "promptRetriever_1-input-name-string"
},
{
"label": "Prompt Description",
"name": "description",
"type": "string",
"rows": 3,
"description": "Description of what the prompt does and when it should be used",
"placeholder": "Good for answering questions about physics",
"id": "promptRetriever_1-input-description-string"
},
{
"label": "Prompt System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
"id": "promptRetriever_1-input-systemMessage-string"
}
],
"inputAnchors": [],
"inputs": {
"name": "math",
"description": "Good for answering math questions",
"systemMessage": "You are a very good mathematician. You are great at answering math questions. You are so good because you are able to break down hard problems into their component parts, answer the component parts, and then put them together to answer the broader question."
},
"outputAnchors": [
{
"id": "promptRetriever_1-output-promptRetriever-PromptRetriever",
"name": "promptRetriever",
"label": "PromptRetriever",
"type": "PromptRetriever"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 539.1322780233141,
"y": -250.72967142925938
},
"dragging": false
},
{
"width": 300,
"height": 632,
"id": "promptRetriever_2",
"position": {
"x": 872.6184534864304,
"y": -366.9443140594265
},
"type": "customNode",
"data": {
"id": "promptRetriever_2",
"label": "Prompt Retriever",
"name": "promptRetriever",
"version": 1,
"type": "PromptRetriever",
"baseClasses": ["PromptRetriever"],
"category": "Retrievers",
"description": "Store prompt template with name & description to be later queried by MultiPromptChain",
"inputParams": [
{
"label": "Prompt Name",
"name": "name",
"type": "string",
"placeholder": "physics-qa",
"id": "promptRetriever_2-input-name-string"
},
{
"label": "Prompt Description",
"name": "description",
"type": "string",
"rows": 3,
"description": "Description of what the prompt does and when it should be used",
"placeholder": "Good for answering questions about physics",
"id": "promptRetriever_2-input-description-string"
},
{
"label": "Prompt System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
"id": "promptRetriever_2-input-systemMessage-string"
}
],
"inputAnchors": [],
"inputs": {
"name": "history",
"description": "Good for answering questions about history",
"systemMessage": "You are a very smart history professor. You are great at answering questions about history in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know."
},
"outputAnchors": [
{
"id": "promptRetriever_2-output-promptRetriever-PromptRetriever",
"name": "promptRetriever",
"label": "PromptRetriever",
"type": "PromptRetriever"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 872.6184534864304,
"y": -366.9443140594265
},
"dragging": false
},
{
"width": 300,
"height": 523,
"id": "chatOpenAI_0",
"position": {
"x": 1228.4059611466973,
"y": -326.46419383157513
},
"type": "customNode",
"data": {
"id": "chatOpenAI_0",
"label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 6.0,
"type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"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-options"
},
{
"label": "Temperature",
"name": "temperature",
"type": "number",
"default": 0.9,
"optional": true,
"id": "chatOpenAI_0-input-temperature-number"
},
{
"label": "Max Tokens",
"name": "maxTokens",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-maxTokens-number"
},
{
"label": "Top Probability",
"name": "topP",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-topP-number"
},
{
"label": "Frequency Penalty",
"name": "frequencyPenalty",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-frequencyPenalty-number"
},
{
"label": "Presence Penalty",
"name": "presencePenalty",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-presencePenalty-number"
},
{
"label": "Timeout",
"name": "timeout",
"type": "number",
"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": {
"modelName": "gpt-3.5-turbo",
"temperature": 0.9,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"basepath": "",
"baseOptions": "",
"allowImageUploads": true,
"imageResolution": "low"
},
"outputAnchors": [
{
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"name": "chatOpenAI",
"label": "ChatOpenAI",
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1228.4059611466973,
"y": -326.46419383157513
},
"dragging": false
}
],
"edges": [
{
"source": "promptRetriever_0",
"sourceHandle": "promptRetriever_0-output-promptRetriever-PromptRetriever",
"target": "multiPromptChain_0",
"targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
"type": "buttonedge",
"id": "promptRetriever_0-promptRetriever_0-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
"data": {
"label": ""
}
},
{
"source": "promptRetriever_2",
"sourceHandle": "promptRetriever_2-output-promptRetriever-PromptRetriever",
"target": "multiPromptChain_0",
"targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
"type": "buttonedge",
"id": "promptRetriever_2-promptRetriever_2-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
"data": {
"label": ""
}
},
{
"source": "promptRetriever_1",
"sourceHandle": "promptRetriever_1-output-promptRetriever-PromptRetriever",
"target": "multiPromptChain_0",
"targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
"type": "buttonedge",
"id": "promptRetriever_1-promptRetriever_1-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
"data": {
"label": ""
}
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "multiPromptChain_0",
"targetHandle": "multiPromptChain_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-multiPromptChain_0-multiPromptChain_0-input-model-BaseLanguageModel",
"data": {
"label": ""
}
}
]
}
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,5 @@
{
"description": "Tool agent that can retrieve answers from multiple sources using relevant Retriever Tools",
"badge": "POPULAR",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"nodes": [
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
{
"description": "Given API docs, agent automatically decide which API to call, generating url and body request from conversation",
"description": "Given an OpenAPI YAML file, agent automatically decide which API to call, generating url and body request from conversation",
"framework": ["Langchain"],
"usecases": ["Interacting with API"],
"nodes": [
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
{
"description": "Simple chat engine to handle back and forth conversations using LlamaIndex",
"usecases": ["Chatbot"],
"usecases": ["Basic"],
"framework": ["LlamaIndex"],
"nodes": [
{
@@ -1,490 +0,0 @@
{
"description": "Return response as a specified JSON structure instead of a string/text",
"framework": ["Langchain"],
"usecases": ["Extraction"],
"nodes": [
{
"width": 300,
"height": 574,
"id": "chatOpenAI_0",
"position": {
"x": 845.3961479115309,
"y": -205.74401580699953
},
"type": "customNode",
"data": {
"id": "chatOpenAI_0",
"label": "ChatOpenAI",
"version": 6.0,
"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-options"
},
{
"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-3.5-turbo",
"temperature": "0",
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"basepath": "",
"baseOptions": "",
"allowImageUploads": true,
"imageResolution": "low"
},
"outputAnchors": [
{
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"name": "chatOpenAI",
"label": "ChatOpenAI",
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 845.3961479115309,
"y": -205.74401580699953
},
"dragging": false
},
{
"width": 300,
"height": 456,
"id": "llmChain_0",
"position": {
"x": 1229.1699649849293,
"y": 245.55173505632646
},
"type": "customNode",
"data": {
"id": "llmChain_0",
"label": "LLM Chain",
"version": 3,
"name": "llmChain",
"type": "LLMChain",
"baseClasses": ["LLMChain", "BaseChain", "Runnable"],
"category": "Chains",
"description": "Chain to run queries against LLMs",
"inputParams": [
{
"label": "Chain Name",
"name": "chainName",
"type": "string",
"placeholder": "Name Your Chain",
"optional": true,
"id": "llmChain_0-input-chainName-string"
}
],
"inputAnchors": [
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "llmChain_0-input-model-BaseLanguageModel"
},
{
"label": "Prompt",
"name": "prompt",
"type": "BasePromptTemplate",
"id": "llmChain_0-input-prompt-BasePromptTemplate"
},
{
"label": "Output Parser",
"name": "outputParser",
"type": "BaseLLMOutputParser",
"optional": true,
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
},
{
"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": "llmChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"model": "{{chatOpenAI_0.data.instance}}",
"prompt": "{{chatPromptTemplate_0.data.instance}}",
"outputParser": "{{structuredOutputParser_0.data.instance}}",
"chainName": "",
"inputModeration": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"options": [
{
"id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
"name": "llmChain",
"label": "LLM Chain",
"type": "LLMChain | BaseChain | Runnable"
},
{
"id": "llmChain_0-output-outputPrediction-string|json",
"name": "outputPrediction",
"label": "Output Prediction",
"type": "string | json"
}
],
"default": "llmChain"
}
],
"outputs": {
"output": "llmChain"
},
"selected": false
},
"positionAbsolute": {
"x": 1229.1699649849293,
"y": 245.55173505632646
},
"selected": false
},
{
"width": 300,
"height": 652,
"id": "chatPromptTemplate_0",
"position": {
"x": 501.1597501123828,
"y": -154.43917602832562
},
"type": "customNode",
"data": {
"id": "chatPromptTemplate_0",
"label": "Chat Prompt Template",
"version": 1,
"name": "chatPromptTemplate",
"type": "ChatPromptTemplate",
"baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"],
"category": "Prompts",
"description": "Schema to represent a chat prompt",
"inputParams": [
{
"label": "System Message",
"name": "systemMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
"id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
},
{
"label": "Human Message",
"name": "humanMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "{text}",
"id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
},
{
"label": "Format Prompt Values",
"name": "promptValues",
"type": "json",
"optional": true,
"acceptVariable": true,
"list": true,
"id": "chatPromptTemplate_0-input-promptValues-json"
}
],
"inputAnchors": [],
"inputs": {
"systemMessagePrompt": "Answer user's question as best you can",
"humanMessagePrompt": "{text}",
"promptValues": ""
},
"outputAnchors": [
{
"id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
"name": "chatPromptTemplate",
"label": "ChatPromptTemplate",
"type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 501.1597501123828,
"y": -154.43917602832562
},
"dragging": false
},
{
"width": 300,
"height": 328,
"id": "structuredOutputParser_0",
"position": {
"x": 170.3869571939727,
"y": 343.9298288967859
},
"type": "customNode",
"data": {
"id": "structuredOutputParser_0",
"label": "Structured Output Parser",
"version": 1,
"name": "structuredOutputParser",
"type": "StructuredOutputParser",
"baseClasses": ["StructuredOutputParser", "BaseLLMOutputParser", "Runnable"],
"category": "Output Parsers",
"description": "Parse the output of an LLM call into a given (JSON) structure.",
"inputParams": [
{
"label": "Autofix",
"name": "autofixParser",
"type": "boolean",
"optional": true,
"description": "In the event that the first call fails, will make another call to the model to fix any errors.",
"id": "structuredOutputParser_0-input-autofixParser-boolean"
},
{
"label": "JSON Structure",
"name": "jsonStructure",
"type": "datagrid",
"description": "JSON structure for LLM to return",
"datagrid": [
{
"field": "property",
"headerName": "Property",
"editable": true
},
{
"field": "type",
"headerName": "Type",
"type": "singleSelect",
"valueOptions": ["string", "number", "boolean"],
"editable": true
},
{
"field": "description",
"headerName": "Description",
"editable": true,
"flex": 1
}
],
"default": [
{
"property": "answer",
"type": "string",
"description": "answer to the user's question"
},
{
"property": "source",
"type": "string",
"description": "sources used to answer the question, should be websites"
}
],
"additionalParams": true,
"id": "structuredOutputParser_0-input-jsonStructure-datagrid"
}
],
"inputAnchors": [],
"inputs": {
"autofixParser": true,
"jsonStructure": [
{
"property": "answer",
"type": "string",
"description": "answer to the user's question"
},
{
"property": "source",
"type": "string",
"description": "sources used to answer the question, should be websites"
}
]
},
"outputAnchors": [
{
"id": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
"name": "structuredOutputParser",
"label": "StructuredOutputParser",
"type": "StructuredOutputParser | BaseLLMOutputParser | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 170.3869571939727,
"y": 343.9298288967859
},
"dragging": false
}
],
"edges": [
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
"data": {
"label": ""
}
},
{
"source": "chatPromptTemplate_0",
"sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
"type": "buttonedge",
"id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
"data": {
"label": ""
}
},
{
"source": "structuredOutputParser_0",
"sourceHandle": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser",
"type": "buttonedge",
"id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser",
"data": {
"label": ""
}
}
]
}
@@ -0,0 +1,631 @@
{
"description": "An agent designed to use tools and LLM with function calling capability to provide responses",
"usecases": ["Agent"],
"framework": ["Langchain"],
"nodes": [
{
"width": 300,
"height": 149,
"id": "calculator_1",
"position": {
"x": 800.5125025564965,
"y": 72.40592063242738
},
"type": "customNode",
"data": {
"id": "calculator_1",
"label": "Calculator",
"version": 1,
"name": "calculator",
"type": "Calculator",
"baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain"],
"category": "Tools",
"description": "Perform calculations on response",
"inputParams": [],
"inputAnchors": [],
"inputs": {},
"outputAnchors": [
{
"id": "calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain",
"name": "calculator",
"label": "Calculator",
"type": "Calculator | Tool | StructuredTool | BaseLangChain"
}
],
"outputs": {},
"selected": false
},
"positionAbsolute": {
"x": 800.5125025564965,
"y": 72.40592063242738
},
"selected": false,
"dragging": false
},
{
"width": 300,
"height": 259,
"id": "bufferMemory_1",
"position": {
"x": 607.6260576768354,
"y": 584.7920541862369
},
"type": "customNode",
"data": {
"id": "bufferMemory_1",
"label": "Buffer Memory",
"version": 2,
"name": "bufferMemory",
"type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory",
"description": "Retrieve chat messages stored in database",
"inputParams": [
{
"label": "Session Id",
"name": "sessionId",
"type": "string",
"description": "If not specified, a random id will be used. Learn <a target=\"_blank\" href=\"https://docs.flowiseai.com/memory#ui-and-embedded-chat\">more</a>",
"default": "",
"additionalParams": true,
"optional": true,
"id": "bufferMemory_1-input-sessionId-string"
},
{
"label": "Memory Key",
"name": "memoryKey",
"type": "string",
"default": "chat_history",
"additionalParams": true,
"id": "bufferMemory_1-input-memoryKey-string"
}
],
"inputAnchors": [],
"inputs": {
"sessionId": "",
"memoryKey": "chat_history"
},
"outputAnchors": [
{
"id": "bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
"name": "bufferMemory",
"label": "BufferMemory",
"type": "BufferMemory | BaseChatMemory | BaseMemory"
}
],
"outputs": {},
"selected": false
},
"positionAbsolute": {
"x": 607.6260576768354,
"y": 584.7920541862369
},
"selected": false,
"dragging": false
},
{
"width": 300,
"height": 282,
"id": "serpAPI_0",
"position": {
"x": 439.29908455642476,
"y": 48.06000078669291
},
"type": "customNode",
"data": {
"id": "serpAPI_0",
"label": "Serp API",
"version": 1,
"name": "serpAPI",
"type": "SerpAPI",
"baseClasses": ["SerpAPI", "Tool", "StructuredTool"],
"category": "Tools",
"description": "Wrapper around SerpAPI - a real-time API to access Google search results",
"inputParams": [
{
"label": "Connect Credential",
"name": "credential",
"type": "credential",
"credentialNames": ["serpApi"],
"id": "serpAPI_0-input-credential-credential"
}
],
"inputAnchors": [],
"inputs": {},
"outputAnchors": [
{
"id": "serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool",
"name": "serpAPI",
"label": "SerpAPI",
"type": "SerpAPI | Tool | StructuredTool"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 439.29908455642476,
"y": 48.06000078669291
},
"dragging": false
},
{
"width": 300,
"height": 772,
"id": "chatOpenAI_0",
"position": {
"x": 97.01321406237057,
"y": 63.67664262280914
},
"type": "customNode",
"data": {
"id": "chatOpenAI_0",
"label": "ChatOpenAI",
"version": 8.2,
"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",
"display": true
},
{
"label": "Model Name",
"name": "modelName",
"type": "asyncOptions",
"loadMethod": "listModels",
"default": "gpt-4o-mini",
"id": "chatOpenAI_0-input-modelName-asyncOptions",
"display": true
},
{
"label": "Temperature",
"name": "temperature",
"type": "number",
"step": 0.1,
"default": 0.9,
"optional": true,
"id": "chatOpenAI_0-input-temperature-number",
"display": true
},
{
"label": "Streaming",
"name": "streaming",
"type": "boolean",
"default": true,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-streaming-boolean",
"display": true
},
{
"label": "Max Tokens",
"name": "maxTokens",
"type": "number",
"step": 1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-maxTokens-number",
"display": true
},
{
"label": "Top Probability",
"name": "topP",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-topP-number",
"display": true
},
{
"label": "Frequency Penalty",
"name": "frequencyPenalty",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-frequencyPenalty-number",
"display": true
},
{
"label": "Presence Penalty",
"name": "presencePenalty",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-presencePenalty-number",
"display": true
},
{
"label": "Timeout",
"name": "timeout",
"type": "number",
"step": 1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-timeout-number",
"display": true
},
{
"label": "Strict Tool Calling",
"name": "strictToolCalling",
"type": "boolean",
"description": "Whether the model supports the `strict` argument when passing in tools. If not specified, the `strict` argument will not be passed to OpenAI.",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-strictToolCalling-boolean",
"display": true
},
{
"label": "Stop Sequence",
"name": "stopSequence",
"type": "string",
"rows": 4,
"optional": true,
"description": "List of stop words to use when generating. Use comma to separate multiple stop words.",
"additionalParams": true,
"id": "chatOpenAI_0-input-stopSequence-string",
"display": true
},
{
"label": "BasePath",
"name": "basepath",
"type": "string",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-basepath-string",
"display": true
},
{
"label": "Proxy Url",
"name": "proxyUrl",
"type": "string",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-proxyUrl-string",
"display": true
},
{
"label": "BaseOptions",
"name": "baseOptions",
"type": "json",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-baseOptions-json",
"display": true
},
{
"label": "Allow Image Uploads",
"name": "allowImageUploads",
"type": "boolean",
"description": "Allow image input. Refer to the <a href=\"https://docs.flowiseai.com/using-flowise/uploads#image\" target=\"_blank\">docs</a> for more details.",
"default": false,
"optional": true,
"id": "chatOpenAI_0-input-allowImageUploads-boolean",
"display": true
},
{
"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,
"show": {
"allowImageUploads": true
},
"id": "chatOpenAI_0-input-imageResolution-options",
"display": true
},
{
"label": "Reasoning Effort",
"description": "Constrains effort on reasoning for reasoning models. Only applicable for o1 and o3 models.",
"name": "reasoningEffort",
"type": "options",
"options": [
{
"label": "Low",
"name": "low"
},
{
"label": "Medium",
"name": "medium"
},
{
"label": "High",
"name": "high"
}
],
"default": "medium",
"optional": false,
"additionalParams": true,
"id": "chatOpenAI_0-input-reasoningEffort-options",
"display": true
}
],
"inputAnchors": [
{
"label": "Cache",
"name": "cache",
"type": "BaseCache",
"optional": true,
"id": "chatOpenAI_0-input-cache-BaseCache",
"display": true
}
],
"inputs": {
"cache": "",
"modelName": "gpt-4o-mini",
"temperature": 0.9,
"streaming": true,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"strictToolCalling": "",
"stopSequence": "",
"basepath": "",
"proxyUrl": "",
"baseOptions": "",
"allowImageUploads": true,
"imageResolution": "low",
"reasoningEffort": "medium"
},
"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
},
"selected": false,
"positionAbsolute": {
"x": 97.01321406237057,
"y": 63.67664262280914
},
"dragging": false
},
{
"id": "stickyNote_0",
"position": {
"x": 1197.3578961103253,
"y": 117.43214592301385
},
"type": "stickyNote",
"data": {
"id": "stickyNote_0",
"label": "Sticky Note",
"version": 2,
"name": "stickyNote",
"type": "StickyNote",
"baseClasses": ["StickyNote"],
"tags": ["Utilities"],
"category": "Utilities",
"description": "Add a sticky note",
"inputParams": [
{
"label": "",
"name": "note",
"type": "string",
"rows": 1,
"placeholder": "Type something here",
"optional": true,
"id": "stickyNote_0-input-note-string"
}
],
"inputAnchors": [],
"inputs": {
"note": "LLM has to be function calling compatible"
},
"outputAnchors": [
{
"id": "stickyNote_0-output-stickyNote-StickyNote",
"name": "stickyNote",
"label": "StickyNote",
"description": "Add a sticky note",
"type": "StickyNote"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 62,
"selected": false,
"positionAbsolute": {
"x": 1197.3578961103253,
"y": 117.43214592301385
},
"dragging": false
},
{
"id": "toolAgent_0",
"position": {
"x": 1200.6756893536506,
"y": 208.18578883272318
},
"type": "customNode",
"data": {
"id": "toolAgent_0",
"label": "Tool Agent",
"version": 2,
"name": "toolAgent",
"type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents",
"description": "Agent that uses Function Calling to pick the tools and args to call",
"inputParams": [
{
"label": "System Message",
"name": "systemMessage",
"type": "string",
"default": "You are a helpful AI assistant.",
"description": "If Chat Prompt Template is provided, this will be ignored",
"rows": 4,
"optional": true,
"additionalParams": true,
"id": "toolAgent_0-input-systemMessage-string",
"display": true
},
{
"label": "Max Iterations",
"name": "maxIterations",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "toolAgent_0-input-maxIterations-number",
"display": true
},
{
"label": "Enable Detailed Streaming",
"name": "enableDetailedStreaming",
"type": "boolean",
"default": false,
"description": "Stream detailed intermediate steps during agent execution",
"optional": true,
"additionalParams": true,
"id": "toolAgent_0-input-enableDetailedStreaming-boolean",
"display": true
}
],
"inputAnchors": [
{
"label": "Tools",
"name": "tools",
"type": "Tool",
"list": true,
"id": "toolAgent_0-input-tools-Tool",
"display": true
},
{
"label": "Memory",
"name": "memory",
"type": "BaseChatMemory",
"id": "toolAgent_0-input-memory-BaseChatMemory",
"display": 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, ChatVertexAI, GroqChat",
"id": "toolAgent_0-input-model-BaseChatModel",
"display": true
},
{
"label": "Chat Prompt Template",
"name": "chatPromptTemplate",
"type": "ChatPromptTemplate",
"description": "Override existing prompt with Chat Prompt Template. Human Message must includes {input} variable",
"optional": true,
"id": "toolAgent_0-input-chatPromptTemplate-ChatPromptTemplate",
"display": 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,
"id": "toolAgent_0-input-inputModeration-Moderation",
"display": true
}
],
"inputs": {
"tools": ["{{calculator_1.data.instance}}", "{{serpAPI_0.data.instance}}"],
"memory": "{{bufferMemory_1.data.instance}}",
"model": "{{chatOpenAI_0.data.instance}}",
"chatPromptTemplate": "",
"systemMessage": "You are a helpful AI assistant.",
"inputModeration": "",
"maxIterations": "",
"enableDetailedStreaming": ""
},
"outputAnchors": [
{
"id": "toolAgent_0-output-toolAgent-AgentExecutor|BaseChain|Runnable",
"name": "toolAgent",
"label": "AgentExecutor",
"description": "Agent that uses Function Calling to pick the tools and args to call",
"type": "AgentExecutor | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 492,
"selected": false,
"positionAbsolute": {
"x": 1200.6756893536506,
"y": 208.18578883272318
},
"dragging": false
}
],
"edges": [
{
"source": "calculator_1",
"sourceHandle": "calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain",
"target": "toolAgent_0",
"targetHandle": "toolAgent_0-input-tools-Tool",
"type": "buttonedge",
"id": "calculator_1-calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain-toolAgent_0-toolAgent_0-input-tools-Tool"
},
{
"source": "serpAPI_0",
"sourceHandle": "serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool",
"target": "toolAgent_0",
"targetHandle": "toolAgent_0-input-tools-Tool",
"type": "buttonedge",
"id": "serpAPI_0-serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool-toolAgent_0-toolAgent_0-input-tools-Tool"
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "toolAgent_0",
"targetHandle": "toolAgent_0-input-model-BaseChatModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-toolAgent_0-toolAgent_0-input-model-BaseChatModel"
},
{
"source": "bufferMemory_1",
"sourceHandle": "bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
"target": "toolAgent_0",
"targetHandle": "toolAgent_0-input-memory-BaseChatMemory",
"type": "buttonedge",
"id": "bufferMemory_1-bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-toolAgent_0-toolAgent_0-input-memory-BaseChatMemory"
}
]
}
File diff suppressed because one or more lines are too long
@@ -1,424 +0,0 @@
{
"description": "Language translation using LLM Chain with a Chat Prompt Template and Chat Model",
"usecases": ["Basic"],
"framework": ["Langchain"],
"nodes": [
{
"width": 300,
"height": 690,
"id": "chatPromptTemplate_0",
"position": {
"x": 88.10922294721732,
"y": 373.4354021348812
},
"type": "customNode",
"data": {
"id": "chatPromptTemplate_0",
"label": "Chat Prompt Template",
"version": 1,
"name": "chatPromptTemplate",
"type": "ChatPromptTemplate",
"baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate"],
"category": "Prompts",
"description": "Schema to represent a chat prompt",
"inputParams": [
{
"label": "System Message",
"name": "systemMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
"id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
},
{
"label": "Human Message",
"name": "humanMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "{text}",
"id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
},
{
"label": "Format Prompt Values",
"name": "promptValues",
"type": "json",
"optional": true,
"acceptVariable": true,
"list": true,
"id": "chatPromptTemplate_0-input-promptValues-json"
}
],
"inputAnchors": [],
"inputs": {
"systemMessagePrompt": "You are a helpful assistant that translates {input_language} to {output_language}.",
"humanMessagePrompt": "{text}",
"promptValues": "{\"input_language\":\"English\",\"output_language\":\"French\",\"text\":\"\"}"
},
"outputAnchors": [
{
"id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate",
"name": "chatPromptTemplate",
"label": "ChatPromptTemplate",
"type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 88.10922294721732,
"y": 373.4354021348812
},
"dragging": false
},
{
"width": 300,
"height": 670,
"id": "chatOpenAI_0",
"position": {
"x": 423.0077090865524,
"y": 380.66673510213775
},
"type": "customNode",
"data": {
"id": "chatOpenAI_0",
"label": "ChatOpenAI",
"version": 6,
"name": "chatOpenAI",
"type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"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-options"
},
{
"label": "Temperature",
"name": "temperature",
"type": "number",
"default": 0.9,
"optional": true,
"id": "chatOpenAI_0-input-temperature-number"
},
{
"label": "Max Tokens",
"name": "maxTokens",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-maxTokens-number"
},
{
"label": "Top Probability",
"name": "topP",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-topP-number"
},
{
"label": "Frequency Penalty",
"name": "frequencyPenalty",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-frequencyPenalty-number"
},
{
"label": "Presence Penalty",
"name": "presencePenalty",
"type": "number",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-presencePenalty-number"
},
{
"label": "Timeout",
"name": "timeout",
"type": "number",
"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": {
"modelName": "gpt-3.5-turbo",
"temperature": "0",
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"basepath": "",
"baseOptions": "",
"allowImageUploads": true,
"imageResolution": "low"
},
"outputAnchors": [
{
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"name": "chatOpenAI",
"label": "ChatOpenAI",
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 423.0077090865524,
"y": 380.66673510213775
},
"dragging": false
},
{
"width": 300,
"height": 508,
"id": "llmChain_0",
"position": {
"x": 774.5069894501554,
"y": 480.02655553818863
},
"type": "customNode",
"data": {
"id": "llmChain_0",
"label": "LLM Chain",
"version": 3,
"name": "llmChain",
"type": "LLMChain",
"baseClasses": ["LLMChain", "BaseChain", "Runnable"],
"category": "Chains",
"description": "Chain to run queries against LLMs",
"inputParams": [
{
"label": "Chain Name",
"name": "chainName",
"type": "string",
"placeholder": "Name Your Chain",
"optional": true,
"id": "llmChain_0-input-chainName-string"
}
],
"inputAnchors": [
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "llmChain_0-input-model-BaseLanguageModel"
},
{
"label": "Prompt",
"name": "prompt",
"type": "BasePromptTemplate",
"id": "llmChain_0-input-prompt-BasePromptTemplate"
},
{
"label": "Output Parser",
"name": "outputParser",
"type": "BaseLLMOutputParser",
"optional": true,
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
},
{
"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": "llmChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"model": "{{chatOpenAI_0.data.instance}}",
"prompt": "{{chatPromptTemplate_0.data.instance}}",
"outputParser": "",
"chainName": "Language Translation",
"inputModeration": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"options": [
{
"id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
"name": "llmChain",
"label": "LLM Chain",
"type": "LLMChain | BaseChain | Runnable"
},
{
"id": "llmChain_0-output-outputPrediction-string|json",
"name": "outputPrediction",
"label": "Output Prediction",
"type": "string | json"
}
],
"default": "llmChain"
}
],
"outputs": {
"output": "llmChain"
},
"selected": false
},
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": 774.5069894501554,
"y": 480.02655553818863
}
},
{
"id": "stickyNote_0",
"position": {
"x": -258.15932684125505,
"y": 656.5109602097457
},
"type": "stickyNote",
"data": {
"id": "stickyNote_0",
"label": "Sticky Note",
"version": 2,
"name": "stickyNote",
"type": "StickyNote",
"baseClasses": ["StickyNote"],
"tags": ["Utilities"],
"category": "Utilities",
"description": "Add a sticky note",
"inputParams": [
{
"label": "",
"name": "note",
"type": "string",
"rows": 1,
"placeholder": "Type something here",
"optional": true,
"id": "stickyNote_0-input-note-string"
}
],
"inputAnchors": [],
"inputs": {
"note": "In the Format Prompt Values, we can specify the variables used in prompt.\n\n{\n input_language: \"English\",\n output_language: \"French\"\n}\n\nIf the last variable is not specified, in this case {text}, user question will be used as value."
},
"outputAnchors": [
{
"id": "stickyNote_0-output-stickyNote-StickyNote",
"name": "stickyNote",
"label": "StickyNote",
"description": "Add a sticky note",
"type": "StickyNote"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 243,
"selected": false,
"positionAbsolute": {
"x": -258.15932684125505,
"y": 656.5109602097457
},
"dragging": false
}
],
"edges": [
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
"data": {
"label": ""
}
},
{
"source": "chatPromptTemplate_0",
"sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
"type": "buttonedge",
"id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
"data": {
"label": ""
}
}
]
}
@@ -1,398 +0,0 @@
{
"description": "Using Vectara for Retrieval Augmented Generation (RAG) to answer questions from documents",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"nodes": [
{
"width": 300,
"height": 520,
"id": "vectaraQAChain_0",
"position": {
"x": 740.28434119739,
"y": 164.93261446841598
},
"type": "customNode",
"data": {
"id": "vectaraQAChain_0",
"label": "Vectara QA Chain",
"version": 2,
"name": "vectaraQAChain",
"type": "VectaraQAChain",
"baseClasses": ["VectaraQAChain", "BaseChain", "Runnable"],
"category": "Chains",
"description": "QA chain for Vectara",
"inputParams": [
{
"label": "Summarizer Prompt Name",
"name": "summarizerPromptName",
"description": "Summarize the results fetched from Vectara. Read <a target=\"_blank\" href=\"https://docs.vectara.com/docs/learn/grounded-generation/select-a-summarizer\">more</a>",
"type": "options",
"options": [
{
"label": "vectara-summary-ext-v1.2.0 (gpt-3.5-turbo)",
"name": "vectara-summary-ext-v1.2.0"
},
{
"label": "vectara-experimental-summary-ext-2023-10-23-small (gpt-3.5-turbo)",
"name": "vectara-experimental-summary-ext-2023-10-23-small",
"description": "In beta, available to both Growth and Scale Vectara users"
},
{
"label": "vectara-summary-ext-v1.3.0 (gpt-4.0)",
"name": "vectara-summary-ext-v1.3.0",
"description": "Only available to paying Scale Vectara users"
},
{
"label": "vectara-experimental-summary-ext-2023-10-23-med (gpt-4.0)",
"name": "vectara-experimental-summary-ext-2023-10-23-med",
"description": "In beta, only available to paying Scale Vectara users"
}
],
"default": "vectara-summary-ext-v1.2.0",
"id": "vectaraQAChain_0-input-summarizerPromptName-options"
},
{
"label": "Response Language",
"name": "responseLang",
"description": "Return the response in specific language. If not selected, Vectara will automatically detects the language. Read <a target=\"_blank\" href=\"https://docs.vectara.com/docs/learn/grounded-generation/grounded-generation-response-languages\">more</a>",
"type": "options",
"options": [
{
"label": "English",
"name": "eng"
},
{
"label": "German",
"name": "deu"
},
{
"label": "French",
"name": "fra"
},
{
"label": "Chinese",
"name": "zho"
},
{
"label": "Korean",
"name": "kor"
},
{
"label": "Arabic",
"name": "ara"
},
{
"label": "Russian",
"name": "rus"
},
{
"label": "Thai",
"name": "tha"
},
{
"label": "Dutch",
"name": "nld"
},
{
"label": "Italian",
"name": "ita"
},
{
"label": "Portuguese",
"name": "por"
},
{
"label": "Spanish",
"name": "spa"
},
{
"label": "Japanese",
"name": "jpn"
},
{
"label": "Polish",
"name": "pol"
},
{
"label": "Turkish",
"name": "tur"
},
{
"label": "Vietnamese",
"name": "vie"
},
{
"label": "Indonesian",
"name": "ind"
},
{
"label": "Czech",
"name": "ces"
},
{
"label": "Ukrainian",
"name": "ukr"
},
{
"label": "Greek",
"name": "ell"
},
{
"label": "Hebrew",
"name": "heb"
},
{
"label": "Farsi/Persian",
"name": "fas"
},
{
"label": "Hindi",
"name": "hin"
},
{
"label": "Urdu",
"name": "urd"
},
{
"label": "Swedish",
"name": "swe"
},
{
"label": "Bengali",
"name": "ben"
},
{
"label": "Malay",
"name": "msa"
},
{
"label": "Romanian",
"name": "ron"
}
],
"optional": true,
"default": "eng",
"id": "vectaraQAChain_0-input-responseLang-options"
},
{
"label": "Max Summarized Results",
"name": "maxSummarizedResults",
"description": "Maximum results used to build the summarized response",
"type": "number",
"default": 7,
"id": "vectaraQAChain_0-input-maxSummarizedResults-number"
}
],
"inputAnchors": [
{
"label": "Vectara Store",
"name": "vectaraStore",
"type": "VectorStore",
"id": "vectaraQAChain_0-input-vectaraStore-VectorStore"
},
{
"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": "vectaraQAChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"inputModeration": "",
"vectaraStore": "{{vectara_1.data.instance}}",
"summarizerPromptName": "vectara-experimental-summary-ext-2023-10-23-small",
"responseLang": "eng",
"maxSummarizedResults": 7
},
"outputAnchors": [
{
"id": "vectaraQAChain_0-output-vectaraQAChain-VectaraQAChain|BaseChain|Runnable",
"name": "vectaraQAChain",
"label": "VectaraQAChain",
"type": "VectaraQAChain | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 740.28434119739,
"y": 164.93261446841598
},
"dragging": false
},
{
"width": 300,
"height": 536,
"id": "vectara_1",
"position": {
"x": 139.43135627266395,
"y": 189.3685569634871
},
"type": "customNode",
"data": {
"id": "vectara_1",
"label": "Vectara",
"version": 2,
"name": "vectara",
"type": "Vectara",
"baseClasses": ["Vectara", "VectorStoreRetriever", "BaseRetriever"],
"category": "Vector Stores",
"description": "Upsert embedded data and perform similarity search upon query using Vectara, a LLM-powered search-as-a-service",
"inputParams": [
{
"label": "Connect Credential",
"name": "credential",
"type": "credential",
"credentialNames": ["vectaraApi"],
"id": "vectara_1-input-credential-credential"
},
{
"label": "File",
"name": "file",
"description": "File to upload to Vectara. Supported file types: https://docs.vectara.com/docs/api-reference/indexing-apis/file-upload/file-upload-filetypes",
"type": "file",
"optional": true,
"id": "vectara_1-input-file-file"
},
{
"label": "Metadata Filter",
"name": "filter",
"description": "Filter to apply to Vectara metadata. Refer to the <a target=\"_blank\" href=\"https://docs.flowiseai.com/vector-stores/vectara\">documentation</a> on how to use Vectara filters with Flowise.",
"type": "string",
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-filter-string"
},
{
"label": "Sentences Before",
"name": "sentencesBefore",
"description": "Number of sentences to fetch before the matched sentence. Defaults to 2.",
"type": "number",
"default": 2,
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-sentencesBefore-number"
},
{
"label": "Sentences After",
"name": "sentencesAfter",
"description": "Number of sentences to fetch after the matched sentence. Defaults to 2.",
"type": "number",
"default": 2,
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-sentencesAfter-number"
},
{
"label": "Lambda",
"name": "lambda",
"description": "Enable hybrid search to improve retrieval accuracy by adjusting the balance (from 0 to 1) between neural search and keyword-based search factors.A value of 0.0 means that only neural search is used, while a value of 1.0 means that only keyword-based search is used. Defaults to 0.0 (neural only).",
"default": 0,
"type": "number",
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-lambda-number"
},
{
"label": "Top K",
"name": "topK",
"description": "Number of top results to fetch. Defaults to 5",
"placeholder": "5",
"type": "number",
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-topK-number"
},
{
"label": "MMR K",
"name": "mmrK",
"description": "Number of top results to fetch for MMR. Defaults to 50",
"placeholder": "50",
"type": "number",
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-mmrK-number"
},
{
"label": "MMR diversity bias",
"name": "mmrDiversityBias",
"step": 0.1,
"description": "The diversity bias to use for MMR. This is a value between 0.0 and 1.0Values closer to 1.0 optimize for the most diverse results.Defaults to 0 (MMR disabled)",
"placeholder": "0.0",
"type": "number",
"additionalParams": true,
"optional": true,
"id": "vectara_1-input-mmrDiversityBias-number"
}
],
"inputAnchors": [
{
"label": "Document",
"name": "document",
"type": "Document",
"list": true,
"optional": true,
"id": "vectara_1-input-document-Document"
}
],
"inputs": {
"document": "",
"filter": "",
"sentencesBefore": 2,
"sentencesAfter": 2,
"lambda": "",
"topK": "",
"mmrK": "",
"mmrDiversityBias": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"options": [
{
"id": "vectara_1-output-retriever-Vectara|VectorStoreRetriever|BaseRetriever",
"name": "retriever",
"label": "Vectara Retriever",
"type": "Vectara | VectorStoreRetriever | BaseRetriever"
},
{
"id": "vectara_1-output-vectorStore-Vectara|VectorStore",
"name": "vectorStore",
"label": "Vectara Vector Store",
"type": "Vectara | VectorStore"
}
],
"default": "retriever"
}
],
"outputs": {
"output": "vectorStore"
},
"selected": false
},
"positionAbsolute": {
"x": 139.43135627266395,
"y": 189.3685569634871
},
"selected": false,
"dragging": false
}
],
"edges": [
{
"source": "vectara_1",
"sourceHandle": "vectara_1-output-vectorStore-Vectara|VectorStore",
"target": "vectaraQAChain_0",
"targetHandle": "vectaraQAChain_0-input-vectaraStore-VectorStore",
"type": "buttonedge",
"id": "vectara_1-vectara_1-output-vectorStore-Vectara|VectorStore-vectaraQAChain_0-vectaraQAChain_0-input-vectaraStore-VectorStore"
}
]
}
@@ -1,788 +0,0 @@
{
"description": "Scrape web pages to be used with Retrieval Augmented Generation (RAG) for question answering",
"usecases": ["Documents QnA"],
"framework": ["Langchain"],
"badge": "POPULAR",
"nodes": [
{
"width": 300,
"height": 424,
"id": "openAIEmbeddings_0",
"position": {
"x": 805.4033852865127,
"y": 289.17383087232275
},
"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
},
"selected": false,
"positionAbsolute": {
"x": 805.4033852865127,
"y": 289.17383087232275
},
"dragging": false
},
{
"width": 300,
"height": 378,
"id": "htmlToMarkdownTextSplitter_0",
"position": {
"x": 459.0189921792261,
"y": -21.97787557438943
},
"type": "customNode",
"data": {
"id": "htmlToMarkdownTextSplitter_0",
"label": "HtmlToMarkdown Text Splitter",
"version": 1,
"name": "htmlToMarkdownTextSplitter",
"type": "HtmlToMarkdownTextSplitter",
"baseClasses": [
"HtmlToMarkdownTextSplitter",
"MarkdownTextSplitter",
"RecursiveCharacterTextSplitter",
"TextSplitter",
"BaseDocumentTransformer"
],
"category": "Text Splitters",
"description": "Converts Html to Markdown and then split your content into documents based on the Markdown headers",
"inputParams": [
{
"label": "Chunk Size",
"name": "chunkSize",
"type": "number",
"default": 1000,
"optional": true,
"id": "htmlToMarkdownTextSplitter_0-input-chunkSize-number"
},
{
"label": "Chunk Overlap",
"name": "chunkOverlap",
"type": "number",
"optional": true,
"id": "htmlToMarkdownTextSplitter_0-input-chunkOverlap-number"
}
],
"inputAnchors": [],
"inputs": {
"chunkSize": "4000",
"chunkOverlap": ""
},
"outputAnchors": [
{
"id": "htmlToMarkdownTextSplitter_0-output-htmlToMarkdownTextSplitter-HtmlToMarkdownTextSplitter|MarkdownTextSplitter|RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer",
"name": "htmlToMarkdownTextSplitter",
"label": "HtmlToMarkdownTextSplitter",
"type": "HtmlToMarkdownTextSplitter | MarkdownTextSplitter | RecursiveCharacterTextSplitter | TextSplitter | BaseDocumentTransformer"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 459.0189921792261,
"y": -21.97787557438943
},
"dragging": false
},
{
"width": 300,
"height": 532,
"id": "conversationalRetrievalQAChain_0",
"position": {
"x": 1892.82894546983,
"y": 282.2572649522094
},
"type": "customNode",
"data": {
"id": "conversationalRetrievalQAChain_0",
"label": "Conversational Retrieval QA Chain",
"version": 3,
"name": "conversationalRetrievalQAChain",
"type": "ConversationalRetrievalQAChain",
"baseClasses": ["ConversationalRetrievalQAChain", "BaseChain", "Runnable"],
"category": "Chains",
"description": "Document QA - built on RetrievalQAChain to provide a chat history component",
"inputParams": [
{
"label": "Return Source Documents",
"name": "returnSourceDocuments",
"type": "boolean",
"optional": true,
"id": "conversationalRetrievalQAChain_0-input-returnSourceDocuments-boolean"
},
{
"label": "Rephrase Prompt",
"name": "rephrasePrompt",
"type": "string",
"description": "Using previous chat history, rephrase question into a standalone question",
"warning": "Prompt must include input variables: {chat_history} and {question}",
"rows": 4,
"additionalParams": true,
"optional": true,
"default": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
"id": "conversationalRetrievalQAChain_0-input-rephrasePrompt-string"
},
{
"label": "Response Prompt",
"name": "responsePrompt",
"type": "string",
"description": "Taking the rephrased question, search for answer from the provided context",
"warning": "Prompt must include input variable: {context}",
"rows": 4,
"additionalParams": true,
"optional": true,
"default": "You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.",
"id": "conversationalRetrievalQAChain_0-input-responsePrompt-string"
}
],
"inputAnchors": [
{
"label": "Chat Model",
"name": "model",
"type": "BaseChatModel",
"id": "conversationalRetrievalQAChain_0-input-model-BaseChatModel"
},
{
"label": "Vector Store Retriever",
"name": "vectorStoreRetriever",
"type": "BaseRetriever",
"id": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever"
},
{
"label": "Memory",
"name": "memory",
"type": "BaseMemory",
"optional": true,
"description": "If left empty, a default BufferMemory will be used",
"id": "conversationalRetrievalQAChain_0-input-memory-BaseMemory"
},
{
"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": "conversationalRetrievalQAChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"inputModeration": "",
"model": "{{chatOpenAI_0.data.instance}}",
"vectorStoreRetriever": "{{pinecone_0.data.instance}}",
"memory": "",
"returnSourceDocuments": true,
"rephrasePrompt": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
"responsePrompt": "You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer."
},
"outputAnchors": [
{
"id": "conversationalRetrievalQAChain_0-output-conversationalRetrievalQAChain-ConversationalRetrievalQAChain|BaseChain|Runnable",
"name": "conversationalRetrievalQAChain",
"label": "ConversationalRetrievalQAChain",
"type": "ConversationalRetrievalQAChain | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1892.82894546983,
"y": 282.2572649522094
},
"dragging": false
},
{
"width": 300,
"height": 426,
"id": "cheerioWebScraper_0",
"position": {
"x": 815.9295655148293,
"y": -190.50425962124604
},
"type": "customNode",
"data": {
"id": "cheerioWebScraper_0",
"label": "Cheerio Web Scraper",
"version": 1.1,
"name": "cheerioWebScraper",
"type": "Document",
"baseClasses": ["Document"],
"category": "Document Loaders",
"description": "Load data from webpages",
"inputParams": [
{
"label": "URL",
"name": "url",
"type": "string",
"id": "cheerioWebScraper_0-input-url-string"
},
{
"label": "Get Relative Links Method",
"name": "relativeLinksMethod",
"type": "options",
"description": "Select a method to retrieve relative links",
"options": [
{
"label": "Web Crawl",
"name": "webCrawl",
"description": "Crawl relative links from HTML URL"
},
{
"label": "Scrape XML Sitemap",
"name": "scrapeXMLSitemap",
"description": "Scrape relative links from XML sitemap URL"
}
],
"optional": true,
"additionalParams": true,
"id": "cheerioWebScraper_0-input-relativeLinksMethod-options"
},
{
"label": "Get Relative Links Limit",
"name": "limit",
"type": "number",
"optional": true,
"additionalParams": true,
"description": "Only used when \"Get Relative Links Method\" is selected. Set 0 to retrieve all relative links, default limit is 10.",
"warning": "Retrieving all links might take long time, and all links will be upserted again if the flow's state changed (eg: different URL, chunk size, etc)",
"id": "cheerioWebScraper_0-input-limit-number"
},
{
"label": "Selector (CSS)",
"name": "selector",
"type": "string",
"description": "Specify a CSS selector to select the content to be extracted",
"optional": true,
"additionalParams": true,
"id": "cheerioWebScraper_0-input-selector-string"
},
{
"label": "Metadata",
"name": "metadata",
"type": "json",
"optional": true,
"additionalParams": true,
"id": "cheerioWebScraper_0-input-metadata-json"
}
],
"inputAnchors": [
{
"label": "Text Splitter",
"name": "textSplitter",
"type": "TextSplitter",
"optional": true,
"id": "cheerioWebScraper_0-input-textSplitter-TextSplitter"
}
],
"inputs": {
"url": "https://flowiseai.com/",
"textSplitter": "{{htmlToMarkdownTextSplitter_0.data.instance}}",
"relativeLinksMethod": "",
"limit": "",
"metadata": ""
},
"outputAnchors": [
{
"id": "cheerioWebScraper_0-output-cheerioWebScraper-Document",
"name": "cheerioWebScraper",
"label": "Document",
"type": "Document"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 815.9295655148293,
"y": -190.50425962124604
},
"dragging": false
},
{
"width": 300,
"height": 670,
"id": "chatOpenAI_0",
"position": {
"x": 1532.4907022314349,
"y": -270.38662863532466
},
"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-options"
},
{
"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-3.5-turbo",
"temperature": 0.9,
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"basepath": "",
"baseOptions": "",
"allowImageUploads": true,
"imageResolution": "low"
},
"outputAnchors": [
{
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"name": "chatOpenAI",
"label": "ChatOpenAI",
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1532.4907022314349,
"y": -270.38662863532466
},
"dragging": false
},
{
"width": 300,
"height": 555,
"id": "pinecone_0",
"position": {
"x": 1182.9660159923678,
"y": 56.45789225898284
},
"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"
}
],
"inputs": {
"document": ["{{cheerioWebScraper_0.data.instance}}"],
"embeddings": "{{openAIEmbeddings_0.data.instance}}",
"pineconeIndex": "",
"pineconeNamespace": "",
"pineconeMetadataFilter": "",
"topK": "",
"searchType": "similarity",
"fetchK": "",
"lambda": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"options": [
{
"id": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever",
"name": "retriever",
"label": "Pinecone Retriever",
"type": "Pinecone | VectorStoreRetriever | BaseRetriever"
},
{
"id": "pinecone_0-output-vectorStore-Pinecone|VectorStore",
"name": "vectorStore",
"label": "Pinecone Vector Store",
"type": "Pinecone | VectorStore"
}
],
"default": "retriever"
}
],
"outputs": {
"output": "retriever"
},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1182.9660159923678,
"y": 56.45789225898284
},
"dragging": false
}
],
"edges": [
{
"source": "htmlToMarkdownTextSplitter_0",
"sourceHandle": "htmlToMarkdownTextSplitter_0-output-htmlToMarkdownTextSplitter-HtmlToMarkdownTextSplitter|MarkdownTextSplitter|RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer",
"target": "cheerioWebScraper_0",
"targetHandle": "cheerioWebScraper_0-input-textSplitter-TextSplitter",
"type": "buttonedge",
"id": "htmlToMarkdownTextSplitter_0-htmlToMarkdownTextSplitter_0-output-htmlToMarkdownTextSplitter-HtmlToMarkdownTextSplitter|MarkdownTextSplitter|RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer-cheerioWebScraper_0-cheerioWebScraper_0-input-textSplitter-TextSplitter",
"data": {
"label": ""
}
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "conversationalRetrievalQAChain_0",
"targetHandle": "conversationalRetrievalQAChain_0-input-model-BaseChatModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-model-BaseChatModel",
"data": {
"label": ""
}
},
{
"source": "cheerioWebScraper_0",
"sourceHandle": "cheerioWebScraper_0-output-cheerioWebScraper-Document",
"target": "pinecone_0",
"targetHandle": "pinecone_0-input-document-Document",
"type": "buttonedge",
"id": "cheerioWebScraper_0-cheerioWebScraper_0-output-cheerioWebScraper-Document-pinecone_0-pinecone_0-input-document-Document",
"data": {
"label": ""
}
},
{
"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",
"data": {
"label": ""
}
},
{
"source": "pinecone_0",
"sourceHandle": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever",
"target": "conversationalRetrievalQAChain_0",
"targetHandle": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever",
"type": "buttonedge",
"id": "pinecone_0-pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever",
"data": {
"label": ""
}
}
]
}
@@ -116,8 +116,9 @@ const getAllAgentflowv2Marketplaces = async () => {
}
})
const title = file.split('.json')[0]
const template = {
title: file.split('.json')[0],
title,
description: fileDataObj.description || `Template from ${file}`,
usecases: fileDataObj.usecases || [],
nodes: filteredNodes,
@@ -126,7 +127,11 @@ const getAllAgentflowv2Marketplaces = async () => {
// Validate template against schema
const validatedTemplate = AgentFlowV2Type.parse(template)
templates.push(validatedTemplate)
templates.push({
...validatedTemplate,
// @ts-ignore
title: title
})
} catch (error) {
console.error(`Error processing template file ${file}:`, error)
// Continue with next file instead of failing completely
@@ -1613,8 +1613,12 @@ const upsertDocStore = async (
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, `Error: Invalid metadata`)
}
}
const replaceExisting = data.replaceExisting ?? false
const createNewDocStore = data.createNewDocStore ?? false
const replaceExisting =
typeof data.replaceExisting === 'string' ? (data.replaceExisting as string).toLowerCase() === 'true' : data.replaceExisting ?? false
const createNewDocStore =
typeof data.createNewDocStore === 'string'
? (data.createNewDocStore as string).toLowerCase() === 'true'
: data.createNewDocStore ?? false
const newLoader = typeof data.loader === 'string' ? JSON.parse(data.loader) : data.loader
const newSplitter = typeof data.splitter === 'string' ? JSON.parse(data.splitter) : data.splitter
const newVectorStore = typeof data.vectorStore === 'string' ? JSON.parse(data.vectorStore) : data.vectorStore
@@ -69,6 +69,8 @@ const getAllTemplates = async () => {
templates.push(template)
})
/*
* Agentflow is deprecated
marketplaceDir = path.join(__dirname, '..', '..', '..', 'marketplaces', 'agentflows')
jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json')
jsonsInDir.forEach((file) => {
@@ -87,7 +89,7 @@ const getAllTemplates = async () => {
description: fileDataObj?.description || ''
}
templates.push(template)
})
})*/
marketplaceDir = path.join(__dirname, '..', '..', '..', 'marketplaces', 'agentflowsv2')
jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json')
@@ -108,11 +110,24 @@ const getAllTemplates = async () => {
}
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) {
sortedTemplates.unshift(sortedTemplates.splice(FlowiseDocsQnAIndex, 1)[0])
}
const sortedTemplates = templates.sort((a, b) => {
// Prioritize AgentflowV2 templates first
if (a.type === 'AgentflowV2' && b.type !== 'AgentflowV2') {
return -1
}
if (b.type === 'AgentflowV2' && a.type !== 'AgentflowV2') {
return 1
}
// Put Tool templates last
if (a.type === 'Tool' && b.type !== 'Tool') {
return 1
}
if (b.type === 'Tool' && a.type !== 'Tool') {
return -1
}
// For same types, sort alphabetically by templateName
return a.templateName.localeCompare(b.templateName)
})
const dbResponse = sortedTemplates
return dbResponse
} catch (error) {
+34 -3
View File
@@ -40,7 +40,8 @@ import {
getGlobalVariable,
getStartingNode,
getTelemetryFlowObj,
QUESTION_VAR_PREFIX
QUESTION_VAR_PREFIX,
CURRENT_DATE_TIME_VAR_PREFIX
} from '.'
import { ChatFlow } from '../database/entities/ChatFlow'
import { Variable } from '../database/entities/Variable'
@@ -294,9 +295,18 @@ export const resolveVariables = async (
resolvedValue = resolvedValue.replace(match, flowConfig?.runtimeChatHistoryLength ?? 0)
}
if (variableFullPath === CURRENT_DATE_TIME_VAR_PREFIX) {
resolvedValue = resolvedValue.replace(match, new Date().toISOString())
}
if (variableFullPath.startsWith('$iteration')) {
if (iterationContext && iterationContext.value) {
if (typeof iterationContext.value === 'string') {
if (variableFullPath === '$iteration') {
// If it's exactly $iteration, stringify the entire value
const formattedValue =
typeof iterationContext.value === 'object' ? JSON.stringify(iterationContext.value) : iterationContext.value
resolvedValue = resolvedValue.replace(match, formattedValue)
} else if (typeof iterationContext.value === 'string') {
resolvedValue = resolvedValue.replace(match, iterationContext?.value)
} else if (typeof iterationContext.value === 'object') {
const iterationValue = get(iterationContext.value, variableFullPath.replace('$iteration.', ''))
@@ -342,8 +352,10 @@ export const resolveVariables = async (
const [, nodeIdPart, outputPath] = outputMatch
// Clean nodeId (handle escaped underscores)
const cleanNodeId = nodeIdPart.replace('\\', '')
// Find the last (most recent) matching node data instead of the first one
const nodeData = [...agentFlowExecutedData].reverse().find((d) => d.nodeId === cleanNodeId)
if (nodeData?.data?.output && outputPath.trim()) {
const variableValue = get(nodeData.data.output, outputPath)
if (variableValue !== undefined) {
@@ -1234,6 +1246,20 @@ const checkForMultipleStartNodes = (startingNodeIds: string[], isRecursive: bool
}
}
const parseFormStringToJson = (formString: string): Record<string, string> => {
const result: Record<string, string> = {}
const lines = formString.split('\n')
for (const line of lines) {
const [key, value] = line.split(': ').map((part) => part.trim())
if (key && value) {
result[key] = value
}
}
return result
}
/*
* Function to traverse the flow graph and execute the nodes
*/
@@ -1376,7 +1402,12 @@ export const executeAgentFlow = async ({
if (previousStartAgent) {
const previousStartAgentOutput = previousStartAgent.data.output
if (previousStartAgentOutput && typeof previousStartAgentOutput === 'object' && 'form' in previousStartAgentOutput) {
agentflowRuntime.form = previousStartAgentOutput.form
const formValues = previousStartAgentOutput.form
if (typeof formValues === 'string') {
agentflowRuntime.form = parseFormStringToJson(formValues)
} else {
agentflowRuntime.form = formValues
}
}
}
}
+1
View File
@@ -71,6 +71,7 @@ export const QUESTION_VAR_PREFIX = 'question'
export const FILE_ATTACHMENT_PREFIX = 'file_attachment'
export const CHAT_HISTORY_VAR_PREFIX = 'chat_history'
export const RUNTIME_MESSAGES_LENGTH_VAR_PREFIX = 'runtime_messages_length'
export const CURRENT_DATE_TIME_VAR_PREFIX = 'current_date_time'
export const REDACTED_CREDENTIAL_VALUE = '_FLOWISE_BLANK_07167752-1a71-43b1-bf8f-4f32252165db'
let secretsManagerClient: SecretsManagerClient | null = null
+7 -3
View File
@@ -28,17 +28,21 @@ if (process.env.STORAGE_TYPE === 's3') {
const customURL = process.env.S3_ENDPOINT_URL
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true'
if (!region || !s3Bucket) {
if (!region || region.trim() === '' || !s3Bucket || s3Bucket.trim() === '') {
throw new Error('S3 storage configuration is missing')
}
const s3Config: S3ClientConfig = {
region: region,
endpoint: customURL,
forcePathStyle: forcePathStyle
}
if (accessKeyId && secretAccessKey) {
// Only include endpoint if customURL is not empty
if (customURL && customURL.trim() !== '') {
s3Config.endpoint = customURL
}
if (accessKeyId && accessKeyId.trim() !== '' && secretAccessKey && secretAccessKey.trim() !== '') {
s3Config.credentials = {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey
@@ -166,7 +166,7 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, isAgentflowV2, s
}
try {
await updateChatflowApi.request(chatflow.id, updateBody)
if (isAgentCanvas && localStorage.getItem('agentFlowVersion') === 'v2') {
if (isAgentCanvas && isAgentflowV2) {
await updateFlowsApi.request('AGENTFLOW')
} else {
await updateFlowsApi.request(isAgentCanvas ? 'MULTIAGENT' : undefined)
@@ -241,7 +241,7 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, isAgentflowV2, s
if (isConfirmed) {
try {
await chatflowsApi.deleteChatflow(chatflow.id)
if (isAgentCanvas && localStorage.getItem('agentFlowVersion') === 'v2') {
if (isAgentCanvas && isAgentflowV2) {
await updateFlowsApi.request('AGENTFLOW')
} else {
await updateFlowsApi.request(isAgentCanvas ? 'MULTIAGENT' : undefined)
@@ -37,7 +37,7 @@ const extensions = (availableNodesForVariable, availableState, acceptNodeOutputA
]
// Add styled component for editor wrapper
const StyledEditorContent = styled(EditorContent)(({ theme, rows }) => ({
const StyledEditorContent = styled(EditorContent)(({ theme, rows, disabled }) => ({
'& .ProseMirror': {
padding: '0px 14px',
height: rows ? `${rows * 1.4375}rem` : '2.4rem',
@@ -45,30 +45,26 @@ const StyledEditorContent = styled(EditorContent)(({ theme, rows }) => ({
overflowX: rows ? 'auto' : 'hidden',
lineHeight: rows ? '1.4375em' : '0.875em',
fontWeight: 500,
color: theme.palette.grey[900],
color: disabled ? theme.palette.action.disabled : theme.palette.grey[900],
border: `1px solid ${theme.palette.grey[900] + 25}`,
borderRadius: '10px',
backgroundColor: theme.palette.textBackground.main,
boxSizing: 'border-box',
whiteSpace: rows ? 'pre-wrap' : 'nowrap',
'&:hover': {
borderColor: theme.palette.text.primary,
cursor: 'text'
borderColor: disabled ? `${theme.palette.grey[900] + 25}` : theme.palette.text.primary,
cursor: disabled ? 'default' : 'text'
},
'&:focus': {
borderColor: theme.palette.primary.main,
borderColor: disabled ? `${theme.palette.grey[900] + 25}` : theme.palette.primary.main,
outline: 'none'
},
'&[disabled]': {
backgroundColor: theme.palette.action.disabledBackground,
color: theme.palette.action.disabled
},
// Placeholder for first paragraph when editor is empty
'& p.is-editor-empty:first-of-type::before': {
content: 'attr(data-placeholder)',
float: 'left',
color: theme.palette.text.primary,
opacity: 0.4,
color: disabled ? theme.palette.action.disabled : theme.palette.text.primary,
opacity: disabled ? 0.6 : 0.4,
pointerEvents: 'none',
height: 0
}
@@ -121,7 +117,7 @@ export const RichInput = ({ inputParam, value, nodes, edges, nodeId, onChange, d
return (
<Box sx={{ mt: 1, border: '' }}>
<StyledEditorContent editor={editor} rows={inputParam?.rows} />
<StyledEditorContent editor={editor} rows={inputParam?.rows} disabled={disabled} />
</Box>
)
}
@@ -59,6 +59,12 @@ export const suggestionOptions = (
description: 'Past conversation history between user and AI',
category: 'Chat Context'
},
{
id: 'current_date_time',
mentionLabel: 'current_date_time',
description: 'Current date and time',
category: 'Chat Context'
},
{
id: 'runtime_messages_length',
mentionLabel: 'runtime_messages_length',
@@ -19,3 +19,45 @@
border-width: 1px !important;
padding: 10px !important;
}
.react-markdown h1,
.react-markdown h2,
.react-markdown h3,
.react-markdown h4,
.react-markdown h5,
.react-markdown h6 {
line-height: 1.4;
margin: 0.8em 0 0.4em 0;
font-weight: 600;
}
.react-markdown h1 {
font-size: 1.8em;
}
.react-markdown h2 {
font-size: 1.5em;
}
.react-markdown h3 {
font-size: 1.3em;
}
.react-markdown h4 {
font-size: 1.1em;
}
.react-markdown h5 {
font-size: 1em;
font-weight: 700;
}
.react-markdown h6 {
font-size: 0.9em;
font-weight: 700;
}
.react-markdown p {
line-height: 1.6;
margin: 0.5em 0;
}
@@ -87,7 +87,7 @@ export const FlowListTable = ({
if (!isAgentCanvas) {
return `/canvas/${row.id}`
} else {
return localStorage.getItem('agentFlowVersion') === 'v2' ? `/v2/agentcanvas/${row.id}` : `/agentcanvas/${row.id}`
return isAgentflowV2 ? `/v2/agentcanvas/${row.id}` : `/agentcanvas/${row.id}`
}
}
@@ -213,7 +213,13 @@ export const MarketplaceTable = ({
.split(';')
.map((tag, index) => (
<Chip
color={tag === 'POPULAR' ? 'primary' : 'error'}
color={
tag === 'POPULAR'
? 'primary'
: tag === 'DEPRECATED'
? 'warning'
: 'error'
}
key={index}
size='small'
label={tag.toUpperCase()}
@@ -1057,7 +1057,7 @@ const NodeInputHandler = ({
style={{
marginTop: '10px',
border: '1px solid',
borderColor: theme.palette.grey['300'],
borderColor: theme.palette.grey[900] + 25,
borderRadius: '6px',
height: inputParam.rows ? '100px' : '200px'
}}
@@ -1077,7 +1077,8 @@ const NodeInputHandler = ({
)}
{(inputParam.type === 'string' || inputParam.type === 'password' || inputParam.type === 'number') &&
(inputParam?.acceptVariable && window.location.href.includes('v2/agentcanvas') ? (
(inputParam?.acceptVariable &&
(window.location.href.includes('v2/agentcanvas') || window.location.href.includes('v2/marketplace')) ? (
<RichInput
key={data.inputs[inputParam.name]}
placeholder={inputParam.placeholder}
+1 -1
View File
@@ -57,7 +57,7 @@ import { gridSpacing } from '@/store/constant'
import { useError } from '@/store/context/ErrorContext'
const badges = ['POPULAR', 'NEW']
const types = ['Chatflow', 'Agentflow', 'AgentflowV2', 'Tool']
const types = ['Chatflow', 'AgentflowV2', 'Tool']
const framework = ['Langchain', 'LlamaIndex']
const MenuProps = {
PaperProps: {