Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
Comment on lines +12 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a comment explaining why google-search-results is needed here, as it might not be immediately obvious to the user.

pip install langchain-community google-search-results # Required for parsing 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
```
Comment on lines +16 to +17
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

It would be helpful to include a note here indicating that the SERPAPI_API_KEY is required to use the Google Trends tool, and a link to where users can obtain this key.

export SERPAPI_API_KEY=your_api_key_here # Required for Google Trends API


```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]
)
Comment on lines 23 to 26
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The tools parameter in the Agent constructor expects an instance of the tool, not the class itself. You should instantiate GoogleTrendsAPIWrapper before passing it to the agent. Also, the example is missing the API key setup within the Python code, which is crucial for the tool to function correctly. Consider adding os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here" before the agent definition.

from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper
from praisonaiagents import Agent, PraisonAIAgents
import os

os.environ["SERPAPI_API_KEY"] = "your_serpapi_key_here" # Set your SerpAPI API Key

research_agent = Agent(
    instructions="Research trending topics related to AI",
    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
Comment on lines +13 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency, consider using the same environment variable naming convention as in the BraveSearch documentation (e.g., SERPAPI_API instead of SERPAPI_API_KEY).

export SERPAPI_API=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
Loading