-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresearch_and_write_agent.py
More file actions
29 lines (22 loc) · 1.08 KB
/
research_and_write_agent.py
File metadata and controls
29 lines (22 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from agents import Agent, Runner, WebSearchTool
from dotenv import load_dotenv
load_dotenv()
prompt = input("Enter the topic you want to research and write about: ")
research_agent = Agent(
name="ResearchAgent",
instructions="You are an expert researcher with access to a web search tool. \
When given a topic, you will conduct comprehensive research by finding reliable,\
current sources, cross-checking information, and synthesizing insights. \
Present your findings clearly, logically, and concisely, citing sources and highlighting key trends,\
data points, and conclusions.",
tools=[WebSearchTool()]
)
result = Runner.run_sync(research_agent, prompt)
research_agent_result = result.final_output
writer_agent = Agent(
name="WriterAgent",
instructions="You are a awesome content creator who can create a script for mails using the research provided" \
"by the research agent. Format this script in a professional manner."
)
writer_agent_result = Runner.run_sync(writer_agent, research_agent_result)
print(writer_agent_result.final_output)