-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmycrew.py
56 lines (45 loc) · 1.43 KB
/
mycrew.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, Task, Crew, Process
from langchain_community.llms import Ollama
ollama_llm = Ollama(model="codellama")
from langchain_community.tools import DuckDuckGoSearchRun
search_tool = DuckDuckGoSearchRun()
researcher = Agent(
role='CloudArchitect',
goal='best practices for deploying a web app on Azure using Kubernetes',
backstory="""
you are a cloud architect and you need to find information on a topic.
Azure is your preferred cloud provider and you are looking for information on how to deploy a web app on Azure.
Kubernetes is your preferred container orchestration tool.
""",
verbose=True,
allow_delegation=False,
tools=[search_tool],
llm=ollama_llm
)
writer = Agent(
role='DevOpsEngineer',
goal='create terraform scripts to deploy a web app on Azure',
backstory="""
you are a DevOps engineer and you need to create terraform scripts to deploy a web app on Azure.
Kubernetes is your preferred container orchestration tool.
""",
verbose=True,
allow_delegation=True,
llm=ollama_llm
)
task1 = Task(
description="""Search for information on how to deploy a web app on Azure using Kubernetes""",
agent=researcher,
expected_output=""
)
task2 = Task(
description="""Create terraform scripts to deploy a web app on Azure using Kubernetes""",
agent=writer,
expected_output=""
)
crew = Crew(
agents=[researcher, writer],
tasks=[task1, task2],
verbose=2,
)
result = crew.kickoff()