Skip to content

Commit

Permalink
Add external search tool documentation for PraisonAI agents
Browse files Browse the repository at this point in the history
- 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
MervinPraison committed Mar 10, 2025
1 parent 52461d2 commit 401c068
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 65 deletions.
9 changes: 9 additions & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@
"pages": [
"tools/tools",
"tools/langchain_tools",
{
"group": "External Tools",
"icon": "subscript",
"pages": [
"tools/external/serp-api",
"tools/external/brave-search",
"tools/external/google-trends"
]
},
"tools/duckduckgo_tools",
"tools/arxiv_tools",
"tools/calculator_tools",
Expand Down
38 changes: 38 additions & 0 deletions docs/tools/external/brave-search.mdx
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/)
29 changes: 17 additions & 12 deletions docs/tools/external/google-trends.mdx
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()
```
26 changes: 26 additions & 0 deletions docs/tools/external/serp-api.mdx
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()
```
Loading

0 comments on commit 401c068

Please sign in to comment.