File size: 1,568 Bytes
3670b47
945b678
5ee8a3a
5d22cf7
7582d0f
3670b47
5d83ebb
3126477
07fcd22
73b4a69
7582d0f
fad01dd
48a17ba
af90c08
3670b47
 
5dbb1f9
3670b47
5dbb1f9
e9c9203
07fcd22
38743fe
 
 
d4ebe88
38743fe
 
 
 
 
 
 
 
 
 
bb60376
d4ebe88
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
30
31
32
33
34
35
36
37
38
39
40
from crewai import Agent
from langchain_openai import ChatOpenAI
from tools import scrape_tool, search_tool, today_tool

def get_researcher_agent(model, verbose):
    return Agent(
        role="Researcher",
        goal="Research content on topic: {topic}.",
        backstory="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),
        tools = [search_tool(), scrape_tool()],
        allow_delegation=False,
    	verbose=verbose
    )

def get_author_agent(model, verbose):
    return Agent(
        role="Author",
        goal="Write an article on topic: {topic}.",
        backstory="You're working on writing an article on topic: {topic}. "
                  "You base your writing on the work of the Researcher, who provides content on this topic. "
                  "Your work is the basis for the Editor to edit the article on this topic.",
        llm=ChatOpenAI(model=model, max_tokens=32768),
        tools = [],
        allow_delegation=False,
        verbose=verbose
    )

def get_editor_agent(model, verbose):
    return Agent(
        role="Editor",
        goal="Edit an article on topic: {topic}.",
        backstory="You're working on editing an article on topic: {topic}. "
                  "You base your editing on the work of the Author, who provides an article on this topic.",
        llm=ChatOpenAI(model=model, max_tokens=32768),
        tools = [],
        allow_delegation=False,
        verbose=verbose
    )