Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Add tools for ChatGPT plugins #1

Merged
merged 6 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
HenryHengZJ committed Apr 17, 2023
commit 7631f651ab44613d1927c6d2a04869d5b658bc96
12 changes: 4 additions & 8 deletions packages/components/nodes/tools/RequestsGet/RequestsGet.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }
12 changes: 4 additions & 8 deletions packages/components/nodes/tools/RequestsPost/RequestsPost.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }
3 changes: 1 addition & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"langchain": "^0.0.53",
"moment": "^2.29.3",
"node-fetch": "2",
"openai": "^3.2.1",
"pdfjs-dist": "^3.5.141",
"pdf-parse": "^1.1.1",
"ws": "^8.9.0"
},
"devDependencies": {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.