File size: 1,709 Bytes
b636541
a76d507
 
b636541
 
 
a76d507
 
 
 
 
 
 
b636541
 
 
 
 
 
 
 
 
 
 
 
 
a76d507
 
 
 
 
 
 
 
 
 
 
 
b636541
a76d507
b636541
a76d507
 
b636541
 
a76d507
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b636541
a76d507
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
56
57
58
59
60
61
62
63
from crewai import Agent, LLM
from tools import tool
import litellm
from dotenv import load_dotenv
load_dotenv()
from langchain_google_genai import ChatGoogleGenerativeAI
import os

## call the gemini models
# llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash",
#                            verbose=True,
#                            temperature=0.5,
#                            google_api_key=os.getenv("GEMINI_API_KEY"))

os.environ["GEMINI_API_KEY"] = os.getenv("GEMINI_API_KEY")
api_key = "AIzaSyA_jVLib-F27Fe6GvPqdHH5VQZ1eRJUJbY"
litellm.api_key = api_key
GEMINI_API_KEY = api_key 

llm = LLM(
    # model="gemini/gemini-1.5-pro-latest",
    model="gemini/gemini-2.0-flash",
    temperature=0.7,
    google_api_key=api_key
)

# Creating a senior researcher agent with memory and verbose mode

news_researcher=Agent(
    role="Senior Researcher",
    goal='Unccover ground breaking technologies in {topic}',
    verbose=True,
    memory=True,
    backstory=(
        "Driven by curiosity, you're at the forefront of"
        "innovation, eager to explore and share knowledge that could change"
        "the world."

    ),
    tools=[tool],
    llm=llm,
    allow_delegation=True

)

## creating a write 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_delegation=False
)