Skip to content

Commit 34d34f3

Browse files
committed
enhance workflow
1 parent e0bb3f5 commit 34d34f3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

templates/types/multiagent/fastapi/app/examples/artifact_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create_artifact_generator(chat_history: List[ChatMessage]):
1313
name="ArtifactGenerator",
1414
tools=[artifact_tool],
1515
role="expert in generating artifacts (pdf, html)",
16-
system_prompt="You are generator that help generate artifacts (pdf, html) from a given content.",
16+
system_prompt="You are generator that help generate artifacts (pdf, html) from a given content. Please always respond the content again along with the generated artifact.",
1717
chat_history=chat_history,
1818
verbose=True,
1919
)

templates/types/multiagent/fastapi/app/examples/workflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ async def start(self, ctx: Context, ev: StartEvent) -> ResearchEvent:
6666
ctx.data["streaming"] = getattr(ev, "streaming", False)
6767
# start the workflow with researching about a topic
6868
ctx.data["task"] = ev.input
69+
ctx.data["user_input"] = ev.input
6970
return ResearchEvent(input=f"Research for this task: {ev.input}")
7071

7172
@step()
@@ -117,8 +118,9 @@ async def review(
117118
)
118119
)
119120
if post_is_good:
121+
user_input = ctx.data["user_input"]
120122
return GenerateArtifactEvent(
121-
input=f"You're blog post is ready for publication. Please respond with just the blog post. Blog post: ```{old_content}```",
123+
input=f"Please generate an artifact for this content: ```{old_content}```. The user input is: ```{user_input}```",
122124
)
123125
else:
124126
return WriteEvent(

0 commit comments

Comments
 (0)