Merge branch 'main' into feature/BabyAGI

# Conflicts:
#	packages/components/package.json
This commit is contained in:
Henry
2023-04-19 15:02:58 +01:00
64 changed files with 1735 additions and 1168 deletions
@@ -1,4 +1,9 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { initializeAgentExecutor, AgentExecutor } from 'langchain/agents'
import { Tool } from 'langchain/tools'
import { BaseChatModel } from 'langchain/chat_models/base'
import { BaseChatMemory } from 'langchain/memory'
import { getBaseClasses } from '../../../src/utils'
class ConversationalAgent_Agents implements INode {
label: string
@@ -17,6 +22,7 @@ class ConversationalAgent_Agents implements INode {
this.category = 'Agents'
this.icon = 'agent.svg'
this.description = 'Conversational agent for a chat model. It will utilize chat specific prompts'
this.baseClasses = [this.type, ...getBaseClasses(AgentExecutor)]
this.inputs = [
{
label: 'Allowed Tools',
@@ -37,16 +43,10 @@ class ConversationalAgent_Agents implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['AgentExecutor']
}
async init(nodeData: INodeData): Promise<any> {
const { initializeAgentExecutor } = await import('langchain/agents')
const model = nodeData.inputs?.model
const tools = nodeData.inputs?.tools
const memory = nodeData.inputs?.memory
const model = nodeData.inputs?.model as BaseChatModel
const tools = nodeData.inputs?.tools as Tool[]
const memory = nodeData.inputs?.memory as BaseChatMemory
const executor = await initializeAgentExecutor(tools, model, 'chat-conversational-react-description', true)
executor.memory = memory
@@ -54,7 +54,7 @@ class ConversationalAgent_Agents implements INode {
}
async run(nodeData: INodeData, input: string): Promise<string> {
const executor = nodeData.instance
const executor = nodeData.instance as AgentExecutor
const result = await executor.call({ input })
return result?.output
@@ -1,6 +1,10 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { initializeAgentExecutor, AgentExecutor } from 'langchain/agents'
import { Tool } from 'langchain/tools'
import { BaseChatModel } from 'langchain/chat_models/base'
import { getBaseClasses } from '../../../src/utils'
class MRLKAgentChat_Agents implements INode {
class MRKLAgentChat_Agents implements INode {
label: string
name: string
description: string
@@ -11,12 +15,13 @@ class MRLKAgentChat_Agents implements INode {
inputs: INodeParams[]
constructor() {
this.label = 'MRLK Agent for Chat Models'
this.name = 'mrlkAgentChat'
this.label = 'MRKL Agent for Chat Models'
this.name = 'mrklAgentChat'
this.type = 'AgentExecutor'
this.category = 'Agents'
this.icon = 'agent.svg'
this.description = 'Agent that uses the ReAct Framework to decide what action to take, optimized to be used with Chat Models'
this.baseClasses = [this.type, ...getBaseClasses(AgentExecutor)]
this.inputs = [
{
label: 'Allowed Tools',
@@ -32,27 +37,20 @@ class MRLKAgentChat_Agents implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['AgentExecutor']
}
async init(nodeData: INodeData): Promise<any> {
const { initializeAgentExecutor } = await import('langchain/agents')
const model = nodeData.inputs?.model
const tools = nodeData.inputs?.tools
const model = nodeData.inputs?.model as BaseChatModel
const tools = nodeData.inputs?.tools as Tool[]
const executor = await initializeAgentExecutor(tools, model, 'chat-zero-shot-react-description', true)
return executor
}
async run(nodeData: INodeData, input: string): Promise<string> {
const executor = nodeData.instance
const executor = nodeData.instance as AgentExecutor
const result = await executor.call({ input })
return result?.output
}
}
module.exports = { nodeClass: MRLKAgentChat_Agents }
module.exports = { nodeClass: MRKLAgentChat_Agents }

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 650 B

@@ -1,6 +1,10 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { initializeAgentExecutor, AgentExecutor } from 'langchain/agents'
import { Tool } from 'langchain/tools'
import { BaseLLM } from 'langchain/llms/base'
import { getBaseClasses } from '../../../src/utils'
class MRLKAgentLLM_Agents implements INode {
class MRKLAgentLLM_Agents implements INode {
label: string
name: string
description: string
@@ -11,12 +15,13 @@ class MRLKAgentLLM_Agents implements INode {
inputs: INodeParams[]
constructor() {
this.label = 'MRLK Agent for LLMs'
this.name = 'mrlkAgentLLM'
this.label = 'MRKL Agent for LLMs'
this.name = 'mrklAgentLLM'
this.type = 'AgentExecutor'
this.category = 'Agents'
this.icon = 'agent.svg'
this.description = 'Agent that uses the ReAct Framework to decide what action to take, optimized to be used with LLMs'
this.baseClasses = [this.type, ...getBaseClasses(AgentExecutor)]
this.inputs = [
{
label: 'Allowed Tools',
@@ -27,32 +32,25 @@ class MRLKAgentLLM_Agents implements INode {
{
label: 'LLM Model',
name: 'model',
type: 'BaseLanguageModel'
type: 'BaseLLM'
}
]
}
async getBaseClasses(): Promise<string[]> {
return ['AgentExecutor']
}
async init(nodeData: INodeData): Promise<any> {
const { initializeAgentExecutor } = await import('langchain/agents')
const model = nodeData.inputs?.model
const tools = nodeData.inputs?.tools
const model = nodeData.inputs?.model as BaseLLM
const tools = nodeData.inputs?.tools as Tool[]
const executor = await initializeAgentExecutor(tools, model, 'zero-shot-react-description', true)
return executor
}
async run(nodeData: INodeData, input: string): Promise<string> {
const executor = nodeData.instance
const executor = nodeData.instance as AgentExecutor
const result = await executor.call({ input })
return result?.output
}
}
module.exports = { nodeClass: MRLKAgentLLM_Agents }
module.exports = { nodeClass: MRKLAgentLLM_Agents }

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 650 B

@@ -1,5 +1,8 @@
import { ICommonObject, IMessage, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { ConversationalRetrievalQAChain } from 'langchain/chains'
import { BaseLLM } from 'langchain/llms/base'
import { BaseRetriever } from 'langchain/schema'
class ConversationalRetrievalQAChain_Chains implements INode {
label: string
@@ -18,11 +21,12 @@ class ConversationalRetrievalQAChain_Chains implements INode {
this.icon = 'chain.svg'
this.category = 'Chains'
this.description = 'Document QA - built on RetrievalQAChain to provide a chat history component'
this.baseClasses = [this.type, ...getBaseClasses(ConversationalRetrievalQAChain)]
this.inputs = [
{
label: 'LLM',
name: 'llm',
type: 'BaseLanguageModel'
type: 'BaseLLM'
},
{
label: 'Vector Store Retriever',
@@ -32,23 +36,16 @@ class ConversationalRetrievalQAChain_Chains implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { ConversationalRetrievalQAChain } = await import('langchain/chains')
return getBaseClasses(ConversationalRetrievalQAChain)
}
async init(nodeData: INodeData): Promise<any> {
const { ConversationalRetrievalQAChain } = await import('langchain/chains')
const llm = nodeData.inputs?.llm
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever
const llm = nodeData.inputs?.llm as BaseLLM
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
const chain = ConversationalRetrievalQAChain.fromLLM(llm, vectorStoreRetriever)
return chain
}
async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string> {
const chain = nodeData.instance
const chain = nodeData.instance as ConversationalRetrievalQAChain
let chatHistory = ''
if (options && options.chatHistory) {
@@ -1,5 +1,8 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { LLMChain } from 'langchain/chains'
import { BaseLanguageModel } from 'langchain/base_language'
import { BasePromptTemplate } from 'langchain/prompts'
class LLMChain_Chains implements INode {
label: string
@@ -18,10 +21,11 @@ class LLMChain_Chains implements INode {
this.icon = 'chain.svg'
this.category = 'Chains'
this.description = 'Chain to run queries against LLMs'
this.baseClasses = [this.type, ...getBaseClasses(LLMChain)]
this.inputs = [
{
label: 'LLM',
name: 'llm',
label: 'Language Model',
name: 'model',
type: 'BaseLanguageModel'
},
{
@@ -43,24 +47,17 @@ class LLMChain_Chains implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { LLMChain } = await import('langchain/chains')
return getBaseClasses(LLMChain)
}
async init(nodeData: INodeData): Promise<any> {
const { LLMChain } = await import('langchain/chains')
const model = nodeData.inputs?.model as BaseLanguageModel
const prompt = nodeData.inputs?.prompt as BasePromptTemplate
const llm = nodeData.inputs?.llm
const prompt = nodeData.inputs?.prompt
const chain = new LLMChain({ llm, prompt })
const chain = new LLMChain({ llm: model, prompt })
return chain
}
async run(nodeData: INodeData, input: string): Promise<string> {
const inputVariables = nodeData.instance.prompt.inputVariables // ["product"]
const chain = nodeData.instance
const inputVariables = nodeData.instance.prompt.inputVariables as string[] // ["product"]
const chain = nodeData.instance as LLMChain
if (inputVariables.length === 1) {
const res = await chain.run(input)
@@ -71,7 +68,7 @@ class LLMChain_Chains implements INode {
const promptValues = JSON.parse(promptValuesStr.replace(/\s/g, ''))
let seen = []
let seen: string[] = []
for (const variable of inputVariables) {
seen.push(variable)
@@ -81,13 +78,17 @@ class LLMChain_Chains implements INode {
}
if (seen.length === 1) {
const lastValue = seen.pop()
if (!lastValue) throw new Error('Please provide Prompt Values')
const options = {
...promptValues,
[seen.pop()]: input
[lastValue]: input
}
const res = await chain.call(options)
return res?.text
} else throw new Error('Please provide Prompt Values')
} else {
throw new Error('Please provide Prompt Values')
}
} else {
const res = await chain.run(input)
return res
@@ -1,4 +1,8 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { RetrievalQAChain } from 'langchain/chains'
import { BaseLLM } from 'langchain/llms/base'
import { BaseRetriever } from 'langchain/schema'
import { getBaseClasses } from '../../../src/utils'
class RetrievalQAChain_Chains implements INode {
label: string
@@ -17,11 +21,12 @@ class RetrievalQAChain_Chains implements INode {
this.icon = 'chain.svg'
this.category = 'Chains'
this.description = 'QA chain to answer a question based on the retrieved documents'
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)]
this.inputs = [
{
label: 'LLM',
name: 'llm',
type: 'BaseLanguageModel'
type: 'BaseLLM'
},
{
label: 'Vector Store Retriever',
@@ -31,21 +36,16 @@ class RetrievalQAChain_Chains implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['BaseChain']
}
async init(nodeData: INodeData): Promise<any> {
const { RetrievalQAChain } = await import('langchain/chains')
const llm = nodeData.inputs?.llm
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever
const llm = nodeData.inputs?.llm as BaseLLM
const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever as BaseRetriever
const chain = RetrievalQAChain.fromLLM(llm, vectorStoreRetriever)
return chain
}
async run(nodeData: INodeData, input: string): Promise<string> {
const chain = nodeData.instance
const chain = nodeData.instance as RetrievalQAChain
const obj = {
query: input
}
@@ -0,0 +1,81 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { SqlDatabaseChain } from 'langchain/chains'
import { getBaseClasses } from '../../../src/utils'
import { DataSource } from 'typeorm'
import { SqlDatabase } from 'langchain/sql_db'
import { BaseLLM } from 'langchain/llms/base'
class SqlDatabaseChain_Chains implements INode {
label: string
name: string
type: string
icon: string
category: string
baseClasses: string[]
description: string
inputs: INodeParams[]
constructor() {
this.label = 'Sql Database Chain'
this.name = 'sqlDatabaseChain'
this.type = 'SqlDatabaseChain'
this.icon = 'sqlchain.svg'
this.category = 'Chains'
this.description = 'Answer questions over a SQL database'
this.baseClasses = [this.type, ...getBaseClasses(SqlDatabaseChain)]
this.inputs = [
{
label: 'LLM',
name: 'llm',
type: 'BaseLLM'
},
{
label: 'Database',
name: 'database',
type: 'options',
options: [
{
label: 'SQlite',
name: 'sqlite'
}
],
default: 'sqlite'
},
{
label: 'Database File Path',
name: 'dbFilePath',
type: 'string',
placeholder: 'C:/Users/chinook.db'
}
]
}
async init(nodeData: INodeData): Promise<any> {
const databaseType = nodeData.inputs?.database
const llm = nodeData.inputs?.llm as BaseLLM
const dbFilePath = nodeData.inputs?.dbFilePath
const datasource = new DataSource({
type: databaseType,
database: dbFilePath
})
const db = await SqlDatabase.fromDataSourceParams({
appDataSource: datasource
})
const chain = new SqlDatabaseChain({
llm,
database: db
})
return chain
}
async run(nodeData: INodeData, input: string): Promise<string> {
const chain = nodeData.instance as SqlDatabaseChain
const res = await chain.run(input)
return res
}
}
module.exports = { nodeClass: SqlDatabaseChain_Chains }
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sql" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path>
<path d="M17 8v8h4"></path>
<path d="M13 15l1 1"></path>
<path d="M3 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path>
</svg>

After

Width:  |  Height:  |  Size: 560 B

@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { ChatOpenAI } from 'langchain/chat_models/openai'
class ChatOpenAI_ChatModels implements INode {
label: string
@@ -18,6 +19,7 @@ class ChatOpenAI_ChatModels implements INode {
this.icon = 'openai.png'
this.category = 'Chat Models'
this.description = 'Wrapper around OpenAI large language models that use the Chat endpoint'
this.baseClasses = [this.type, ...getBaseClasses(ChatOpenAI)]
this.inputs = [
{
label: 'OpenAI Api Key',
@@ -63,14 +65,7 @@ class ChatOpenAI_ChatModels implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { ChatOpenAI } = await import('langchain/chat_models')
return getBaseClasses(ChatOpenAI)
}
async init(nodeData: INodeData): Promise<any> {
const { ChatOpenAI } = await import('langchain/chat_models')
const temperature = nodeData.inputs?.temperature as string
const modelName = nodeData.inputs?.modelName as string
const openAIApiKey = nodeData.inputs?.openAIApiKey as string
@@ -0,0 +1,64 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { TextSplitter } from 'langchain/text_splitter'
import { CheerioWebBaseLoader } from 'langchain/document_loaders/web/cheerio'
class Cheerio_DocumentLoaders implements INode {
label: string
name: string
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]
constructor() {
this.label = 'Cheerio Web Scraper'
this.name = 'cheerioWebScraper'
this.type = 'Document'
this.icon = 'cheerio.svg'
this.category = 'Document Loaders'
this.description = `Load data from webpages`
this.baseClasses = [this.type]
this.inputs = [
{
label: 'URL',
name: 'url',
type: 'string'
},
{
label: 'Text Splitter',
name: 'textSplitter',
type: 'TextSplitter',
optional: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
let url = nodeData.inputs?.url as string
var urlPattern = new RegExp(
'^(https?:\\/\\/)?' + // validate protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
'(\\#[-a-z\\d_]*)?$',
'i'
) // validate fragment locator
const loader = new CheerioWebBaseLoader(urlPattern.test(url.trim()) ? url.trim() : '')
if (textSplitter) {
const docs = await loader.loadAndSplit(textSplitter)
return docs
} else {
const docs = await loader.load()
return docs
}
}
}
module.exports = { nodeClass: Cheerio_DocumentLoaders }
@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-letter-c" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
<path d="M14 10a2 2 0 1 0 -4 0v4a2 2 0 1 0 4 0"></path>
</svg>

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -0,0 +1,68 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { TextSplitter } from 'langchain/text_splitter'
import { CSVLoader } from 'langchain/document_loaders/fs/csv'
class Csv_DocumentLoaders implements INode {
label: string
name: string
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]
constructor() {
this.label = 'Csv File'
this.name = 'csvFile'
this.type = 'Document'
this.icon = 'Csv.png'
this.category = 'Document Loaders'
this.description = `Load data from CSV files`
this.baseClasses = [this.type]
this.inputs = [
{
label: 'Csv File',
name: 'csvFile',
type: 'file',
fileType: '.csv'
},
{
label: 'Text Splitter',
name: 'textSplitter',
type: 'TextSplitter',
optional: true
},
{
label: 'Single Column Extraction',
name: 'columnName',
type: 'string',
description: 'Extracting a single column',
placeholder: 'Enter column name',
optional: true
}
]
}
async init(nodeData: INodeData): Promise<any> {
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
const csvFileBase64 = nodeData.inputs?.csvFile as string
const columnName = nodeData.inputs?.columnName as string
const splitDataURI = csvFileBase64.split(',')
splitDataURI.pop()
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
const blob = new Blob([bf])
const loader = new CSVLoader(blob, columnName.trim().length === 0 ? undefined : columnName.trim())
if (textSplitter) {
const docs = await loader.loadAndSplit(textSplitter)
return docs
} else {
const docs = await loader.load()
return docs
}
}
}
module.exports = { nodeClass: Csv_DocumentLoaders }
@@ -1,4 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { TextSplitter } from 'langchain/text_splitter'
import { GithubRepoLoader, GithubRepoLoaderParams } from 'langchain/document_loaders/web/github'
class Github_DocumentLoaders implements INode {
label: string
@@ -13,10 +15,11 @@ class Github_DocumentLoaders implements INode {
constructor() {
this.label = 'Github'
this.name = 'github'
this.type = 'Github'
this.type = 'Document'
this.icon = 'github.png'
this.category = 'Document Loaders'
this.description = `Load data from a GitHub repository`
this.baseClasses = [this.type]
this.inputs = [
{
label: 'Repo Link',
@@ -46,23 +49,17 @@ class Github_DocumentLoaders implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['Document']
}
async init(nodeData: INodeData): Promise<any> {
const { GithubRepoLoader } = await import('langchain/document_loaders')
const repoLink = nodeData.inputs?.repoLink as string
const branch = nodeData.inputs?.branch as string
const accessToken = nodeData.inputs?.accessToken as string
const textSplitter = nodeData.inputs?.textSplitter
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
const options = {
const options: GithubRepoLoaderParams = {
branch,
recursive: false,
unknown: 'warn'
} as any
}
if (accessToken) options.accessToken = accessToken
@@ -1,4 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { TextSplitter } from 'langchain/text_splitter'
import { PDFLoader } from 'langchain/document_loaders/fs/pdf'
class Pdf_DocumentLoaders implements INode {
label: string
@@ -13,10 +15,11 @@ class Pdf_DocumentLoaders implements INode {
constructor() {
this.label = 'Pdf File'
this.name = 'pdfFile'
this.type = 'PDF'
this.type = 'Document'
this.icon = 'pdf.svg'
this.category = 'Document Loaders'
this.description = `Load data from PDF files`
this.baseClasses = [this.type]
this.inputs = [
{
label: 'Pdf File',
@@ -49,14 +52,8 @@ class Pdf_DocumentLoaders implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['Document']
}
async init(nodeData: INodeData): Promise<any> {
const { PDFLoader } = await import('langchain/document_loaders')
const textSplitter = nodeData.inputs?.textSplitter
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
const pdfFileBase64 = nodeData.inputs?.pdfFile as string
const usage = nodeData.inputs?.usage as string
@@ -66,7 +63,8 @@ class Pdf_DocumentLoaders implements INode {
const blob = new Blob([bf])
if (usage === 'perFile') {
const loader = new PDFLoader(blob, { splitPages: false })
// @ts-ignore
const loader = new PDFLoader(blob, { splitPages: false, pdfjs: () => import('pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js') })
if (textSplitter) {
const docs = await loader.loadAndSplit(textSplitter)
return docs
@@ -75,7 +73,8 @@ class Pdf_DocumentLoaders implements INode {
return docs
}
} else {
const loader = new PDFLoader(blob)
// @ts-ignore
const loader = new PDFLoader(blob, { pdfjs: () => import('pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js') })
if (textSplitter) {
const docs = await loader.loadAndSplit(textSplitter)
return docs
@@ -1,4 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { TextSplitter } from 'langchain/text_splitter'
import { TextLoader } from 'langchain/document_loaders/fs/text'
class Text_DocumentLoaders implements INode {
label: string
@@ -13,10 +15,11 @@ class Text_DocumentLoaders implements INode {
constructor() {
this.label = 'Text File'
this.name = 'textFile'
this.type = 'Text'
this.type = 'Document'
this.icon = 'textFile.svg'
this.category = 'Document Loaders'
this.description = `Load data from text files`
this.baseClasses = [this.type]
this.inputs = [
{
label: 'Txt File',
@@ -33,13 +36,8 @@ class Text_DocumentLoaders implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['Document']
}
async init(nodeData: INodeData): Promise<any> {
const { TextLoader } = await import('langchain/document_loaders')
const textSplitter = nodeData.inputs?.textSplitter
const textSplitter = nodeData.inputs?.textSplitter as TextSplitter
const txtFileBase64 = nodeData.inputs?.txtFile as string
const splitDataURI = txtFileBase64.split(',')
splitDataURI.pop()
@@ -0,0 +1,40 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { CohereEmbeddings } from 'langchain/embeddings/cohere'
class CohereEmbedding_Embeddings implements INode {
label: string
name: string
type: string
icon: string
category: string
description: string
baseClasses: string[]
inputs: INodeParams[]
constructor() {
this.label = 'Cohere Embeddings'
this.name = 'cohereEmbeddings'
this.type = 'CohereEmbeddings'
this.icon = 'cohere.png'
this.category = 'Embeddings'
this.description = 'Cohere API to generate embeddings for a given text'
this.baseClasses = [this.type, ...getBaseClasses(CohereEmbeddings)]
this.inputs = [
{
label: 'Cohere API Key',
name: 'cohereApiKey',
type: 'password'
}
]
}
async init(nodeData: INodeData): Promise<any> {
const apiKey = nodeData.inputs?.cohereApiKey as string
const model = new CohereEmbeddings({ apiKey })
return model
}
}
module.exports = { nodeClass: CohereEmbedding_Embeddings }
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { OpenAIEmbeddings } from 'langchain/embeddings/openai'
class OpenAIEmbedding_Embeddings implements INode {
label: string
@@ -18,6 +19,7 @@ class OpenAIEmbedding_Embeddings implements INode {
this.icon = 'openai.png'
this.category = 'Embeddings'
this.description = 'OpenAI API to generate embeddings for a given text'
this.baseClasses = [this.type, ...getBaseClasses(OpenAIEmbeddings)]
this.inputs = [
{
label: 'OpenAI Api Key',
@@ -27,13 +29,7 @@ class OpenAIEmbedding_Embeddings implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { OpenAIEmbeddings } = await import('langchain/embeddings')
return getBaseClasses(OpenAIEmbeddings)
}
async init(nodeData: INodeData): Promise<any> {
const { OpenAIEmbeddings } = await import('langchain/embeddings')
const openAIApiKey = nodeData.inputs?.openAIApiKey as string
const model = new OpenAIEmbeddings({ openAIApiKey })
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { HuggingFaceInference } from 'langchain/llms/hf'
class HuggingFaceInference_LLMs implements INode {
label: string
@@ -17,7 +18,8 @@ class HuggingFaceInference_LLMs implements INode {
this.type = 'HuggingFaceInference'
this.icon = 'huggingface.png'
this.category = 'LLMs'
this.description = 'Wrapper around OpenAI large language models'
this.description = 'Wrapper around HuggingFace large language models'
this.baseClasses = [this.type, ...getBaseClasses(HuggingFaceInference)]
this.inputs = [
{
label: 'Model',
@@ -42,14 +44,7 @@ class HuggingFaceInference_LLMs implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { HuggingFaceInference } = await import('langchain/llms')
return getBaseClasses(HuggingFaceInference)
}
async init(nodeData: INodeData): Promise<any> {
const { HuggingFaceInference } = await import('langchain/llms')
const temperature = nodeData.inputs?.temperature as string
const model = nodeData.inputs?.model as string
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { OpenAI } from 'langchain/llms/openai'
class OpenAI_LLMs implements INode {
label: string
@@ -18,6 +19,7 @@ class OpenAI_LLMs implements INode {
this.icon = 'openai.png'
this.category = 'LLMs'
this.description = 'Wrapper around OpenAI large language models'
this.baseClasses = [this.type, ...getBaseClasses(OpenAI)]
this.inputs = [
{
label: 'OpenAI Api Key',
@@ -59,14 +61,7 @@ class OpenAI_LLMs implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { OpenAI } = await import('langchain/llms')
return getBaseClasses(OpenAI)
}
async init(nodeData: INodeData): Promise<any> {
const { OpenAI } = await import('langchain/llms')
const temperature = nodeData.inputs?.temperature as string
const modelName = nodeData.inputs?.modelName as string
const openAIApiKey = nodeData.inputs?.openAIApiKey as string
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { BufferMemory } from 'langchain/memory'
class BufferMemory_Memory implements INode {
label: string
@@ -17,7 +18,8 @@ class BufferMemory_Memory implements INode {
this.type = 'BufferMemory'
this.icon = 'memory.svg'
this.category = 'Memory'
this.description = 'Perform calculations on response'
this.description = 'Remembers previous conversational back and forths directly'
this.baseClasses = [this.type, ...getBaseClasses(BufferMemory)]
this.inputs = [
{
label: 'Memory Key',
@@ -34,13 +36,7 @@ class BufferMemory_Memory implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { BufferMemory } = await import('langchain/memory')
return getBaseClasses(BufferMemory)
}
async init(nodeData: INodeData): Promise<any> {
const { BufferMemory } = await import('langchain/memory')
const memoryKey = nodeData.inputs?.memoryKey as string
const inputKey = nodeData.inputs?.inputKey as string
return new BufferMemory({
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate } from 'langchain/prompts'
class ChatPromptTemplate_Prompts implements INode {
label: string
@@ -18,6 +19,7 @@ class ChatPromptTemplate_Prompts implements INode {
this.icon = 'prompt.svg'
this.category = 'Prompts'
this.description = 'Schema to represent a chat prompt'
this.baseClasses = [this.type, ...getBaseClasses(ChatPromptTemplate)]
this.inputs = [
{
label: 'System Message',
@@ -36,13 +38,7 @@ class ChatPromptTemplate_Prompts implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { ChatPromptTemplate } = await import('langchain/prompts')
return getBaseClasses(ChatPromptTemplate)
}
async init(nodeData: INodeData): Promise<any> {
const { ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate } = await import('langchain/prompts')
const systemMessagePrompt = nodeData.inputs?.systemMessagePrompt as string
const humanMessagePrompt = nodeData.inputs?.humanMessagePrompt as string
@@ -1,5 +1,8 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getInputVariables } from '../../../src/utils'
import { FewShotPromptTemplate, FewShotPromptTemplateInput, PromptTemplate } from 'langchain/prompts'
import { Example } from 'langchain/schema'
import { TemplateFormat } from 'langchain/dist/prompts/template'
class FewShotPromptTemplate_Prompts implements INode {
label: string
@@ -18,6 +21,7 @@ class FewShotPromptTemplate_Prompts implements INode {
this.icon = 'prompt.svg'
this.category = 'Prompts'
this.description = 'Prompt template you can build with examples'
this.baseClasses = [this.type, ...getBaseClasses(FewShotPromptTemplate)]
this.inputs = [
{
label: 'Examples',
@@ -32,7 +36,7 @@ class FewShotPromptTemplate_Prompts implements INode {
{
label: 'Example Prompt',
name: 'examplePrompt',
type: 'BasePromptTemplate'
type: 'PromptTemplate'
},
{
label: 'Prefix',
@@ -73,27 +77,19 @@ class FewShotPromptTemplate_Prompts implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { FewShotPromptTemplate } = await import('langchain/prompts')
return getBaseClasses(FewShotPromptTemplate)
}
async init(nodeData: INodeData): Promise<any> {
const { FewShotPromptTemplate } = await import('langchain/prompts')
const examplesStr = nodeData.inputs?.examples as string
const prefix = nodeData.inputs?.prefix as string
const suffix = nodeData.inputs?.suffix as string
const exampleSeparator = nodeData.inputs?.exampleSeparator as string
const templateFormat = nodeData.inputs?.templateFormat
const examplePrompt = nodeData.inputs?.examplePrompt
const templateFormat = nodeData.inputs?.templateFormat as TemplateFormat
const examplePrompt = nodeData.inputs?.examplePrompt as PromptTemplate
const inputVariables = getInputVariables(suffix)
const examples = JSON.parse(examplesStr.replace(/\s/g, ''))
const examples: Example[] = JSON.parse(examplesStr.replace(/\s/g, ''))
try {
const prompt = new FewShotPromptTemplate({
const obj: FewShotPromptTemplateInput = {
examples,
examplePrompt,
prefix,
@@ -101,7 +97,8 @@ class FewShotPromptTemplate_Prompts implements INode {
inputVariables,
exampleSeparator,
templateFormat
})
}
const prompt = new FewShotPromptTemplate(obj)
return prompt
} catch (e) {
throw new Error(e)
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getInputVariables } from '../../../src/utils'
import { PromptTemplate, PromptTemplateInput } from 'langchain/prompts'
class PromptTemplate_Prompts implements INode {
label: string
@@ -18,6 +19,7 @@ class PromptTemplate_Prompts implements INode {
this.icon = 'prompt.svg'
this.category = 'Prompts'
this.description = 'Schema to represent a basic prompt for an LLM'
this.baseClasses = [this.type, ...getBaseClasses(PromptTemplate)]
this.inputs = [
{
label: 'Template',
@@ -29,19 +31,12 @@ class PromptTemplate_Prompts implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { PromptTemplate } = await import('langchain/prompts')
return getBaseClasses(PromptTemplate)
}
async init(nodeData: INodeData): Promise<any> {
const { PromptTemplate } = await import('langchain/prompts')
const template = nodeData.inputs?.template as string
const inputVariables = getInputVariables(template)
try {
const options = {
const options: PromptTemplateInput = {
template,
inputVariables
}
@@ -1,5 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { RecursiveCharacterTextSplitter, RecursiveCharacterTextSplitterParams } from 'langchain/text_splitter'
class RecursiveCharacterTextSplitter_TextSplitters implements INode {
label: string
@@ -18,6 +19,7 @@ class RecursiveCharacterTextSplitter_TextSplitters implements INode {
this.icon = 'textsplitter.svg'
this.category = 'Text Splitters'
this.description = `Split documents recursively by different characters - starting with "\n\n", then "\n", then " "`
this.baseClasses = [this.type, ...getBaseClasses(RecursiveCharacterTextSplitter)]
this.inputs = [
{
label: 'Chunk Size',
@@ -35,17 +37,11 @@ class RecursiveCharacterTextSplitter_TextSplitters implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
const { RecursiveCharacterTextSplitter } = await import('langchain/text_splitter')
return getBaseClasses(RecursiveCharacterTextSplitter)
}
async init(nodeData: INodeData): Promise<any> {
const { RecursiveCharacterTextSplitter } = await import('langchain/text_splitter')
const chunkSize = nodeData.inputs?.chunkSize as string
const chunkOverlap = nodeData.inputs?.chunkOverlap as string
const obj = {} as any
const obj = {} as RecursiveCharacterTextSplitterParams
if (chunkSize) obj.chunkSize = parseInt(chunkSize, 10)
if (chunkOverlap) obj.chunkOverlap = parseInt(chunkOverlap, 10)
@@ -1,7 +1,8 @@
import { INode } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { Calculator } from 'langchain/tools/calculator'
class Calculator implements INode {
class Calculator_Tools implements INode {
label: string
name: string
description: string
@@ -17,17 +18,12 @@ class Calculator implements INode {
this.icon = 'calculator.svg'
this.category = 'Tools'
this.description = 'Perform calculations on response'
}
async getBaseClasses(): Promise<string[]> {
const { Calculator } = await import('langchain/tools')
return getBaseClasses(Calculator)
this.baseClasses = [this.type, ...getBaseClasses(Calculator)]
}
async init(): Promise<any> {
const { Calculator } = await import('langchain/tools')
return new Calculator()
}
}
module.exports = { nodeClass: Calculator }
module.exports = { nodeClass: Calculator_Tools }
@@ -0,0 +1,29 @@
import { INode } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { RequestsGetTool } from 'langchain/tools'
class RequestsGet_Tools implements INode {
label: string
name: string
description: string
type: string
icon: string
category: string
baseClasses: string[]
constructor() {
this.label = 'Requests Get'
this.name = 'requestsGet'
this.type = 'RequestsGet'
this.icon = 'requestsget.svg'
this.category = 'Tools'
this.description = 'Execute HTTP GET requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsGetTool)]
}
async init(): Promise<any> {
return new RequestsGetTool()
}
}
module.exports = { nodeClass: RequestsGet_Tools }
@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-http-get" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M7 8h-2a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2v-4h-1"></path>
<path d="M14 8h-4v8h4"></path>
<path d="M10 12h2.5"></path>
<path d="M17 8h4"></path>
<path d="M19 8v8"></path>
</svg>

After

Width:  |  Height:  |  Size: 487 B

@@ -0,0 +1,29 @@
import { INode } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { RequestsPostTool } from 'langchain/tools'
class RequestsPost_Tools implements INode {
label: string
name: string
description: string
type: string
icon: string
category: string
baseClasses: string[]
constructor() {
this.label = 'Requests Post'
this.name = 'requestsPost'
this.type = 'RequestsPost'
this.icon = 'requestspost.svg'
this.category = 'Tools'
this.description = 'Execute HTTP POST requests'
this.baseClasses = [this.type, ...getBaseClasses(RequestsPostTool)]
}
async init(): Promise<any> {
return new RequestsPostTool()
}
}
module.exports = { nodeClass: RequestsPost_Tools }
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-http-post" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 12h2a2 2 0 1 0 0 -4h-2v8"></path>
<path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path>
<path d="M17 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path>
</svg>

After

Width:  |  Height:  |  Size: 553 B

@@ -1,7 +1,8 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { SerpAPI } from 'langchain/tools'
class SerpAPI implements INode {
class SerpAPI_Tools implements INode {
label: string
name: string
description: string
@@ -25,18 +26,13 @@ class SerpAPI implements INode {
type: 'password'
}
]
}
async getBaseClasses(): Promise<string[]> {
const { SerpAPI } = await import('langchain/tools')
return getBaseClasses(SerpAPI)
this.baseClasses = [this.type, ...getBaseClasses(SerpAPI)]
}
async init(nodeData: INodeData): Promise<any> {
const { SerpAPI } = await import('langchain/tools')
const apiKey = nodeData.inputs?.apiKey as string
return new SerpAPI(apiKey)
}
}
module.exports = { nodeClass: SerpAPI }
module.exports = { nodeClass: SerpAPI_Tools }
@@ -1,4 +1,6 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { Chroma } from 'langchain/vectorstores/chroma'
import { Embeddings } from 'langchain/embeddings/base'
class Chroma_Existing_VectorStores implements INode {
label: string
@@ -17,6 +19,7 @@ class Chroma_Existing_VectorStores implements INode {
this.icon = 'chroma.svg'
this.category = 'Vector Stores'
this.description = 'Load existing index from Chroma (i.e: Document has been upserted)'
this.baseClasses = [this.type, 'BaseRetriever']
this.inputs = [
{
label: 'Embeddings',
@@ -31,15 +34,9 @@ class Chroma_Existing_VectorStores implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['BaseRetriever']
}
async init(nodeData: INodeData): Promise<any> {
const { Chroma } = await import('langchain/vectorstores')
const collectionName = nodeData.inputs?.collectionName as string
const embeddings = nodeData.inputs?.embeddings
const embeddings = nodeData.inputs?.embeddings as Embeddings
const vectorStore = await Chroma.fromExistingCollection(embeddings, {
collectionName
@@ -1,4 +1,7 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { Chroma } from 'langchain/vectorstores/chroma'
import { Embeddings } from 'langchain/embeddings/base'
import { Document } from 'langchain/document'
class ChromaUpsert_VectorStores implements INode {
label: string
@@ -17,6 +20,7 @@ class ChromaUpsert_VectorStores implements INode {
this.icon = 'chroma.svg'
this.category = 'Vector Stores'
this.description = 'Upsert documents to Chroma'
this.baseClasses = [this.type, 'BaseRetriever']
this.inputs = [
{
label: 'Document',
@@ -36,28 +40,20 @@ class ChromaUpsert_VectorStores implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['BaseRetriever']
}
async init(nodeData: INodeData): Promise<any> {
const { Chroma } = await import('langchain/vectorstores')
const { Document } = await import('langchain/document')
const collectionName = nodeData.inputs?.collectionName as string
const docs = nodeData.inputs?.document
const embeddings = nodeData.inputs?.embeddings
const docs = nodeData.inputs?.document as Document[]
const embeddings = nodeData.inputs?.embeddings as Embeddings
const finalDocs = []
for (let i = 0; i < docs.length; i += 1) {
finalDocs.push(new Document(docs[i]))
}
const result = await Chroma.fromDocuments(finalDocs, embeddings, {
const vectorStore = await Chroma.fromDocuments(finalDocs, embeddings, {
collectionName
})
const retriever = result.asRetriever()
const retriever = vectorStore.asRetriever()
return retriever
}
}
@@ -1,5 +1,7 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { PineconeClient } from '@pinecone-database/pinecone'
import { PineconeStore } from 'langchain/vectorstores/pinecone'
import { Embeddings } from 'langchain/embeddings/base'
class Pinecone_Existing_VectorStores implements INode {
label: string
@@ -18,6 +20,7 @@ class Pinecone_Existing_VectorStores implements INode {
this.icon = 'pinecone.png'
this.category = 'Vector Stores'
this.description = 'Load existing index from Pinecone (i.e: Document has been upserted)'
this.baseClasses = [this.type, 'BaseRetriever']
this.inputs = [
{
label: 'Embeddings',
@@ -42,17 +45,11 @@ class Pinecone_Existing_VectorStores implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['BaseRetriever']
}
async init(nodeData: INodeData): Promise<any> {
const { PineconeStore } = await import('langchain/vectorstores')
const pineconeApiKey = nodeData.inputs?.pineconeApiKey as string
const pineconeEnv = nodeData.inputs?.pineconeEnv as string
const index = nodeData.inputs?.pineconeIndex as string
const embeddings = nodeData.inputs?.embeddings
const embeddings = nodeData.inputs?.embeddings as Embeddings
const client = new PineconeClient()
await client.init({
@@ -1,5 +1,8 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { PineconeClient } from '@pinecone-database/pinecone'
import { PineconeStore } from 'langchain/vectorstores/pinecone'
import { Embeddings } from 'langchain/embeddings/base'
import { Document } from 'langchain/document'
class PineconeUpsert_VectorStores implements INode {
label: string
@@ -18,6 +21,7 @@ class PineconeUpsert_VectorStores implements INode {
this.icon = 'pinecone.png'
this.category = 'Vector Stores'
this.description = 'Upsert documents to Pinecone'
this.baseClasses = [this.type, 'BaseRetriever']
this.inputs = [
{
label: 'Document',
@@ -47,19 +51,12 @@ class PineconeUpsert_VectorStores implements INode {
]
}
async getBaseClasses(): Promise<string[]> {
return ['BaseRetriever']
}
async init(nodeData: INodeData): Promise<any> {
const { PineconeStore } = await import('langchain/vectorstores')
const { Document } = await import('langchain/document')
const pineconeApiKey = nodeData.inputs?.pineconeApiKey as string
const pineconeEnv = nodeData.inputs?.pineconeEnv as string
const index = nodeData.inputs?.pineconeIndex as string
const docs = nodeData.inputs?.document
const embeddings = nodeData.inputs?.embeddings
const docs = nodeData.inputs?.document as Document[]
const embeddings = nodeData.inputs?.embeddings as Embeddings
const client = new PineconeClient()
await client.init({
@@ -74,11 +71,10 @@ class PineconeUpsert_VectorStores implements INode {
finalDocs.push(new Document(docs[i]))
}
const result = await PineconeStore.fromDocuments(finalDocs, embeddings, {
const vectorStore = await PineconeStore.fromDocuments(finalDocs, embeddings, {
pineconeIndex
})
const retriever = result.asRetriever()
const retriever = vectorStore.asRetriever()
return retriever
}
}
+6 -4
View File
@@ -1,6 +1,6 @@
{
"name": "flowise-components",
"version": "1.0.0",
"version": "1.1.1",
"description": "Flowiseai Components",
"main": "dist/src/index",
"types": "dist/src/index.d.ts",
@@ -20,15 +20,17 @@
"@huggingface/inference": "^1.6.3",
"@pinecone-database/pinecone": "^0.0.12",
"axios": "^0.27.2",
"cheerio": "^1.0.0-rc.12",
"chromadb": "^1.3.1",
"cohere-ai": "^6.2.0",
"d3-dsv": "2",
"dotenv": "^16.0.0",
"express": "^4.17.3",
"form-data": "^4.0.0",
"langchain": "^0.0.44",
"langchain": "^0.0.53",
"moment": "^2.29.3",
"node-fetch": "2",
"pdfjs-dist": "^3.5.141",
"uuid": "^9.0.0",
"pdf-parse": "^1.1.1",
"ws": "^8.9.0"
},
"devDependencies": {
-1
View File
@@ -75,7 +75,6 @@ export interface INodeProperties {
export interface INode extends INodeProperties {
inputs?: INodeParams[]
getBaseClasses?(): Promise<string[]>
getInstance?(nodeData: INodeData): Promise<string>
run?(nodeData: INodeData, input: string, options?: ICommonObject): Promise<string>
}
+1 -2
View File
@@ -14,8 +14,7 @@
"strictPropertyInitialization": false,
"useUnknownInCatchVariables": false,
"declaration": true,
"module": "commonjs",
"moduleResolution": "node16"
"module": "commonjs"
},
"include": ["src", "nodes"]
}