-
Notifications
You must be signed in to change notification settings - Fork 0
/
agents.py
72 lines (61 loc) · 1.58 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
from crewai import Agent
from dotenv import find_dotenv, load_dotenv
from groq import DefaultHttpxClient
from langchain_groq import ChatGroq
from config.agents import agents
from config.core import config
_ = load_dotenv(find_dotenv())
# proxying access to avoid region limitations
http_client = DefaultHttpxClient(
verify=False,
proxy=os.environ.get("HTTP_PROXY")
)
model = config.model.name
# tokens_per_min = 5000 # https://console.groq.com/settings/limits
temperature = config.model.temperature
max_tokens = config.model.max_tokens
llm_client = ChatGroq(
api_key=os.environ.get("GROQ_API_KEY"),
http_client=http_client,
model=model,
temperature=temperature,
max_tokens=max_tokens
)
# create agents
data_researcher = Agent(
role=agents.explorer.role,
goal=agents.explorer.goal,
verbose=True,
memory=False,
backstory=agents.explorer.backstory,
llm=llm_client,
allow_delegation=False,
)
telegram_post_writer = Agent(
role=agents.writer.role,
goal=agents.writer.goal,
verbose=True,
memory=False,
backstory=agents.writer.backstory,
llm=llm_client,
allow_delegation=False,
)
humanizer_agent = Agent(
role=agents.humanizer.role,
goal=agents.humanizer.goal,
verbose=True,
memory=False,
backstory=agents.humanizer.backstory,
llm=llm_client,
allow_delegation=False,
)
translator_agent = Agent(
role=agents.translator.role,
goal=agents.translator.goal,
verbose=True,
memory=True,
backstory=agents.translator.backstory,
llm=llm_client,
allow_delegation=False,
)