Skip to main content
Node Details
-
Name: Serper
-
Type: Serper
-
Version: 1.0
-
Category: Tools
-
Description: Wrapper around Serper.dev - Google Search API
Parameters
This node doesn’t have any input parameters specific to its functionality. However, it requires a credential to be connected:
Credential
-
Label: Connect Credential
-
Name: credential
-
Type: credential
-
Credential Names: serperApi
The node doesn’t have any specific inputs defined in the inputs array. The main input it requires is the Serper API key, which is obtained through the connected credential.
Output is not explicitly defined in this class, but it will return a new instance of the Serper class from the @langchain/community/tools/serper package.
Functionality
The Serper node initializes a Serper tool that can be used for Google searches. Here’s how it works:
-
When initialized, it retrieves the credential data associated with the node.
-
It extracts the Serper API key from the credential data.
-
It creates and returns a new instance of the
Serper class, passing the API key as a parameter.
Usage
This node is typically used as part of a larger workflow where Google search functionality is needed. It can be combined with other nodes to create more complex search and information retrieval systems.
Base Classes
The node inherits from the following base classes:
-
Serper
-
Any additional base classes of the Serper tool from the LangChain community package
Implementation Details
-
The class
Serper_Tools implements the INode interface.
-
It uses utility functions like
getBaseClasses, getCredentialData, and getCredentialParam from the project’s utility module.
-
The
init method is asynchronous and handles the initialization of the Serper tool with the provided API key.
Note
To use this node, you need to have a valid Serper API key and set up the corresponding credential in your application.