Skip to content

Commit

Permalink
fix wordings
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Sep 27, 2024
1 parent f51c8d3 commit 147eae0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion templates/types/multiagent/fastapi/app/api/routers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_last_message_content(self) -> str:

def _get_agent_messages(self, max_messages: int = 5) -> List[str]:
"""
Construct agent messages from the annotations in the chat messages
Construct agent messages from the agent events in the annotations of the chat messages
"""
agent_messages = []
for message in self.messages:
Expand All @@ -138,6 +138,7 @@ def _get_agent_messages(self, max_messages: int = 5) -> List[str]:
annotation.data, AgentAnnotation
):
text = annotation.data.text
# TODO: we should not filter the message by its text, but by its type - we need to send the event type in the AgentAnnotation
if not text.startswith("Finished task"):
agent_messages.append(
f"\nAgent: {annotation.data.agent}\nsaid: {text}\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ def create_choreography(chat_history: Optional[List[ChatMessage]] = None):
publisher = create_publisher(chat_history)
reviewer = FunctionCallingAgent(
name="reviewer",
description="expert in reviewing blog posts, need a written post to review",
description="expert in reviewing blog posts, needs 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],
description="expert in writing blog posts, need provided information and images to write a blog post",
description="expert in writing blog posts, needs researched 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.
Finally, always request the publisher to create an document (pdf, html) and publish the blog post.""",
# TODO: add chat_history support to AgentCallingAgent
# chat_history=chat_history,
verbose=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create_orchestrator(chat_history: Optional[List[ChatMessage]] = None):
)
reviewer = FunctionCallingAgent(
name="reviewer",
description="expert in reviewing blog posts, need a written blog post to review",
description="expert in reviewing blog posts, needs 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ def create_publisher(chat_history: List[ChatMessage]):
For a normal request, you should choose the type of document either pdf or html or just reply to the user directly without generating any document file.
""",
chat_history=chat_history,
verbose=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create_workflow(chat_history: Optional[List[ChatMessage]] = None):
)
reviewer = FunctionCallingAgent(
name="reviewer",
description="expert in reviewing blog posts, need a written blog post to review",
description="expert in reviewing blog posts, needs 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 147eae0

Please sign in to comment.