bstraehle commited on
Commit
3aeba90
1 Parent(s): 854079f

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +8 -6
agents.py CHANGED
@@ -2,25 +2,27 @@ from crewai import Agent
2
  from langchain_openai import ChatOpenAI
3
  from tools import scrape_tool, search_tool, today_tool
4
 
5
- def get_researcher_agent(model, temperature, verbose):
6
  return Agent(
7
  role="Researcher",
8
  goal="Research content on topic: {topic}.",
9
- backstory="You're working on researching content on topic {topic}. "
 
10
  "Your work is the basis for the Writer to write on this topic.",
11
- llm=ChatOpenAI(model=model, temperature=temperature),
12
  tools = [search_tool(), scrape_tool()],
13
  allow_delegation=False,
14
  verbose=verbose
15
  )
16
 
17
- def get_writer_agent(model, temperature, verbose):
18
  return Agent(
19
  role="Writer",
20
  goal="Write an article on topic: {topic}.",
21
- backstory="You're working on writing a 2000-word article on topic {topic}. "
 
22
  "You base your writing on the work of the Researcher, who provides context on this topic.",
23
- llm=ChatOpenAI(model=model, temperature=temperature),
24
  tools = [today_tool()],
25
  allow_delegation=False,
26
  verbose=verbose
 
2
  from langchain_openai import ChatOpenAI
3
  from tools import scrape_tool, search_tool, today_tool
4
 
5
+ def get_researcher_agent(model, max_tokens, temperature, verbose):
6
  return Agent(
7
  role="Researcher",
8
  goal="Research content on topic: {topic}.",
9
+ backstory="You are a senior research scientist at an ivy league university. "
10
+ "You're working on researching content on topic '{topic}'. "
11
  "Your work is the basis for the Writer to write on this topic.",
12
+ llm=ChatOpenAI(model=model, max_tokens=max_tokens, temperature=temperature),
13
  tools = [search_tool(), scrape_tool()],
14
  allow_delegation=False,
15
  verbose=verbose
16
  )
17
 
18
+ def get_writer_agent(model, max_tokens, temperature, verbose):
19
  return Agent(
20
  role="Writer",
21
  goal="Write an article on topic: {topic}.",
22
+ backstory="You are an award-winning scientific author. "
23
+ "You're working on writing a 5000-word detailed article on topic '{topic}'. "
24
  "You base your writing on the work of the Researcher, who provides context on this topic.",
25
+ llm=ChatOpenAI(model=model, max_tokens=max_tokens, temperature=temperature),
26
  tools = [today_tool()],
27
  allow_delegation=False,
28
  verbose=verbose