Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
38 changes: 38 additions & 0 deletions packages/components/nodes/tools/Serper/Serper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses } from '../../../src/utils'
import { Serper } from 'langchain/tools'

class Serper_Tools implements INode {
label: string
name: string
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]

constructor() {
this.label = 'Serper'
this.name = 'serper'
this.type = 'Serper'
this.icon = 'serper.png'
this.category = 'Tools'
this.description = 'Wrapper around Serper.dev - Google Search API'
this.inputs = [
{
label: 'Serper Api Key',
name: 'apiKey',
type: 'password'
}
]
this.baseClasses = [this.type, ...getBaseClasses(Serper)]
}

async init(nodeData: INodeData): Promise<any> {
const apiKey = nodeData.inputs?.apiKey as string
return new Serper(apiKey)
}
}

module.exports = { nodeClass: Serper_Tools }
Binary file added packages/components/nodes/tools/Serper/serper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.