-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add external search tool documentation for PraisonAI agents
- Updated `mint.json` to include new external tools section - Expanded `langchain_tools.mdx` with more comprehensive examples and explanations - Added documentation pages for BraveSearch, Google Trends, and SerpAPI tools - Included installation, setup, and usage examples for external search tools - Organized new documentation under the "External Tools" group
- Loading branch information
1 parent
52461d2
commit 401c068
Showing
5 changed files
with
302 additions
and
65 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
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,38 @@ | ||
--- | ||
title: "BraveSearch Tool" | ||
description: "Guide for using the BraveSearch tool with PraisonAI agents." | ||
icon: "magnifying-glass" | ||
--- | ||
|
||
## Overview | ||
|
||
The BraveSearch tool is a tool that allows you to search the web using the BraveSearch API. | ||
|
||
```bash | ||
pip install langchain-community google-search-results | ||
``` | ||
|
||
```bash | ||
export BRAVE_SEARCH_API=your_api_key_here | ||
export OPENAI_API_KEY=your_api_key_here | ||
``` | ||
|
||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from langchain_community.tools import BraveSearch | ||
import os | ||
|
||
|
||
def search_brave(query: str): | ||
"""Searches using BraveSearch and returns results.""" | ||
api_key = os.environ['BRAVE_SEARCH_API'] | ||
tool = BraveSearch.from_api_key(api_key=api_key, search_kwargs={"count": 3}) | ||
return tool.run(query) | ||
|
||
data_agent = Agent(instructions="Search about AI job trends in 2025", tools=[search_brave]) | ||
editor_agent = Agent(instructions="Write a blog article") | ||
agents = PraisonAIAgents(agents=[data_agent, editor_agent]) | ||
agents.start() | ||
``` | ||
|
||
Generate your BraveSearch API key from [BraveSearch](https://brave.com/search/api/) |
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 |
---|---|---|
@@ -1,29 +1,34 @@ | ||
--- | ||
title: "Google Trends Tool" | ||
description: "Guide for using the Google Trends tool with PraisonAI agents." | ||
icon: "arrow-trend-up" | ||
--- | ||
|
||
## Overview | ||
|
||
The Google Trends tool is a tool that allows you to search the web using the Google Trends API. | ||
|
||
```bash | ||
pip install langchain-community google-search-results | ||
``` | ||
|
||
```bash | ||
export SERPAPI_API_KEY=your_api_key_here | ||
``` | ||
|
||
```python | ||
import os | ||
from langchain_community.tools.google_trends import GoogleTrendsQueryRun | ||
from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
|
||
# Set your SerpApi API Key | ||
os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here" | ||
|
||
# Initialize the Google Trends API Wrapper and Tool | ||
google_trends_api_wrapper = GoogleTrendsAPIWrapper() | ||
google_trends_tool = GoogleTrendsQueryRun(api_wrapper=google_trends_api_wrapper) | ||
|
||
# Define your agents with appropriate tools | ||
research_agent = Agent( | ||
instructions="Research trending topics related to AI", | ||
tools=[google_trends_tool] | ||
tools=[GoogleTrendsAPIWrapper] | ||
) | ||
|
||
summarise_agent = Agent( | ||
instructions="Summarise findings from the research agent", | ||
) | ||
|
||
# Instantiate and start your PraisonAIAgents | ||
agents = PraisonAIAgents(agents=[research_agent, summarise_agent]) | ||
agents.start() | ||
``` |
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,26 @@ | ||
--- | ||
title: "SerpAPI Tool" | ||
description: "Guide for using the SerpAPI tool with PraisonAI agents." | ||
icon: "searchengin" | ||
--- | ||
|
||
## Overview | ||
|
||
The SerpAPI tool is a tool that allows you to search the web using the SerpAPI. | ||
|
||
```bash | ||
pip install langchain-community google-search-results | ||
export SERPAPI_API_KEY=your_api_key_here | ||
export OPENAI_API_KEY=your_api_key_here | ||
``` | ||
|
||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from langchain_community.utilities import SerpAPIWrapper | ||
|
||
data_agent = Agent(instructions="Search about AI job trends in 2025", tools=[SerpAPIWrapper]) | ||
editor_agent = Agent(instructions="Write a blog article") | ||
|
||
agents = PraisonAIAgents(agents=[data_agent, editor_agent]) | ||
agents.start() | ||
``` |
Oops, something went wrong.