fix memory nodes

bugfix/Memory-Nodes
Henry 2023-11-27 15:34:28 +00:00
parent 17198d8524
commit 3536c2afec
21 changed files with 301 additions and 294 deletions

View File

@ -8,7 +8,7 @@ class RedisCacheApi implements INodeCredential {
inputs: INodeParams[] inputs: INodeParams[]
constructor() { constructor() {
this.label = 'Redis Cache API' this.label = 'Redis API'
this.name = 'redisCacheApi' this.name = 'redisCacheApi'
this.version = 1.0 this.version = 1.0
this.inputs = [ this.inputs = [

View File

@ -8,7 +8,7 @@ class RedisCacheUrlApi implements INodeCredential {
inputs: INodeParams[] inputs: INodeParams[]
constructor() { constructor() {
this.label = 'Redis Cache URL' this.label = 'Redis URL'
this.name = 'redisCacheUrlApi' this.name = 'redisCacheUrlApi'
this.version = 1.0 this.version = 1.0
this.inputs = [ this.inputs = [
@ -16,7 +16,7 @@ class RedisCacheUrlApi implements INodeCredential {
label: 'Redis URL', label: 'Redis URL',
name: 'redisUrl', name: 'redisUrl',
type: 'string', type: 'string',
default: '127.0.0.1' default: 'redis://localhost:6379'
} }
] ]
} }

View File

@ -3,7 +3,7 @@ import { initializeAgentExecutorWithOptions, AgentExecutor, InitializeAgentExecu
import { Tool } from 'langchain/tools' import { Tool } from 'langchain/tools'
import { BaseChatMemory } from 'langchain/memory' import { BaseChatMemory } from 'langchain/memory'
import { getBaseClasses, mapChatHistory } from '../../../src/utils' import { getBaseClasses, mapChatHistory } from '../../../src/utils'
import { BaseLanguageModel } from 'langchain/base_language' import { BaseChatModel } from 'langchain/chat_models/base'
import { flatten } from 'lodash' import { flatten } from 'lodash'
import { additionalCallbacks } from '../../../src/handler' import { additionalCallbacks } from '../../../src/handler'
@ -29,7 +29,7 @@ class ConversationalAgent_Agents implements INode {
constructor() { constructor() {
this.label = 'Conversational Agent' this.label = 'Conversational Agent'
this.name = 'conversationalAgent' this.name = 'conversationalAgent'
this.version = 1.0 this.version = 2.0
this.type = 'AgentExecutor' this.type = 'AgentExecutor'
this.category = 'Agents' this.category = 'Agents'
this.icon = 'agent.svg' this.icon = 'agent.svg'
@ -45,7 +45,7 @@ class ConversationalAgent_Agents implements INode {
{ {
label: 'Language Model', label: 'Language Model',
name: 'model', name: 'model',
type: 'BaseLanguageModel' type: 'BaseChatModel'
}, },
{ {
label: 'Memory', label: 'Memory',
@ -65,7 +65,7 @@ class ConversationalAgent_Agents implements INode {
} }
async init(nodeData: INodeData): Promise<any> { async init(nodeData: INodeData): Promise<any> {
const model = nodeData.inputs?.model as BaseLanguageModel const model = nodeData.inputs?.model as BaseChatModel
let tools = nodeData.inputs?.tools as Tool[] let tools = nodeData.inputs?.tools as Tool[]
tools = flatten(tools) tools = flatten(tools)
const memory = nodeData.inputs?.memory as BaseChatMemory const memory = nodeData.inputs?.memory as BaseChatMemory
@ -92,8 +92,6 @@ class ConversationalAgent_Agents implements INode {
const executor = nodeData.instance as AgentExecutor const executor = nodeData.instance as AgentExecutor
const memory = nodeData.inputs?.memory as BaseChatMemory const memory = nodeData.inputs?.memory as BaseChatMemory
const callbacks = await additionalCallbacks(nodeData, options)
if (options && options.chatHistory) { if (options && options.chatHistory) {
const chatHistoryClassName = memory.chatHistory.constructor.name const chatHistoryClassName = memory.chatHistory.constructor.name
// Only replace when its In-Memory // Only replace when its In-Memory
@ -103,6 +101,10 @@ class ConversationalAgent_Agents implements INode {
} }
} }
;(executor.memory as any).returnMessages = true // Return true for BaseChatModel
const callbacks = await additionalCallbacks(nodeData, options)
const result = await executor.call({ input }, [...callbacks]) const result = await executor.call({ input }, [...callbacks])
return result?.output return result?.output
} }

View File

@ -82,6 +82,8 @@ class ConversationalRetrievalAgent_Agents implements INode {
if (executor.memory) { if (executor.memory) {
;(executor.memory as any).memoryKey = 'chat_history' ;(executor.memory as any).memoryKey = 'chat_history'
;(executor.memory as any).outputKey = 'output' ;(executor.memory as any).outputKey = 'output'
;(executor.memory as any).returnMessages = true
const chatHistoryClassName = (executor.memory as any).chatHistory.constructor.name const chatHistoryClassName = (executor.memory as any).chatHistory.constructor.name
// Only replace when its In-Memory // Only replace when its In-Memory
if (chatHistoryClassName && chatHistoryClassName === 'ChatMessageHistory') { if (chatHistoryClassName && chatHistoryClassName === 'ChatMessageHistory') {

View File

@ -87,6 +87,8 @@ class OpenAIFunctionAgent_Agents implements INode {
} }
} }
;(executor.memory as any).returnMessages = true // Return true for BaseChatModel
const loggerHandler = new ConsoleCallbackHandler(options.logger) const loggerHandler = new ConsoleCallbackHandler(options.logger)
const callbacks = await additionalCallbacks(nodeData, options) const callbacks = await additionalCallbacks(nodeData, options)

View File

@ -106,16 +106,18 @@ class ConversationChain_Chains implements INode {
async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string> { async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string> {
const chain = nodeData.instance as ConversationChain const chain = nodeData.instance as ConversationChain
const memory = nodeData.inputs?.memory as BufferMemory const memory = nodeData.inputs?.memory as BufferMemory
memory.returnMessages = true // Return true for BaseChatModel
if (options && options.chatHistory) { if (options && options.chatHistory) {
const chatHistoryClassName = memory.chatHistory.constructor.name const chatHistoryClassName = memory.chatHistory.constructor.name
// Only replace when its In-Memory // Only replace when its In-Memory
if (chatHistoryClassName && chatHistoryClassName === 'ChatMessageHistory') { if (chatHistoryClassName && chatHistoryClassName === 'ChatMessageHistory') {
memory.chatHistory = mapChatHistory(options) memory.chatHistory = mapChatHistory(options)
chain.memory = memory
} }
} }
chain.memory = memory
const loggerHandler = new ConsoleCallbackHandler(options.logger) const loggerHandler = new ConsoleCallbackHandler(options.logger)
const callbacks = await additionalCallbacks(nodeData, options) const callbacks = await additionalCallbacks(nodeData, options)

View File

@ -109,9 +109,8 @@ const initalizeDynamoDB = async (nodeData: INodeData, options: ICommonObject): P
}) })
const memory = new BufferMemoryExtended({ const memory = new BufferMemoryExtended({
memoryKey, memoryKey: memoryKey ?? 'chat_history',
chatHistory: dynamoDb, chatHistory: dynamoDb,
returnMessages: true,
isSessionIdUsingChatMessageId isSessionIdUsingChatMessageId
}) })
return memory return memory

View File

@ -123,9 +123,8 @@ const initializeMongoDB = async (nodeData: INodeData, options: ICommonObject): P
} }
return new BufferMemoryExtended({ return new BufferMemoryExtended({
memoryKey, memoryKey: memoryKey ?? 'chat_history',
chatHistory: mongoDBChatMessageHistory, chatHistory: mongoDBChatMessageHistory,
returnMessages: true,
isSessionIdUsingChatMessageId isSessionIdUsingChatMessageId
}) })
} }

View File

@ -137,7 +137,7 @@ const initalizeRedis = async (nodeData: INodeData, options: ICommonObject): Prom
} }
const memory = new BufferMemoryExtended({ const memory = new BufferMemoryExtended({
memoryKey, memoryKey: memoryKey ?? 'chat_history',
chatHistory: redisChatMessageHistory, chatHistory: redisChatMessageHistory,
isSessionIdUsingChatMessageId isSessionIdUsingChatMessageId
}) })

View File

@ -95,6 +95,7 @@ const initalizeUpstashRedis = async (nodeData: INodeData, options: ICommonObject
}) })
const memory = new BufferMemoryExtended({ const memory = new BufferMemoryExtended({
memoryKey: 'chat_history',
chatHistory: redisChatMessageHistory, chatHistory: redisChatMessageHistory,
isSessionIdUsingChatMessageId isSessionIdUsingChatMessageId
}) })

View File

@ -20,7 +20,7 @@ class OpenAIModeration implements INode {
this.name = 'inputModerationOpenAI' this.name = 'inputModerationOpenAI'
this.version = 1.0 this.version = 1.0
this.type = 'Moderation' this.type = 'Moderation'
this.icon = 'openai-moderation.png' this.icon = 'openai.png'
this.category = 'Moderation' this.category = 'Moderation'
this.description = 'Check whether content complies with OpenAI usage policies.' this.description = 'Check whether content complies with OpenAI usage policies.'
this.baseClasses = [this.type, ...getBaseClasses(Moderation)] this.baseClasses = [this.type, ...getBaseClasses(Moderation)]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,6 +1,6 @@
{ {
"name": "flowise-components", "name": "flowise-components",
"version": "1.4.3", "version": "1.4.4",
"description": "Flowiseai Components", "description": "Flowiseai Components",
"main": "dist/src/index", "main": "dist/src/index",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",

View File

@ -3,7 +3,7 @@
"nodes": [ "nodes": [
{ {
"width": 300, "width": 300,
"height": 510, "height": 491,
"id": "openApiChain_1", "id": "openApiChain_1",
"position": { "position": {
"x": 1203.1825726424859, "x": 1203.1825726424859,
@ -13,8 +13,8 @@
"data": { "data": {
"id": "openApiChain_1", "id": "openApiChain_1",
"label": "OpenAPI Chain", "label": "OpenAPI Chain",
"name": "openApiChain",
"version": 1, "version": 1,
"name": "openApiChain",
"type": "OpenAPIChain", "type": "OpenAPIChain",
"baseClasses": ["OpenAPIChain", "BaseChain"], "baseClasses": ["OpenAPIChain", "BaseChain"],
"category": "Chains", "category": "Chains",
@ -78,7 +78,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"position": { "position": {
"x": 792.3201947594027, "x": 792.3201947594027,
@ -88,8 +88,8 @@
"data": { "data": {
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -259,8 +259,8 @@
"data": { "data": {
"id": "chainTool_0", "id": "chainTool_0",
"label": "Chain Tool", "label": "Chain Tool",
"name": "chainTool",
"version": 1, "version": 1,
"name": "chainTool",
"type": "ChainTool", "type": "ChainTool",
"baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool"], "baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool"],
"category": "Tools", "category": "Tools",
@ -333,8 +333,8 @@
"data": { "data": {
"id": "openAIFunctionAgent_0", "id": "openAIFunctionAgent_0",
"label": "OpenAI Function Agent", "label": "OpenAI Function Agent",
"name": "openAIFunctionAgent",
"version": 2, "version": 2,
"name": "openAIFunctionAgent",
"type": "AgentExecutor", "type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain"], "baseClasses": ["AgentExecutor", "BaseChain"],
"category": "Agents", "category": "Agents",
@ -397,7 +397,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_2", "id": "chatOpenAI_2",
"position": { "position": {
"x": 1645.450699499575, "x": 1645.450699499575,
@ -407,8 +407,8 @@
"data": { "data": {
"id": "chatOpenAI_2", "id": "chatOpenAI_2",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -578,8 +578,8 @@
"data": { "data": {
"id": "bufferMemory_0", "id": "bufferMemory_0",
"label": "Buffer Memory", "label": "Buffer Memory",
"name": "bufferMemory",
"version": 1, "version": 1,
"name": "bufferMemory",
"type": "BufferMemory", "type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"], "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory", "category": "Memory",
@ -657,17 +657,6 @@
"label": "" "label": ""
} }
}, },
{
"source": "chatOpenAI_2",
"sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "openAIFunctionAgent_0",
"targetHandle": "openAIFunctionAgent_0-input-model-BaseChatModel",
"type": "buttonedge",
"id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openAIFunctionAgent_0-openAIFunctionAgent_0-input-model-BaseChatModel",
"data": {
"label": ""
}
},
{ {
"source": "bufferMemory_0", "source": "bufferMemory_0",
"sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
@ -678,6 +667,17 @@
"data": { "data": {
"label": "" "label": ""
} }
},
{
"source": "chatOpenAI_2",
"sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "openAIFunctionAgent_0",
"targetHandle": "openAIFunctionAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"type": "buttonedge",
"id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openAIFunctionAgent_0-openAIFunctionAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"data": {
"label": ""
}
} }
] ]
} }

View File

@ -13,8 +13,8 @@
"data": { "data": {
"id": "getApiChain_0", "id": "getApiChain_0",
"label": "GET API Chain", "label": "GET API Chain",
"name": "getApiChain",
"version": 1, "version": 1,
"name": "getApiChain",
"type": "GETApiChain", "type": "GETApiChain",
"baseClasses": ["GETApiChain", "BaseChain", "BaseLangChain"], "baseClasses": ["GETApiChain", "BaseChain", "BaseLangChain"],
"category": "Chains", "category": "Chains",
@ -102,8 +102,8 @@
"data": { "data": {
"id": "chainTool_0", "id": "chainTool_0",
"label": "Chain Tool", "label": "Chain Tool",
"name": "chainTool",
"version": 1, "version": 1,
"name": "chainTool",
"type": "ChainTool", "type": "ChainTool",
"baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool", "BaseLangChain"], "baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool", "BaseLangChain"],
"category": "Tools", "category": "Tools",
@ -176,8 +176,8 @@
"data": { "data": {
"id": "bufferMemory_0", "id": "bufferMemory_0",
"label": "Buffer Memory", "label": "Buffer Memory",
"name": "bufferMemory",
"version": 1, "version": 1,
"name": "bufferMemory",
"type": "BufferMemory", "type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"], "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory", "category": "Memory",
@ -233,8 +233,8 @@
"data": { "data": {
"id": "chainTool_1", "id": "chainTool_1",
"label": "Chain Tool", "label": "Chain Tool",
"name": "chainTool",
"version": 1, "version": 1,
"name": "chainTool",
"type": "ChainTool", "type": "ChainTool",
"baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool", "BaseLangChain"], "baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool", "BaseLangChain"],
"category": "Tools", "category": "Tools",
@ -307,8 +307,8 @@
"data": { "data": {
"id": "postApiChain_0", "id": "postApiChain_0",
"label": "POST API Chain", "label": "POST API Chain",
"name": "postApiChain",
"version": 1, "version": 1,
"name": "postApiChain",
"type": "POSTApiChain", "type": "POSTApiChain",
"baseClasses": ["POSTApiChain", "BaseChain", "BaseLangChain"], "baseClasses": ["POSTApiChain", "BaseChain", "BaseLangChain"],
"category": "Chains", "category": "Chains",
@ -386,7 +386,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_2", "id": "chatOpenAI_2",
"position": { "position": {
"x": 572.8941615312035, "x": 572.8941615312035,
@ -396,8 +396,8 @@
"data": { "data": {
"id": "chatOpenAI_2", "id": "chatOpenAI_2",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -557,7 +557,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"position": { "position": {
"x": 828.7788305309582, "x": 828.7788305309582,
@ -567,8 +567,8 @@
"data": { "data": {
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -728,7 +728,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_3", "id": "chatOpenAI_3",
"position": { "position": {
"x": 1148.338912314111, "x": 1148.338912314111,
@ -738,8 +738,8 @@
"data": { "data": {
"id": "chatOpenAI_3", "id": "chatOpenAI_3",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -869,7 +869,7 @@
} }
], ],
"inputs": { "inputs": {
"modelName": "gpt-3.5-turbo", "modelName": "gpt-3.5-turbo-16k",
"temperature": 0.9, "temperature": 0.9,
"maxTokens": "", "maxTokens": "",
"topP": "", "topP": "",
@ -902,17 +902,17 @@
"height": 383, "height": 383,
"id": "conversationalAgent_0", "id": "conversationalAgent_0",
"position": { "position": {
"x": 2114.071431691489, "x": 2090.570467632979,
"y": 941.7926368551367 "y": 969.5131357270544
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
"id": "conversationalAgent_0", "id": "conversationalAgent_0",
"label": "Conversational Agent", "label": "Conversational Agent",
"version": 2,
"name": "conversationalAgent", "name": "conversationalAgent",
"version": 1,
"type": "AgentExecutor", "type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain"], "baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents", "category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts", "description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [ "inputParams": [
@ -938,8 +938,8 @@
{ {
"label": "Language Model", "label": "Language Model",
"name": "model", "name": "model",
"type": "BaseLanguageModel", "type": "BaseChatModel",
"id": "conversationalAgent_0-input-model-BaseLanguageModel" "id": "conversationalAgent_0-input-model-BaseChatModel"
}, },
{ {
"label": "Memory", "label": "Memory",
@ -956,21 +956,21 @@
}, },
"outputAnchors": [ "outputAnchors": [
{ {
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain", "id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
"name": "conversationalAgent", "name": "conversationalAgent",
"label": "AgentExecutor", "label": "AgentExecutor",
"type": "AgentExecutor | BaseChain" "type": "AgentExecutor | BaseChain | Runnable"
} }
], ],
"outputs": {}, "outputs": {},
"selected": false "selected": false
}, },
"selected": false, "selected": false,
"dragging": false,
"positionAbsolute": { "positionAbsolute": {
"x": 2114.071431691489, "x": 2090.570467632979,
"y": 941.7926368551367 "y": 969.5131357270544
} },
"dragging": false
} }
], ],
"edges": [ "edges": [
@ -1044,9 +1044,9 @@
"source": "chatOpenAI_3", "source": "chatOpenAI_3",
"sourceHandle": "chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel", "sourceHandle": "chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "conversationalAgent_0", "target": "conversationalAgent_0",
"targetHandle": "conversationalAgent_0-input-model-BaseLanguageModel", "targetHandle": "conversationalAgent_0-input-model-BaseChatModel",
"type": "buttonedge", "type": "buttonedge",
"id": "chatOpenAI_3-chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseLanguageModel", "id": "chatOpenAI_3-chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseChatModel",
"data": { "data": {
"label": "" "label": ""
} }

View File

@ -13,8 +13,8 @@
"data": { "data": {
"id": "calculator_1", "id": "calculator_1",
"label": "Calculator", "label": "Calculator",
"name": "calculator",
"version": 1, "version": 1,
"name": "calculator",
"type": "Calculator", "type": "Calculator",
"baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain"], "baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain"],
"category": "Tools", "category": "Tools",
@ -52,8 +52,8 @@
"data": { "data": {
"id": "bufferMemory_1", "id": "bufferMemory_1",
"label": "Buffer Memory", "label": "Buffer Memory",
"name": "bufferMemory",
"version": 1, "version": 1,
"name": "bufferMemory",
"type": "BufferMemory", "type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"], "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory", "category": "Memory",
@ -109,8 +109,8 @@
"data": { "data": {
"id": "serpAPI_0", "id": "serpAPI_0",
"label": "Serp API", "label": "Serp API",
"name": "serpAPI",
"version": 1, "version": 1,
"name": "serpAPI",
"type": "SerpAPI", "type": "SerpAPI",
"baseClasses": ["SerpAPI", "Tool", "StructuredTool"], "baseClasses": ["SerpAPI", "Tool", "StructuredTool"],
"category": "Tools", "category": "Tools",
@ -146,7 +146,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"position": { "position": {
"x": 97.01321406237057, "x": 97.01321406237057,
@ -156,8 +156,8 @@
"data": { "data": {
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -287,7 +287,7 @@
} }
], ],
"inputs": { "inputs": {
"modelName": "gpt-3.5-turbo", "modelName": "gpt-3.5-turbo-16k",
"temperature": 0.9, "temperature": 0.9,
"maxTokens": "", "maxTokens": "",
"topP": "", "topP": "",
@ -320,17 +320,17 @@
"height": 383, "height": 383,
"id": "conversationalAgent_0", "id": "conversationalAgent_0",
"position": { "position": {
"x": 1164.4550359451973, "x": 1191.1524476753796,
"y": 283.40041124403075 "y": 324.2479396683294
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
"id": "conversationalAgent_0", "id": "conversationalAgent_0",
"label": "Conversational Agent", "label": "Conversational Agent",
"version": 2,
"name": "conversationalAgent", "name": "conversationalAgent",
"version": 1,
"type": "AgentExecutor", "type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain"], "baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents", "category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts", "description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [ "inputParams": [
@ -356,8 +356,8 @@
{ {
"label": "Language Model", "label": "Language Model",
"name": "model", "name": "model",
"type": "BaseLanguageModel", "type": "BaseChatModel",
"id": "conversationalAgent_0-input-model-BaseLanguageModel" "id": "conversationalAgent_0-input-model-BaseChatModel"
}, },
{ {
"label": "Memory", "label": "Memory",
@ -374,10 +374,10 @@
}, },
"outputAnchors": [ "outputAnchors": [
{ {
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain", "id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
"name": "conversationalAgent", "name": "conversationalAgent",
"label": "AgentExecutor", "label": "AgentExecutor",
"type": "AgentExecutor | BaseChain" "type": "AgentExecutor | BaseChain | Runnable"
} }
], ],
"outputs": {}, "outputs": {},
@ -385,8 +385,8 @@
}, },
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 1164.4550359451973, "x": 1191.1524476753796,
"y": 283.40041124403075 "y": 324.2479396683294
}, },
"dragging": false "dragging": false
} }
@ -418,9 +418,9 @@
"source": "chatOpenAI_0", "source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel", "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "conversationalAgent_0", "target": "conversationalAgent_0",
"targetHandle": "conversationalAgent_0-input-model-BaseLanguageModel", "targetHandle": "conversationalAgent_0-input-model-BaseChatModel",
"type": "buttonedge", "type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseLanguageModel", "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseChatModel",
"data": { "data": {
"label": "" "label": ""
} }

View File

@ -642,9 +642,9 @@
"source": "chatOpenAI_0", "source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "conversationalRetrievalAgent_0", "target": "conversationalRetrievalAgent_0",
"targetHandle": "conversationalRetrievalAgent_0-input-model-ChatOpenAI", "targetHandle": "conversationalRetrievalAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"type": "buttonedge", "type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalAgent_0-conversationalRetrievalAgent_0-input-model-ChatOpenAI", "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalAgent_0-conversationalRetrievalAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"data": { "data": {
"label": "" "label": ""
} }

View File

@ -1127,81 +1127,6 @@
}, },
"dragging": false "dragging": false
}, },
{
"width": 300,
"height": 383,
"id": "conversationalAgent_0",
"position": {
"x": 2506.011817109287,
"y": -241.58006840004734
},
"type": "customNode",
"data": {
"id": "conversationalAgent_0",
"label": "Conversational Agent",
"version": 1,
"name": "conversationalAgent",
"type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [
{
"label": "System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"default": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.",
"optional": true,
"additionalParams": true,
"id": "conversationalAgent_0-input-systemMessage-string"
}
],
"inputAnchors": [
{
"label": "Allowed Tools",
"name": "tools",
"type": "Tool",
"list": true,
"id": "conversationalAgent_0-input-tools-Tool"
},
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "conversationalAgent_0-input-model-BaseLanguageModel"
},
{
"label": "Memory",
"name": "memory",
"type": "BaseChatMemory",
"id": "conversationalAgent_0-input-memory-BaseChatMemory"
}
],
"inputs": {
"tools": ["{{chainTool_2.data.instance}}", "{{chainTool_3.data.instance}}"],
"model": "{{chatOpenAI_2.data.instance}}",
"memory": "{{bufferMemory_0.data.instance}}",
"systemMessage": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist."
},
"outputAnchors": [
{
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
"name": "conversationalAgent",
"label": "AgentExecutor",
"type": "AgentExecutor | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 2506.011817109287,
"y": -241.58006840004734
},
"dragging": false
},
{ {
"width": 300, "width": 300,
"height": 574, "height": 574,
@ -1602,6 +1527,81 @@
"y": 75.96855802341503 "y": 75.96855802341503
}, },
"dragging": false "dragging": false
},
{
"width": 300,
"height": 383,
"id": "conversationalAgent_0",
"position": {
"x": 2432.125364763489,
"y": -105.27942167533908
},
"type": "customNode",
"data": {
"id": "conversationalAgent_0",
"label": "Conversational Agent",
"version": 2,
"name": "conversationalAgent",
"type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [
{
"label": "System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"default": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.",
"optional": true,
"additionalParams": true,
"id": "conversationalAgent_0-input-systemMessage-string"
}
],
"inputAnchors": [
{
"label": "Allowed Tools",
"name": "tools",
"type": "Tool",
"list": true,
"id": "conversationalAgent_0-input-tools-Tool"
},
{
"label": "Language Model",
"name": "model",
"type": "BaseChatModel",
"id": "conversationalAgent_0-input-model-BaseChatModel"
},
{
"label": "Memory",
"name": "memory",
"type": "BaseChatMemory",
"id": "conversationalAgent_0-input-memory-BaseChatMemory"
}
],
"inputs": {
"tools": ["{{chainTool_2.data.instance}}", "{{chainTool_3.data.instance}}"],
"model": "{{chatOpenAI_2.data.instance}}",
"memory": "{{bufferMemory_0.data.instance}}",
"systemMessage": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist."
},
"outputAnchors": [
{
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
"name": "conversationalAgent",
"label": "AgentExecutor",
"type": "AgentExecutor | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 2432.125364763489,
"y": -105.27942167533908
},
"dragging": false
} }
], ],
"edges": [ "edges": [
@ -1704,6 +1704,28 @@
"label": "" "label": ""
} }
}, },
{
"source": "plainText_1",
"sourceHandle": "plainText_1-output-document-Document",
"target": "faiss_0",
"targetHandle": "faiss_0-input-document-Document",
"type": "buttonedge",
"id": "plainText_1-plainText_1-output-document-Document-faiss_0-faiss_0-input-document-Document",
"data": {
"label": ""
}
},
{
"source": "recursiveCharacterTextSplitter_0",
"sourceHandle": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer|Runnable",
"target": "plainText_1",
"targetHandle": "plainText_1-input-textSplitter-TextSplitter",
"type": "buttonedge",
"id": "recursiveCharacterTextSplitter_0-recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer|Runnable-plainText_1-plainText_1-input-textSplitter-TextSplitter",
"data": {
"label": ""
}
},
{ {
"source": "chainTool_2", "source": "chainTool_2",
"sourceHandle": "chainTool_2-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool|BaseLangChain", "sourceHandle": "chainTool_2-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool|BaseLangChain",
@ -1730,9 +1752,9 @@
"source": "chatOpenAI_2", "source": "chatOpenAI_2",
"sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", "sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "conversationalAgent_0", "target": "conversationalAgent_0",
"targetHandle": "conversationalAgent_0-input-model-BaseLanguageModel", "targetHandle": "conversationalAgent_0-input-model-BaseChatModel",
"type": "buttonedge", "type": "buttonedge",
"id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalAgent_0-conversationalAgent_0-input-model-BaseLanguageModel", "id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalAgent_0-conversationalAgent_0-input-model-BaseChatModel",
"data": { "data": {
"label": "" "label": ""
} }
@ -1747,28 +1769,6 @@
"data": { "data": {
"label": "" "label": ""
} }
},
{
"source": "plainText_1",
"sourceHandle": "plainText_1-output-document-Document",
"target": "faiss_0",
"targetHandle": "faiss_0-input-document-Document",
"type": "buttonedge",
"id": "plainText_1-plainText_1-output-document-Document-faiss_0-faiss_0-input-document-Document",
"data": {
"label": ""
}
},
{
"source": "recursiveCharacterTextSplitter_0",
"sourceHandle": "recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer|Runnable",
"target": "plainText_1",
"targetHandle": "plainText_1-input-textSplitter-TextSplitter",
"type": "buttonedge",
"id": "recursiveCharacterTextSplitter_0-recursiveCharacterTextSplitter_0-output-recursiveCharacterTextSplitter-RecursiveCharacterTextSplitter|TextSplitter|BaseDocumentTransformer|Runnable-plainText_1-plainText_1-input-textSplitter-TextSplitter",
"data": {
"label": ""
}
} }
] ]
} }

View File

@ -13,8 +13,8 @@
"data": { "data": {
"id": "calculator_0", "id": "calculator_0",
"label": "Calculator", "label": "Calculator",
"name": "calculator",
"version": 1, "version": 1,
"name": "calculator",
"type": "Calculator", "type": "Calculator",
"baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain", "Serializable"], "baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain", "Serializable"],
"category": "Tools", "category": "Tools",
@ -52,8 +52,8 @@
"data": { "data": {
"id": "bufferMemory_0", "id": "bufferMemory_0",
"label": "Buffer Memory", "label": "Buffer Memory",
"name": "bufferMemory",
"version": 1, "version": 1,
"name": "bufferMemory",
"type": "BufferMemory", "type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"], "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory", "category": "Memory",
@ -109,8 +109,8 @@
"data": { "data": {
"id": "customTool_0", "id": "customTool_0",
"label": "Custom Tool", "label": "Custom Tool",
"name": "customTool",
"version": 1, "version": 1,
"name": "customTool",
"type": "CustomTool", "type": "CustomTool",
"baseClasses": ["CustomTool", "Tool", "StructuredTool"], "baseClasses": ["CustomTool", "Tool", "StructuredTool"],
"category": "Tools", "category": "Tools",
@ -158,8 +158,8 @@
"data": { "data": {
"id": "serper_0", "id": "serper_0",
"label": "Serper", "label": "Serper",
"name": "serper",
"version": 1, "version": 1,
"name": "serper",
"type": "Serper", "type": "Serper",
"baseClasses": ["Serper", "Tool", "StructuredTool"], "baseClasses": ["Serper", "Tool", "StructuredTool"],
"category": "Tools", "category": "Tools",
@ -205,8 +205,8 @@
"data": { "data": {
"id": "openAIFunctionAgent_0", "id": "openAIFunctionAgent_0",
"label": "OpenAI Function Agent", "label": "OpenAI Function Agent",
"name": "openAIFunctionAgent",
"version": 2, "version": 2,
"name": "openAIFunctionAgent",
"type": "AgentExecutor", "type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain"], "baseClasses": ["AgentExecutor", "BaseChain"],
"category": "Agents", "category": "Agents",
@ -269,7 +269,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"position": { "position": {
"x": 817.8210275868742, "x": 817.8210275868742,
@ -279,8 +279,8 @@
"data": { "data": {
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -473,17 +473,6 @@
"label": "" "label": ""
} }
}, },
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "openAIFunctionAgent_0",
"targetHandle": "openAIFunctionAgent_0-input-model-BaseChatModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openAIFunctionAgent_0-openAIFunctionAgent_0-input-model-BaseChatModel",
"data": {
"label": ""
}
},
{ {
"source": "bufferMemory_0", "source": "bufferMemory_0",
"sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
@ -494,6 +483,17 @@
"data": { "data": {
"label": "" "label": ""
} }
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "openAIFunctionAgent_0",
"targetHandle": "openAIFunctionAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openAIFunctionAgent_0-openAIFunctionAgent_0-input-model-ChatOpenAI | AzureChatOpenAI",
"data": {
"label": ""
}
} }
] ]
} }

View File

@ -13,8 +13,8 @@
"data": { "data": {
"id": "bufferMemory_0", "id": "bufferMemory_0",
"label": "Buffer Memory", "label": "Buffer Memory",
"name": "bufferMemory",
"version": 1, "version": 1,
"name": "bufferMemory",
"type": "BufferMemory", "type": "BufferMemory",
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"], "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
"category": "Memory", "category": "Memory",
@ -70,8 +70,8 @@
"data": { "data": {
"id": "webBrowser_0", "id": "webBrowser_0",
"label": "Web Browser", "label": "Web Browser",
"name": "webBrowser",
"version": 1, "version": 1,
"name": "webBrowser",
"type": "WebBrowser", "type": "WebBrowser",
"baseClasses": ["WebBrowser", "Tool", "StructuredTool", "BaseLangChain"], "baseClasses": ["WebBrowser", "Tool", "StructuredTool", "BaseLangChain"],
"category": "Tools", "category": "Tools",
@ -115,82 +115,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 383, "height": 574,
"id": "conversationalAgent_0",
"position": {
"x": 1464.513303631911,
"y": 155.73036805253955
},
"type": "customNode",
"data": {
"id": "conversationalAgent_0",
"label": "Conversational Agent",
"name": "conversationalAgent",
"version": 1,
"type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain"],
"category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [
{
"label": "System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"default": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.",
"optional": true,
"additionalParams": true,
"id": "conversationalAgent_0-input-systemMessage-string"
}
],
"inputAnchors": [
{
"label": "Allowed Tools",
"name": "tools",
"type": "Tool",
"list": true,
"id": "conversationalAgent_0-input-tools-Tool"
},
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "conversationalAgent_0-input-model-BaseLanguageModel"
},
{
"label": "Memory",
"name": "memory",
"type": "BaseChatMemory",
"id": "conversationalAgent_0-input-memory-BaseChatMemory"
}
],
"inputs": {
"tools": ["{{webBrowser_0.data.instance}}"],
"model": "{{chatOpenAI_1.data.instance}}",
"memory": "{{bufferMemory_0.data.instance}}",
"systemMessage": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist."
},
"outputAnchors": [
{
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain",
"name": "conversationalAgent",
"label": "AgentExecutor",
"type": "AgentExecutor | BaseChain"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1464.513303631911,
"y": 155.73036805253955
},
"dragging": false
},
{
"width": 300,
"height": 523,
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"position": { "position": {
"x": 734.7477982032904, "x": 734.7477982032904,
@ -200,8 +125,8 @@
"data": { "data": {
"id": "chatOpenAI_0", "id": "chatOpenAI_0",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -371,8 +296,8 @@
"data": { "data": {
"id": "openAIEmbeddings_0", "id": "openAIEmbeddings_0",
"label": "OpenAI Embeddings", "label": "OpenAI Embeddings",
"name": "openAIEmbeddings",
"version": 1, "version": 1,
"name": "openAIEmbeddings",
"type": "OpenAIEmbeddings", "type": "OpenAIEmbeddings",
"baseClasses": ["OpenAIEmbeddings", "Embeddings"], "baseClasses": ["OpenAIEmbeddings", "Embeddings"],
"category": "Embeddings", "category": "Embeddings",
@ -445,7 +370,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 523, "height": 574,
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"position": { "position": {
"x": 68.312124033115, "x": 68.312124033115,
@ -455,8 +380,8 @@
"data": { "data": {
"id": "chatOpenAI_1", "id": "chatOpenAI_1",
"label": "ChatOpenAI", "label": "ChatOpenAI",
"name": "chatOpenAI",
"version": 2, "version": 2,
"name": "chatOpenAI",
"type": "ChatOpenAI", "type": "ChatOpenAI",
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"], "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
"category": "Chat Models", "category": "Chat Models",
@ -586,7 +511,7 @@
} }
], ],
"inputs": { "inputs": {
"modelName": "gpt-3.5-turbo", "modelName": "gpt-3.5-turbo-16k",
"temperature": 0.9, "temperature": 0.9,
"maxTokens": "", "maxTokens": "",
"topP": "", "topP": "",
@ -613,6 +538,81 @@
"y": -239.65476709991256 "y": -239.65476709991256
}, },
"dragging": false "dragging": false
},
{
"width": 300,
"height": 383,
"id": "conversationalAgent_0",
"position": {
"x": 1518.944765840293,
"y": 212.2513364217197
},
"type": "customNode",
"data": {
"id": "conversationalAgent_0",
"label": "Conversational Agent",
"version": 2,
"name": "conversationalAgent",
"type": "AgentExecutor",
"baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
"category": "Agents",
"description": "Conversational agent for a chat model. It will utilize chat specific prompts",
"inputParams": [
{
"label": "System Message",
"name": "systemMessage",
"type": "string",
"rows": 4,
"default": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.",
"optional": true,
"additionalParams": true,
"id": "conversationalAgent_0-input-systemMessage-string"
}
],
"inputAnchors": [
{
"label": "Allowed Tools",
"name": "tools",
"type": "Tool",
"list": true,
"id": "conversationalAgent_0-input-tools-Tool"
},
{
"label": "Language Model",
"name": "model",
"type": "BaseChatModel",
"id": "conversationalAgent_0-input-model-BaseChatModel"
},
{
"label": "Memory",
"name": "memory",
"type": "BaseChatMemory",
"id": "conversationalAgent_0-input-memory-BaseChatMemory"
}
],
"inputs": {
"tools": ["{{webBrowser_0.data.instance}}"],
"model": "{{chatOpenAI_1.data.instance}}",
"memory": "{{bufferMemory_0.data.instance}}",
"systemMessage": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist."
},
"outputAnchors": [
{
"id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
"name": "conversationalAgent",
"label": "AgentExecutor",
"type": "AgentExecutor | BaseChain | Runnable"
}
],
"outputs": {},
"selected": false
},
"selected": false,
"positionAbsolute": {
"x": 1518.944765840293,
"y": 212.2513364217197
},
"dragging": false
} }
], ],
"edges": [ "edges": [
@ -638,17 +638,6 @@
"label": "" "label": ""
} }
}, },
{
"source": "chatOpenAI_1",
"sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "conversationalAgent_0",
"targetHandle": "conversationalAgent_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseLanguageModel",
"data": {
"label": ""
}
},
{ {
"source": "webBrowser_0", "source": "webBrowser_0",
"sourceHandle": "webBrowser_0-output-webBrowser-WebBrowser|Tool|StructuredTool|BaseLangChain", "sourceHandle": "webBrowser_0-output-webBrowser-WebBrowser|Tool|StructuredTool|BaseLangChain",
@ -660,6 +649,17 @@
"label": "" "label": ""
} }
}, },
{
"source": "chatOpenAI_1",
"sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
"target": "conversationalAgent_0",
"targetHandle": "conversationalAgent_0-input-model-BaseChatModel",
"type": "buttonedge",
"id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseChatModel",
"data": {
"label": ""
}
},
{ {
"source": "bufferMemory_0", "source": "bufferMemory_0",
"sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",