-
Notifications
You must be signed in to change notification settings - Fork 38
/
agents.py
65 lines (59 loc) · 2.39 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
from crewai import Agent
from textwrap import dedent
from langchain_community.llms import OpenAI, Ollama
from langchain_openai import ChatOpenAI
class CustomAgents:
def __init__(self):
self.OpenAIGPT4 = ChatOpenAI(model_name="gpt-4o", temperature=0.7)
# self.Ollama = ChatOpenAI(model_name="devainllama3", base_url = "http://localhost:11434/v1")
def architect_agent(self, tools):
return Agent(
role="Software Architect",
backstory=dedent(f"""\
With years of experience in system design,
you excel at breaking down complex problems into manageable solutions,
providing a solid foundation for implementation."""),
goal=dedent(f"""\
Provide a high-level solution overview for a given problem"""),
tools=tools,
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT4,
)
def programmer_agent(self, tools):
return Agent(
role="Software Programmer",
backstory=dedent(f"""\
You havea keen eye for detail and a knack for translating high-level design solutions into robust,
efficient code."""),
goal=dedent(f"""Implement the solution provided by the architect"""),
tools=tools,
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT4,
)
def tester_agent(self, tools):
return Agent(
role="Software Tester",
backstory=dedent(f"""\
Your passion for quality ensures that every piece of code meets the highest
standards through rigorous testing."""),
goal = dedent("""\
Write and run test cases for the code implemented by the programmer"""),
tools=tools,
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT4,
)
def reviewer_agent(self, tools):
return Agent(
role="Software Reviewer",
backstory=dedent("""\
With a critical eye, you review each step of the development process, ensuring quality and consistency."""),
goal=dedent("""\
Review the work of each agent at each step"""),
tools=tools,
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT4,
)