-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add external search tool documentation for PraisonAI agents #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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/) | ||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ```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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| summarise_agent = Agent( | ||
| instructions="Summarise findings from the research agent", | ||
| ) | ||
|
|
||
| # Instantiate and start your PraisonAIAgents | ||
| agents = PraisonAIAgents(agents=[research_agent, summarise_agent]) | ||
| agents.start() | ||
| ``` | ||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ``` | ||
|
|
||
| ```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() | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a comment explaining why
google-search-resultsis needed here, as it might not be immediately obvious to the user.