Overview
Integration details
Class | Package | PY support | Version |
---|---|---|---|
TavilyExtract | @langchain/tavily | ✅ |
Setup
The integration lives in the@langchain/tavily
package, which you can install as shown below:
Credentials
Set up an API key here and set it as an environment variable namedTAVILY_API_KEY
.
Instantiation
You can import and instantiate an instance of theTavilyExtract
tool like this:
Invocation
Invoke directly with args
The Tavily Extract tool accepts the following arguments during invocation:-
urls
(required): A list of URLs to extract content from. -
Both
extractDepth
andincludeImages
can also be set during invocation
Invoke with ToolCall
We can also invoke the tool with a model-generatedToolCall
, in which case a ToolMessage
will be returned:
Chaining
We can use our tool in a chain by first binding it to a tool-calling model and then calling it:Agents
For guides on how to use LangChain tools in agents, see the LangGraph.js docs.API reference
For detailed documentation of all Tavily Extract API features and configurations head to the API reference: docs.tavily.com/documentation/api-reference/endpoint/extractRelated
- Tool conceptual guide
- Tool how-to guides