- update LangchainJS version

- add types & interfaces

- small ui bug fix

- update marketplace files
This commit is contained in:
Henry
2023-04-13 18:32:00 +01:00
parent 02d8284f58
commit 9281b57ef1
47 changed files with 1178 additions and 1141 deletions
@@ -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 }