Merge branch 'main' into FEATURE/lshub-prompt

This commit is contained in:
vinodkiran
2023-12-01 10:31:29 +05:30
24 changed files with 334 additions and 307 deletions
@@ -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 = [
@@ -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'
} }
] ]
} }
@@ -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
} }
@@ -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') {
@@ -41,6 +41,15 @@ class OpenAIAssistant_Agents implements INode {
name: 'tools', name: 'tools',
type: 'Tool', type: 'Tool',
list: true list: true
},
{
label: 'Disable File Download',
name: 'disableFileDownload',
type: 'boolean',
description:
'Messages can contain text, images, or files. In some cases, you may want to prevent others from downloading the files. Learn more from OpenAI File Annotation <a target="_blank" href="https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages">docs</a>',
optional: true,
additionalParams: true
} }
] ]
} }
@@ -119,6 +128,8 @@ class OpenAIAssistant_Agents implements INode {
const selectedAssistantId = nodeData.inputs?.selectedAssistant as string const selectedAssistantId = nodeData.inputs?.selectedAssistant as string
const appDataSource = options.appDataSource as DataSource const appDataSource = options.appDataSource as DataSource
const databaseEntities = options.databaseEntities as IDatabaseEntity const databaseEntities = options.databaseEntities as IDatabaseEntity
const disableFileDownload = nodeData.inputs?.disableFileDownload as boolean
let tools = nodeData.inputs?.tools let tools = nodeData.inputs?.tools
tools = flatten(tools) tools = flatten(tools)
const formattedTools = tools?.map((tool: any) => formatToOpenAIAssistantTool(tool)) ?? [] const formattedTools = tools?.map((tool: any) => formatToOpenAIAssistantTool(tool)) ?? []
@@ -310,7 +321,7 @@ class OpenAIAssistant_Agents implements INode {
const dirPath = path.join(getUserHome(), '.flowise', 'openai-assistant') const dirPath = path.join(getUserHome(), '.flowise', 'openai-assistant')
// Iterate over the annotations and add footnotes // Iterate over the annotations
for (let index = 0; index < annotations.length; index++) { for (let index = 0; index < annotations.length; index++) {
const annotation = annotations[index] const annotation = annotations[index]
let filePath = '' let filePath = ''
@@ -323,11 +334,13 @@ class OpenAIAssistant_Agents implements INode {
// eslint-disable-next-line no-useless-escape // eslint-disable-next-line no-useless-escape
const fileName = cited_file.filename.split(/[\/\\]/).pop() ?? cited_file.filename const fileName = cited_file.filename.split(/[\/\\]/).pop() ?? cited_file.filename
filePath = path.join(getUserHome(), '.flowise', 'openai-assistant', fileName) filePath = path.join(getUserHome(), '.flowise', 'openai-assistant', fileName)
if (!disableFileDownload) {
await downloadFile(cited_file, filePath, dirPath, openAIApiKey) await downloadFile(cited_file, filePath, dirPath, openAIApiKey)
fileAnnotations.push({ fileAnnotations.push({
filePath, filePath,
fileName fileName
}) })
}
} else { } else {
const file_path = (annotation as OpenAI.Beta.Threads.Messages.MessageContentText.Text.FilePath).file_path const file_path = (annotation as OpenAI.Beta.Threads.Messages.MessageContentText.Text.FilePath).file_path
if (file_path) { if (file_path) {
@@ -335,6 +348,7 @@ class OpenAIAssistant_Agents implements INode {
// eslint-disable-next-line no-useless-escape // eslint-disable-next-line no-useless-escape
const fileName = cited_file.filename.split(/[\/\\]/).pop() ?? cited_file.filename const fileName = cited_file.filename.split(/[\/\\]/).pop() ?? cited_file.filename
filePath = path.join(getUserHome(), '.flowise', 'openai-assistant', fileName) filePath = path.join(getUserHome(), '.flowise', 'openai-assistant', fileName)
if (!disableFileDownload) {
await downloadFile(cited_file, filePath, dirPath, openAIApiKey) await downloadFile(cited_file, filePath, dirPath, openAIApiKey)
fileAnnotations.push({ fileAnnotations.push({
filePath, filePath,
@@ -342,6 +356,7 @@ class OpenAIAssistant_Agents implements INode {
}) })
} }
} }
}
// Replace the text with a footnote // Replace the text with a footnote
message_content.value = message_content.value.replace(`${annotation.text}`, `${filePath}`) message_content.value = message_content.value.replace(`${annotation.text}`, `${filePath}`)
@@ -351,6 +366,9 @@ class OpenAIAssistant_Agents implements INode {
} else { } else {
returnVal += content.text.value returnVal += content.text.value
} }
const lenticularBracketRegex = /【[^】]*】/g
returnVal = returnVal.replace(lenticularBracketRegex, '')
} else { } else {
const content = assistantMessages[0].content[i] as MessageContentImageFile const content = assistantMessages[0].content[i] as MessageContentImageFile
const fileId = content.image_file.file_id const fileId = content.image_file.file_id
@@ -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)
@@ -106,15 +106,17 @@ 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)
@@ -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
@@ -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
}) })
} }
@@ -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
}) })
@@ -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
}) })
@@ -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

@@ -14,7 +14,7 @@ export class SimplePromptModerationRunner implements Moderation {
async checkForViolations(input: string): Promise<string> { async checkForViolations(input: string): Promise<string> {
this.denyList.split('\n').forEach((denyListItem) => { this.denyList.split('\n').forEach((denyListItem) => {
if (denyListItem && denyListItem !== '' && input.includes(denyListItem)) { if (denyListItem && denyListItem !== '' && input.toLowerCase().includes(denyListItem.toLowerCase())) {
throw Error(this.moderationErrorMessage) throw Error(this.moderationErrorMessage)
} }
}) })
+1 -1
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",
@@ -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": ""
}
} }
] ]
} }
@@ -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": ""
} }
@@ -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": ""
} }
@@ -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": ""
} }
@@ -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": ""
}
} }
] ]
} }
@@ -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": ""
}
} }
] ]
} }
@@ -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",
@@ -69,7 +69,9 @@ export const FlowListTable = ({ data, images, filterFunction, updateFlowsApi })
<Typography <Typography
sx={{ fontSize: '1.2rem', fontWeight: 500, overflowWrap: 'break-word', whiteSpace: 'pre-line' }} sx={{ fontSize: '1.2rem', fontWeight: 500, overflowWrap: 'break-word', whiteSpace: 'pre-line' }}
> >
<Button onClick={() => goToCanvas(row)}>{row.templateName || row.name}</Button> <Button onClick={() => goToCanvas(row)} sx={{ textAlign: 'left' }}>
{row.templateName || row.name}
</Button>
</Typography> </Typography>
</TableCell> </TableCell>
<TableCell key='1'> <TableCell key='1'>