Skip to content

Commit

Permalink
change role to description
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Sep 26, 2024
1 parent 8696146 commit bfef745
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion templates/types/multiagent/fastapi/app/agents/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def schema_call(input: str) -> str:
name=name,
description=(
f"Use this tool to delegate a sub task to the {agent.name} agent."
+ (f" The agent is an {agent.role}." if agent.role else "")
+ (f" The agent is an {agent.description}." if agent.description else "")
),
fn_schema=fn_schema,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def create_choreography(chat_history: Optional[List[ChatMessage]] = None):
publisher = create_publisher(chat_history)
reviewer = FunctionCallingAgent(
name="reviewer",
role="expert in reviewing blog posts",
description="expert in reviewing blog posts, need a written post to review",
system_prompt="You are an expert in reviewing blog posts. You are given a task to review a blog post. Review the post for logical inconsistencies, ask critical questions, and provide suggestions for improvement. Furthermore, proofread the post for grammar and spelling errors. If the post is good, you can say 'The post is good.'",
chat_history=chat_history,
verbose=True,
)
return AgentCallingAgent(
name="writer",
agents=[researcher, reviewer, publisher],
role="expert in writing blog posts",
description="expert in writing blog posts, need provided information and images to write a blog post",
system_prompt="""You are an expert in writing blog posts. You are given a task to write a blog post. Before starting to write the post, consult the researcher agent to get the information you need. Don't make up any information yourself.
After creating a draft for the post, send it to the reviewer agent to receive some feedback and make sure to incorporate the feedback from the reviewer.
You can consult the reviewer and researcher maximal two times. Your output should just contain the blog post.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_orchestrator(chat_history: Optional[List[ChatMessage]] = None):
researcher = create_researcher(chat_history)
writer = FunctionCallingAgent(
name="writer",
role="expert in writing blog posts, need information and images to write a post",
description="expert in writing blog posts, need information and images to write a post",
system_prompt="""You are an expert in writing blog posts.
You are given a task to write a blog post. Don't make up any information yourself.
If you don't have the necessary information to write a blog post, reply "I need information about the topic to write the blog post".
Expand All @@ -21,7 +21,7 @@ def create_orchestrator(chat_history: Optional[List[ChatMessage]] = None):
)
reviewer = FunctionCallingAgent(
name="reviewer",
role="expert in reviewing blog posts, need a written blog post to review",
description="expert in reviewing blog posts, need a written blog post to review",
system_prompt="""You are an expert in reviewing blog posts. You are given a task to review a blog post. Review the post and fix the issues found yourself. You must output a final blog post.
A post must include at lease one valid image, if not, reply "I need images about the topic to write the blog post". An image URL start with example or your website is not valid.
Especially check for logical inconsistencies and proofread the post for grammar and spelling errors.""",
Expand Down
4 changes: 2 additions & 2 deletions templates/types/multiagent/fastapi/app/examples/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def create_publisher(chat_history: List[ChatMessage]):
return FunctionCallingAgent(
name="publisher",
tools=[artifact_tool],
role="expert in publishing, need to specify the type of artifact (pdf, html, or markdown)",
description="expert in publishing, need to specify the type of artifact use a file (pdf, html) or just reply the content directly",
system_prompt="""You are a publisher that help publish the blog post.
For a normal request, you should choose the type of artifact either pdf or html or just reply to the user the markdown content directly with out generating any artifact file.
For a normal request, you should choose the type of artifact either pdf or html or just reply to the user directly without generating any artifact file.
""",
chat_history=chat_history,
verbose=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create_researcher(chat_history: List[ChatMessage]):
return FunctionCallingAgent(
name="researcher",
tools=[get_query_engine_tool(), *duckduckgo_search_tools],
role="expert in retrieving any unknown content or searching for images from the internet",
description="expert in retrieving any unknown content or searching for images from the internet",
system_prompt="You are a researcher agent. You are given a researching task. You must use tools to retrieve information from the knowledge base and search for needed images from the internet for the post.",
chat_history=chat_history,
)
4 changes: 2 additions & 2 deletions templates/types/multiagent/fastapi/app/examples/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def create_workflow(chat_history: Optional[List[ChatMessage]] = None):
)
writer = FunctionCallingAgent(
name="writer",
role="expert in writing blog posts",
description="expert in writing blog posts, need information and images to write a post",
system_prompt="""You are an expert in writing blog posts. You are given a task to write a blog post. Don't make up any information yourself.""",
chat_history=chat_history,
)
reviewer = FunctionCallingAgent(
name="reviewer",
role="expert in reviewing blog posts",
description="expert in reviewing blog posts, need a written blog post to review",
system_prompt="You are an expert in reviewing blog posts. You are given a task to review a blog post. Review the post for logical inconsistencies, ask critical questions, and provide suggestions for improvement. Furthermore, proofread the post for grammar and spelling errors. Only if the post is good enough for publishing, then you MUST return 'The post is good.'. In all other cases return your review.",
chat_history=chat_history,
)
Expand Down

0 comments on commit bfef745

Please sign in to comment.