Skip to content

Commit b40295e

Browse files
Merge pull request MervinPraison#406 from MervinPraison/develop
Add external search tool documentation for PraisonAI agents
2 parents c326aaf + 2f7769d commit b40295e

5 files changed

Lines changed: 302 additions & 65 deletions

File tree

docs/mint.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@
206206
"pages": [
207207
"tools/tools",
208208
"tools/langchain_tools",
209+
{
210+
"group": "External Tools",
211+
"icon": "subscript",
212+
"pages": [
213+
"tools/external/serp-api",
214+
"tools/external/brave-search",
215+
"tools/external/google-trends"
216+
]
217+
},
209218
"tools/duckduckgo_tools",
210219
"tools/arxiv_tools",
211220
"tools/calculator_tools",
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "BraveSearch Tool"
3+
description: "Guide for using the BraveSearch tool with PraisonAI agents."
4+
icon: "magnifying-glass"
5+
---
6+
7+
## Overview
8+
9+
The BraveSearch tool is a tool that allows you to search the web using the BraveSearch API.
10+
11+
```bash
12+
pip install langchain-community google-search-results
13+
```
14+
15+
```bash
16+
export BRAVE_SEARCH_API=your_api_key_here
17+
export OPENAI_API_KEY=your_api_key_here
18+
```
19+
20+
```python
21+
from praisonaiagents import Agent, PraisonAIAgents
22+
from langchain_community.tools import BraveSearch
23+
import os
24+
25+
26+
def search_brave(query: str):
27+
"""Searches using BraveSearch and returns results."""
28+
api_key = os.environ['BRAVE_SEARCH_API']
29+
tool = BraveSearch.from_api_key(api_key=api_key, search_kwargs={"count": 3})
30+
return tool.run(query)
31+
32+
data_agent = Agent(instructions="Search about AI job trends in 2025", tools=[search_brave])
33+
editor_agent = Agent(instructions="Write a blog article")
34+
agents = PraisonAIAgents(agents=[data_agent, editor_agent])
35+
agents.start()
36+
```
37+
38+
Generate your BraveSearch API key from [BraveSearch](https://brave.com/search/api/)
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1+
---
2+
title: "Google Trends Tool"
3+
description: "Guide for using the Google Trends tool with PraisonAI agents."
4+
icon: "arrow-trend-up"
5+
---
16

7+
## Overview
8+
9+
The Google Trends tool is a tool that allows you to search the web using the Google Trends API.
10+
11+
```bash
12+
pip install langchain-community google-search-results
13+
```
14+
15+
```bash
16+
export SERPAPI_API_KEY=your_api_key_here
17+
```
218

319
```python
4-
import os
5-
from langchain_community.tools.google_trends import GoogleTrendsQueryRun
620
from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper
721
from praisonaiagents import Agent, PraisonAIAgents
822

9-
# Set your SerpApi API Key
10-
os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here"
11-
12-
# Initialize the Google Trends API Wrapper and Tool
13-
google_trends_api_wrapper = GoogleTrendsAPIWrapper()
14-
google_trends_tool = GoogleTrendsQueryRun(api_wrapper=google_trends_api_wrapper)
15-
16-
# Define your agents with appropriate tools
1723
research_agent = Agent(
1824
instructions="Research trending topics related to AI",
19-
tools=[google_trends_tool]
25+
tools=[GoogleTrendsAPIWrapper]
2026
)
2127

2228
summarise_agent = Agent(
2329
instructions="Summarise findings from the research agent",
2430
)
2531

26-
# Instantiate and start your PraisonAIAgents
2732
agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
2833
agents.start()
2934
```

docs/tools/external/serp-api.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "SerpAPI Tool"
3+
description: "Guide for using the SerpAPI tool with PraisonAI agents."
4+
icon: "searchengin"
5+
---
6+
7+
## Overview
8+
9+
The SerpAPI tool is a tool that allows you to search the web using the SerpAPI.
10+
11+
```bash
12+
pip install langchain-community google-search-results
13+
export SERPAPI_API_KEY=your_api_key_here
14+
export OPENAI_API_KEY=your_api_key_here
15+
```
16+
17+
```python
18+
from praisonaiagents import Agent, PraisonAIAgents
19+
from langchain_community.utilities import SerpAPIWrapper
20+
21+
data_agent = Agent(instructions="Search about AI job trends in 2025", tools=[SerpAPIWrapper])
22+
editor_agent = Agent(instructions="Write a blog article")
23+
24+
agents = PraisonAIAgents(agents=[data_agent, editor_agent])
25+
agents.start()
26+
```

0 commit comments

Comments
 (0)