File size: 1,331 Bytes
3670b47
945b678
5ee8a3a
5d22cf7
3aeba90
3670b47
5d83ebb
3126477
3aeba90
 
73b4a69
3aeba90
fad01dd
48a17ba
af90c08
3670b47
 
3aeba90
3670b47
73b4a69
e9c9203
3aeba90
 
106a077
3aeba90
5ee8a3a
48a17ba
af90c08
3670b47
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 crewai import Agent
from langchain_openai import ChatOpenAI
from tools import scrape_tool, search_tool, today_tool

def get_researcher_agent(model, max_tokens, temperature, verbose):
    return Agent(
        role="Researcher",
        goal="Research content on topic: {topic}.",
        backstory="You are a senior research scientist at an ivy league university. "
                  "You're working on researching content on topic '{topic}'. "
                  "Your work is the basis for the Writer to write on this topic.",
        llm=ChatOpenAI(model=model, max_tokens=max_tokens, temperature=temperature),
        tools = [search_tool(), scrape_tool()],
        allow_delegation=False,
    	verbose=verbose
    )

def get_writer_agent(model, max_tokens, temperature, verbose):
    return Agent(
        role="Writer",
        goal="Write an article on topic: {topic}.",
        backstory="You are an award-winning scientific author. "
                  "You're working on writing a 5000-word detailed article on topic '{topic}'. "
                  "You base your writing on the work of the Researcher, who provides context on this topic.",
        llm=ChatOpenAI(model=model, max_tokens=max_tokens, temperature=temperature),
        tools = [today_tool()],
        allow_delegation=False,
        verbose=verbose
    )