-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #412 from asiffarhankhan/main
Add search based tools using wikipedia, serper, serp, brave, exa, duckduckgo
- Loading branch information
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
workspace.code-workspace | ||
.vscode | ||
crewai | ||
.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
data_agent = Agent(instructions="Search and Read Research Papers on DNA Mutation", tools=[duckduckgo]) | ||
editor_agent = Agent(instructions="Write a scientifically researched outcome and findings about DNA Mutation") | ||
agents = PraisonAIAgents(agents=[data_agent, editor_agent]) | ||
agents.start() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from exa_py import Exa | ||
import os | ||
|
||
exa = Exa(api_key=os.environ["EXA_API_KEY"]) | ||
|
||
def search_and_contents(query: str): | ||
"""Search for webpages based on the query and retrieve their contents.""" | ||
# This combines two API endpoints: search and contents retrieval | ||
return str(exa.search_and_contents( | ||
query, use_autoprompt=False, num_results=5, text=True, highlights=True | ||
)) | ||
|
||
data_agent = Agent(instructions="Find the latest jobs for Video Editor in New York at startups", tools=[search_and_contents]) | ||
editor_agent = Agent(instructions="Curate the available jobs at startups and their email for the candidate to apply based on his skills on Canva, Adobe Premiere Pro, and Adobe After Effects") | ||
agents = PraisonAIAgents(agents=[data_agent, editor_agent], process='hierarchical') | ||
agents.start() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from langchain_community.utilities import GoogleSerperAPIWrapper | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
os.environ['SERPER_API_KEY'] = os.getenv('SERPER_API_KEY') | ||
|
||
search = GoogleSerperAPIWrapper() | ||
|
||
data_agent = Agent(instructions="Suggest me top 5 most visited websites for Dosa Recipe", tools=[search]) | ||
editor_agent = Agent(instructions="List out the websites with their url and a short description") | ||
agents = PraisonAIAgents(agents=[data_agent, editor_agent]) | ||
agents.start() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from langchain_community.utilities import SerpAPIWrapper | ||
|
||
data_agent = Agent(instructions="Search about decline of recruitment across various industries with the rise of AI", tools=[SerpAPIWrapper]) | ||
editor_agent = Agent(instructions="Write a blog article pointing out the jobs most at rish due to the rise of AI") | ||
agents = PraisonAIAgents(agents=[data_agent, editor_agent]) | ||
agents.start() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
```python | ||
from praisonaiagents import Agent, PraisonAIAgents | ||
from langchain_community.utilities import WikipediaAPIWrapper | ||
|
||
data_agent = Agent(instructions="Gather all of Messi's record in LaLiga", tools=[WikipediaAPIWrapper]) | ||
summarise_agent = Agent(instructions="Summarize the data into a well structured format") | ||
agents = PraisonAIAgents(agents=[data_agent, summarise_agent]) | ||
agents.start() | ||
``` |