File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # pip install langchain-community
2+ # export BRAVE_SEARCH_API=your_api_key_here
3+ # export OPENAI_API_KEY=your_api_key_here
4+
5+ from praisonaiagents import Agent , PraisonAIAgents
6+ from langchain_community .tools import BraveSearch
7+ import os
8+
9+ def search_brave (query : str ):
10+ """Searches using BraveSearch and returns results."""
11+ api_key = os .environ ['BRAVE_SEARCH_API' ]
12+ tool = BraveSearch .from_api_key (api_key = api_key , search_kwargs = {"count" : 3 })
13+ return tool .run (query )
14+
15+ data_agent = Agent (instructions = "Search about AI job trends in 2025" , tools = [search_brave ])
16+ editor_agent = Agent (instructions = "Write a blog article" )
17+ agents = PraisonAIAgents (agents = [data_agent , editor_agent ])
18+ agents .start ()
Original file line number Diff line number Diff line change 1+ # pip install langchain-community google-search-results
2+ # export SERPAPI_API_KEY=your_api_key_here
3+ # export OPENAI_API_KEY=your_api_key_here
4+
5+ from langchain_community .utilities .google_trends import GoogleTrendsAPIWrapper
6+ from praisonaiagents import Agent , PraisonAIAgents
7+
8+ research_agent = Agent (
9+ instructions = "Research trending topics related to AI" ,
10+ tools = [GoogleTrendsAPIWrapper ]
11+ )
12+
13+ summarise_agent = Agent (
14+ instructions = "Summarise findings from the research agent" ,
15+ )
16+
17+ agents = PraisonAIAgents (agents = [research_agent , summarise_agent ])
18+ agents .start ()
Original file line number Diff line number Diff line change 1+ # pip install langchain-community google-search-results
2+ # export SERPAPI_API_KEY=your_api_key_here
3+ # export OPENAI_API_KEY=your_api_key_here
4+
5+ from praisonaiagents import Agent , PraisonAIAgents
6+ from langchain_community .utilities import SerpAPIWrapper
7+
8+ data_agent = Agent (instructions = "Search about AI job trends in 2025" , tools = [SerpAPIWrapper ])
9+ editor_agent = Agent (instructions = "Write a blog article" )
10+
11+ agents = PraisonAIAgents (agents = [data_agent , editor_agent ])
12+ agents .start ()
You can’t perform that action at this time.
0 commit comments