mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 05:01:10 +03:00
Merge branch 'main' into feature/ChatGPT-Plugin
# Conflicts: # packages/components/nodes/tools/RequestsGet/RequestsGet.ts # packages/components/nodes/tools/RequestsPost/RequestsPost.ts # packages/components/package.json
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { INode } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { RequestsGetTool } from 'langchain/tools'
|
||||
|
||||
class RequestsGet implements INode {
|
||||
class RequestsGet_Tools implements INode {
|
||||
label: string
|
||||
name: string
|
||||
description: string
|
||||
@@ -17,17 +18,12 @@ class RequestsGet implements INode {
|
||||
this.icon = 'requestsget.svg'
|
||||
this.category = 'Tools'
|
||||
this.description = 'Execute HTTP GET requests'
|
||||
}
|
||||
|
||||
async getBaseClasses(): Promise<string[]> {
|
||||
const { RequestsGetTool } = await import('langchain/tools')
|
||||
return getBaseClasses(RequestsGetTool)
|
||||
this.baseClasses = [this.type, ...getBaseClasses(RequestsGetTool)]
|
||||
}
|
||||
|
||||
async init(): Promise<any> {
|
||||
const { RequestsGetTool } = await import('langchain/tools')
|
||||
return new RequestsGetTool()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: RequestsGet }
|
||||
module.exports = { nodeClass: RequestsGet_Tools }
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { INode } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { RequestsPostTool } from 'langchain/tools'
|
||||
|
||||
class RequestsPost implements INode {
|
||||
class RequestsPost_Tools implements INode {
|
||||
label: string
|
||||
name: string
|
||||
description: string
|
||||
@@ -17,17 +18,12 @@ class RequestsPost implements INode {
|
||||
this.icon = 'requestspost.svg'
|
||||
this.category = 'Tools'
|
||||
this.description = 'Execute HTTP POST requests'
|
||||
}
|
||||
|
||||
async getBaseClasses(): Promise<string[]> {
|
||||
const { RequestsPostTool } = await import('langchain/tools')
|
||||
return getBaseClasses(RequestsPostTool)
|
||||
this.baseClasses = [this.type, ...getBaseClasses(RequestsPostTool)]
|
||||
}
|
||||
|
||||
async init(): Promise<any> {
|
||||
const { RequestsPostTool } = await import('langchain/tools')
|
||||
return new RequestsPostTool()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: RequestsPost }
|
||||
module.exports = { nodeClass: RequestsPost_Tools }
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user