File size: 1,040 Bytes
3670b47
945b678
15d06fc
5d22cf7
4d658da
3670b47
5d83ebb
1c954e9
 
bcf83ea
4d658da
b06b408
48a17ba
bcf83ea
3670b47
 
9136642
3670b47
bcf83ea
ddf4b3b
 
106a077
4d658da
48a17ba
bcf83ea
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
from crewai import Agent
from langchain_openai import ChatOpenAI
from tools import scrape_tool, search_tool, today_tool

def get_researcher_agent(model):
    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 Blogger to post on this topic.",
        llm=ChatOpenAI(model=model, temperature=0.7),
        tools = [search_tool(), scrape_tool(), today_tool],
        allow_delegation=False,
    	verbose=False
    )

def get_blogger_agent(model):
    return Agent(
        role="Blogger",
        goal="Write a {word_count}-word blog post on topic {topic}",
        backstory="You're working on writing a {word_count}-word blog post on topic {topic}. "
                  "You base your writing on the work of the Researcher, who provides context on this topic.",
        llm=ChatOpenAI(model=model, temperature=0.7),
        allow_delegation=False,
        verbose=False
    )