File size: 1,327 Bytes
d3b6ca9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from crewai import Agent
from dotenv import load_dotenv
from langchain_groq import ChatGroq
import os
from tools import tool
load_dotenv()


llm = ChatGroq(
    api_key=os.getenv("GROQ_API_KEY"),
    model = "groq/llama-3.1-8b-instant",
    verbose = True,
    temperature = 0.5,
)

## Creating a researcher agent who is responsible to dig the details of particular 
## topic in detail

News_Researcher = Agent(
    role = "Senior Researcher",
    goal = "uncover ground breaking Technologies in {topic}",
    verbose = True,
    memory = True,
    backstory = (
        """
        Driven by curiosity, you are at forefront of the innovation,
        eager to explore and share knowledge that could change the world
        """
    ),
    tools = [tool],
    llm = llm,
    allow_delegation = True,
)

## Creating a writer agent with custom tools responsible in writing news blog

News_Writer = Agent(
    role = 'Writer',
    goal = 'Narrate compelling tech stories about {topic}',
    verbose = True,
    memory = True,
    backstory = (
        """
        With a Flair for simplifying complex topics, you craft engaging
        narratives that captivate and educate, bringing new discoveries to light
        in an accessible manner.
        """
    ),
    tools = [tool],
    llm = llm,
    allow_delegations = False
)