Skip to content

Commit

Permalink
v2.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Oct 18, 2024
1 parent bf542bd commit c4b0bb7
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 38 deletions.
14 changes: 8 additions & 6 deletions agents/finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def get_finance_agent(
) -> Agent:
return Agent(
name="Finance Agent",
role="Analyze financial data",
agent_id="finance-agent",
session_id=session_id,
user_id=user_id,
Expand All @@ -28,14 +29,15 @@ def get_finance_agent(
temperature=agent_settings.default_temperature,
),
tools=[YFinanceTools(enable_all=True)],
description="You are a finance agent",
instructions=["Use tables where possible"],
markdown=True,
description="You are a financial agent with the special skill of analyzing complex financial information.",
instructions=[
"Always use tables to display data",
"Aim to wow the user with your knowledge and expertise.",
],
storage=finance_agent_storage,
add_history_to_messages=True,
num_history_responses=5,
add_datetime_to_instructions=True,
storage=finance_agent_storage,
# Enable monitoring on phidata.app
monitoring=True,
markdown=True,
debug_mode=debug_mode,
)
12 changes: 6 additions & 6 deletions agents/research.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def get_research_agent(
) -> Agent:
return Agent(
name="Research Agent",
role="Write research reports for the New York Times",
agent_id="research-agent",
session_id=session_id,
user_id=user_id,
Expand All @@ -29,14 +30,13 @@ def get_research_agent(
temperature=agent_settings.default_temperature,
),
tools=[ExaTools(type="keyword")],
description=dedent("""\
You are a Research Agent that has the special skill of writing New York Times worthy articles.
If you can directly respond to the user, do so. If the user asks for a report or provides a topic, follow the instructions below.
"""),
description="You are a Research Agent that has the special skill of writing New York Times worthy articles.",
instructions=[
"For the provided topic, run 3 different searches.",
"Read the results carefully and prepare a NYT worthy article.",
"If the user asks for a report or provides a topic, break down the topic into 3 different searches.",
"For each search, run a search and read the results carefully.",
"Prepare a NYT worthy article based on the results of the searches.",
"Focus on facts and make sure to provide references.",
"Aim to wow the user with your knowledge and expertise.",
],
expected_output=dedent("""\
Your articles should be engaging, informative, well-structured and in markdown format. They should follow the following structure:
Expand Down
20 changes: 10 additions & 10 deletions agents/web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def get_web_search_agent(
) -> Agent:
return Agent(
name="Web Search Agent",
agent_id="web-search-agent",
role="Search the web for information",
agent_id="web-search-agent",
session_id=session_id,
user_id=user_id,
model=OpenAIChat(
Expand All @@ -30,13 +30,15 @@ def get_web_search_agent(
temperature=agent_settings.default_temperature,
),
tools=[SerpApiTools()],
description="You are a Web Search Agent that has the special skill of searching the web for information.",
description="You are a Web Search Agent that has the special skill of searching the web for information and presenting the results in a structured manner.",
instructions=[
"If you can directly answer the user's question, do so.",
"Otherwise, search the web for information.",
"Important: \n" " - Focus on legitimate sources",
" - Always provide sources and the links to the information you used to answer the question",
"To answer the user's question, first search the web for information by breaking down the user's question into smaller queries.",
"Make sure you cover all the aspects of the question.",
"Important: \n"
" - Focus on legitimate sources\n"
" - Always provide sources and the links to the information you used to answer the question\n"
" - If you cannot find the answer, say so and ask the user to provide more details.",
"Aim to wow the user with your knowledge and expertise.",
],
expected_output=dedent("""\
Your answer should be in the following format:
Expand All @@ -46,12 +48,10 @@ def get_web_search_agent(
### Sources
{provide the sources and links to the information you used to answer the question}
"""),
markdown=True,
storage=web_search_agent_storage,
add_history_to_messages=True,
num_history_responses=5,
add_datetime_to_instructions=True,
storage=web_search_agent_storage,
# Enable monitoring on phidata.app
monitoring=True,
markdown=True,
debug_mode=debug_mode,
)
10 changes: 9 additions & 1 deletion agents/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def get_youtube_agent(
) -> Agent:
return Agent(
name="YouTube Agent",
role="Answer questions about YouTube videos",
agent_id="youtube-agent",
session_id=session_id,
user_id=user_id,
Expand All @@ -28,7 +29,14 @@ def get_youtube_agent(
temperature=agent_settings.default_temperature,
),
tools=[YouTubeTools()],
description="You are a YouTube agent. Obtain the captions of a YouTube video and answer questions.",
description="You are a YouTube agent that has the special skill of understanding YouTube videos and answering questions about them.",
instructions=[
"When the user asks about a video, confirm that they have provided a valid YouTube URL. If not, ask them for it.",
"Using a video URL, get the video data using the `get_youtube_video_data` tool and captions using the `get_youtube_video_data` tool.",
"Using the data and captions, answer the user's question.",
"If you cannot find the answer in the video, say so and ask the user to provide more details.",
"Aim to wow the user with your knowledge and expertise.",
],
markdown=True,
add_history_to_messages=True,
num_history_responses=5,
Expand Down
2 changes: 1 addition & 1 deletion api/routes/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
youtube_agent = get_youtube_agent(debug_mode=True)

# Create a playground instance
playground = Playground(agents=[finance_agent, research_agent, web_search_agent, youtube_agent])
playground = Playground(agents=[research_agent, web_search_agent, finance_agent, youtube_agent])
# Log the playground endpoint with phidata.app
if getenv("RUNTIME_ENV") == "dev":
playground.create_endpoint("http://localhost:8000")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = [
"nest_asyncio",
"openai",
"pgvector",
"phidata[aws]==2.5.3",
"phidata[aws]==2.5.7",
"pillow",
"psycopg[binary]",
"pypdf",
Expand Down
25 changes: 12 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ alembic==1.13.3
annotated-types==0.7.0
anyio==4.6.2.post1
beautifulsoup4==4.12.3
boto3==1.35.41
botocore==1.35.41
boto3==1.35.43
botocore==1.35.43
certifi==2024.8.30
charset-normalizer==3.4.0
click==8.1.7
Expand All @@ -16,7 +16,6 @@ duckdb==1.1.2
duckduckgo-search==6.3.2
email-validator==2.2.0
exa-py==1.4.0
exceptiongroup==1.2.2
fastapi==0.115.2
fastapi-cli==0.0.5
frozendict==2.4.6
Expand All @@ -26,7 +25,7 @@ google-search-results==2.4.2
h11==0.14.0
html5lib==1.1
httpcore==1.0.6
httptools==0.6.2
httptools==0.6.4
httpx==0.27.2
idna==3.10
iniconfig==2.0.0
Expand All @@ -42,22 +41,22 @@ multitasking==0.0.11
mypy==1.12.0
mypy-extensions==1.0.0
nest-asyncio==1.6.0
numpy==2.0.2
openai==1.51.2
numpy==2.1.2
openai==1.52.0
packaging==24.1
pandas==2.2.3
peewee==3.17.7
pgvector==0.3.5
phidata==2.5.3
phidata==2.5.7
pillow==11.0.0
platformdirs==4.3.6
pluggy==1.5.0
primp==0.6.4
psycopg==3.1.18
psycopg-binary==3.1.18
psycopg==3.1.19
psycopg-binary==3.1.19
pydantic==2.9.2
pydantic-core==2.23.4
pydantic-settings==2.5.2
pydantic-settings==2.6.0
pygments==2.18.0
pypdf==5.0.1
pytest==8.3.3
Expand All @@ -70,7 +69,7 @@ pyyaml==6.0.2
regex==2024.9.11
requests==2.32.3
rich==13.9.2
ruff==0.6.9
ruff==0.7.0
s3transfer==0.10.3
shellingham==1.5.4
six==1.16.0
Expand All @@ -84,11 +83,11 @@ tomli==2.0.2
tqdm==4.66.5
typer==0.12.5
types-beautifulsoup4==4.12.0.20240907
types-html5lib==1.1.11.20240806
types-html5lib==1.1.11.20241018
types-pillow==10.2.0.20240822
typing-extensions==4.12.2
tzdata==2024.2
urllib3==1.26.20
urllib3==2.2.3
uvicorn==0.32.0
uvloop==0.21.0
watchfiles==0.24.0
Expand Down

0 comments on commit c4b0bb7

Please sign in to comment.