-
Notifications
You must be signed in to change notification settings - Fork 0
/
agents.py
56 lines (46 loc) · 1.45 KB
/
agents.py
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
from crewai import Agent
from tools import tool
from langchain_openai import ChatOpenAI
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("GOOGLE_API_KEY"))
os.environ["OPENAI_API_KEY"] = "NA"
llm = ChatOpenAI(
model = "crewai-llama3",
base_url = "http://localhost:11434/v1")
# 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
)