Skip to content
Discussion options

You must be logged in to vote

To integrate the TavilySearchResults tool into the previously suggested code for sending multiple messages sequentially and collecting responses, follow these steps:

  1. Install the required packages:

    pip install -U "langchain-community>=0.2.11" tavily-python
    export TAVILY_API_KEY="your-api-key"
  2. Set up your Tavily API key:

    import getpass
    import os
    
    if not os.environ.get("TAVILY_API_KEY"):
        os.environ["TAVILY_API_KEY"] = getpass.getpass("Tavily API key:\n")
  3. Instantiate the TavilySearchResults tool:

    from langchain_community.tools import TavilySearchResults
    
    tool = TavilySearchResults(
        max_results=5,
        search_depth="advanced",
        include_answer=True,
        include_raw_content=True,…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mraguth
Comment options

@dosubot
Comment options

Answer selected by mraguth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant