-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30f89b4
commit d0d9c1b
Showing
2 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
sidebar_position: 2 | ||
|
||
--- | ||
# Internet Search | ||
|
||
SalesGPT now has the capability to perform internet searches using DuckDuckGo through a pre-made LangChain tool. This feature allows the AI sales agent to access up-to-date information from the web during conversations, enhancing its ability to provide relevant and timely responses. | ||
|
||
## How to Enable Internet Search | ||
|
||
To enable the DuckDuckGo search functionality in your SalesGPT setup: | ||
|
||
1. Ensure you have the latest version of LangChain installed. | ||
|
||
2. Add the DuckDuckGo search tool to your tools list in the `get_tools` function within the `tools.py` file: | ||
|
||
```python | ||
from langchain.tools import DuckDuckGoSearchRun | ||
|
||
def get_tools(product_catalog): | ||
# ... other tool configurations ... | ||
|
||
tools.extend([ | ||
# ... other tools ... | ||
Tool( | ||
name="WebSearch", | ||
func=DuckDuckGoSearchRun().run, | ||
description="Useful for when you need to search the web for current information.", | ||
), | ||
]) | ||
|
||
return tools | ||
``` | ||
|
||
3. Make sure the `USE_TOOLS_IN_API` environment variable is set to `True` in your `.env` file: | ||
|
||
``` | ||
USE_TOOLS_IN_API=True | ||
``` | ||
|
||
By adding this tool, your SalesGPT agent will be able to perform web searches when it needs to find information that isn't available in its training data or product catalog. This can be particularly useful for answering questions about current events, market trends, or competitor information. | ||
|
||
Remember to use this tool responsibly and in compliance with DuckDuckGo's terms of service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
sidebar_position: 2 | ||
|
||
--- | ||
# Pre-built Tools | ||
|
||
SalesGPT is not limited to just custom-built tools. It can also leverage a wide range of pre-built tools available from LangChain. These tools provide additional capabilities and integrations that can enhance your AI sales agent's functionality. | ||
|
||
## Using LangChain's Pre-built Tools | ||
|
||
LangChain offers a variety of pre-made tools that you can easily integrate into SalesGPT. These tools cover a wide range of functionalities, from web searches to mathematical calculations. | ||
|
||
To use these tools: | ||
|
||
1. Set up the desired tools according to the LangChain documentation. | ||
2. Add the configured tools to the "tools" list in your SalesGPT setup. | ||
|
||
You can find the full list of available tools and their setup instructions in the [LangChain Tools documentation](https://python.langchain.com/v0.2/docs/integrations/tools/). | ||
|
||
Some popular pre-built tools include: | ||
|
||
- Search tools (e.g., SerpAPI, Google Search) | ||
- Calculator tools | ||
- Weather tools | ||
- News API tools | ||
- And many more! | ||
|
||
By incorporating these pre-built tools, you can significantly expand the capabilities of your AI sales agent, allowing it to access real-time information, perform calculations, or integrate with various APIs as needed during sales conversations. | ||
|
||
Remember to review the documentation for each tool you want to use, as some may require additional setup steps or API keys. | ||
|
||
|
||
## Example: Weather Search Tool | ||
|
||
One pre-built tool that has been implemented in SalesGPT is the weather search tool. This serves as a good example of how to set up and use a pre-built tool from LangChain. Here's how it's implemented: | ||
|
||
1. First, ensure you have the necessary API key. For the weather tool, you need an OpenWeatherMap API key. You can get a free key that allows 1000 requests per day from [OpenWeatherMap](https://openweathermap.org/api). | ||
|
||
2. Add the API key to your `.env` file: | ||
|
||
``` | ||
OPENWEATHERMAP_API_KEY=your_api_key_here | ||
``` | ||
|
||
3. In the `tools.py` file, import the necessary components and set up the tool: | ||
|
||
```python | ||
from langchain.tools import OpenWeatherMapAPIWrapper | ||
import os | ||
|
||
def weather_search(query): | ||
OPENWEATHERMAP_API_KEY = os.getenv("OPENWEATHERMAP_API_KEY") | ||
weather = OpenWeatherMapAPIWrapper() | ||
return weather.run(query) | ||
``` | ||
|
||
4. Add the weather tool to your `get_tools` function: | ||
|
||
```python | ||
def get_tools(product_catalog): | ||
tools = load_tools(["openweathermap-api"]) | ||
tools.extend([ | ||
# ... other tools ... | ||
Tool( | ||
name="WeatherSearch", | ||
func=weather_search, | ||
description="Useful for getting current weather information for a specific location.", | ||
), | ||
]) | ||
return tools | ||
``` | ||
|
||
This example demonstrates how to set up a pre-built tool from LangChain. Each tool may have its own setup requirements, such as API keys or additional configurations. Always refer to the LangChain documentation for specific setup instructions for each tool you want to use. | ||
|
||
|