Spaces:
Sleeping
Sleeping
Update agents.py
Browse files
agents.py
CHANGED
|
@@ -2,62 +2,58 @@ from crewai import Agent
|
|
| 2 |
|
| 3 |
from tools import get_scrape_tool, get_search_tool
|
| 4 |
|
| 5 |
-
def
|
| 6 |
return Agent(
|
| 7 |
-
role="
|
| 8 |
-
goal="
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
-
def
|
| 21 |
return Agent(
|
| 22 |
-
role="
|
| 23 |
-
goal="
|
| 24 |
-
"
|
| 25 |
-
backstory="
|
| 26 |
-
"
|
| 27 |
-
"
|
| 28 |
-
"the
|
| 29 |
-
"
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
-
def
|
| 36 |
return Agent(
|
| 37 |
-
role="
|
| 38 |
-
goal="
|
| 39 |
-
"
|
| 40 |
-
backstory="
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
def get_risk_management_agent():
|
| 51 |
-
return Agent(
|
| 52 |
-
role="Risk Advisor",
|
| 53 |
-
goal="Evaluate and provide insights on the risks "
|
| 54 |
-
"associated with potential trading activities.",
|
| 55 |
-
backstory="Armed with a deep understanding of risk assessment models "
|
| 56 |
-
"and market dynamics, this agent scrutinizes the potential "
|
| 57 |
-
"risks of proposed trades. It offers a detailed analysis of "
|
| 58 |
-
"risk exposure and suggests safeguards to ensure that "
|
| 59 |
-
"trading activities align with the firm’s risk tolerance.",
|
| 60 |
-
verbose=True,
|
| 61 |
-
allow_delegation=True,
|
| 62 |
-
tools = [get_scrape_tool(), get_search_tool()]
|
| 63 |
)
|
|
|
|
| 2 |
|
| 3 |
from tools import get_scrape_tool, get_search_tool
|
| 4 |
|
| 5 |
+
def get_content_planner_agent():
|
| 6 |
return Agent(
|
| 7 |
+
role="Content Planner",
|
| 8 |
+
goal="Plan engaging and factually accurate content on {topic}",
|
| 9 |
+
backstory="You're working on planning a blog article "
|
| 10 |
+
"about the topic: {topic}."
|
| 11 |
+
"You collect information that helps the "
|
| 12 |
+
"audience learn something "
|
| 13 |
+
"and make informed decisions. "
|
| 14 |
+
"Your work is the basis for "
|
| 15 |
+
"the Content Writer to write an article on this topic.",
|
| 16 |
+
tools = [get_scrape_tool(), get_search_tool()],
|
| 17 |
+
allow_delegation=False,
|
| 18 |
+
verbose=True
|
| 19 |
)
|
| 20 |
|
| 21 |
+
def get_content_writer_agent():
|
| 22 |
return Agent(
|
| 23 |
+
role="Content Writer",
|
| 24 |
+
goal="Write insightful and factually accurate "
|
| 25 |
+
"opinion piece about the topic: {topic}",
|
| 26 |
+
backstory="You're working on a writing "
|
| 27 |
+
"a new opinion piece about the topic: {topic}. "
|
| 28 |
+
"You base your writing on the work of "
|
| 29 |
+
"the Content Planner, who provides an outline "
|
| 30 |
+
"and relevant context about the topic. "
|
| 31 |
+
"You follow the main objectives and "
|
| 32 |
+
"direction of the outline, "
|
| 33 |
+
"as provide by the Content Planner. "
|
| 34 |
+
"You also provide objective and impartial insights "
|
| 35 |
+
"and back them up with information "
|
| 36 |
+
"provide by the Content Planner. "
|
| 37 |
+
"You acknowledge in your opinion piece "
|
| 38 |
+
"when your statements are opinions "
|
| 39 |
+
"as opposed to objective statements.",
|
| 40 |
+
allow_delegation=False,
|
| 41 |
+
verbose=True
|
| 42 |
)
|
| 43 |
|
| 44 |
+
def get_editor_agent():
|
| 45 |
return Agent(
|
| 46 |
+
role="Editor",
|
| 47 |
+
goal="Edit a given blog post to align with "
|
| 48 |
+
"the writing style of the organization. ",
|
| 49 |
+
backstory="You are an editor who receives a blog post "
|
| 50 |
+
"from the Content Writer. "
|
| 51 |
+
"Your goal is to review the blog post "
|
| 52 |
+
"to ensure that it follows journalistic best practices,"
|
| 53 |
+
"provides balanced viewpoints "
|
| 54 |
+
"when providing opinions or assertions, "
|
| 55 |
+
"and also avoids major controversial topics "
|
| 56 |
+
"or opinions when possible.",
|
| 57 |
+
allow_delegation=False,
|
| 58 |
+
verbose=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
)
|