diff --git a/workshops/diy-agents-with-sagemaker-and-bedrock/4-frameworks/crewai/crewai-travel-flows.ipynb b/workshops/diy-agents-with-sagemaker-and-bedrock/4-frameworks/crewai/crewai-travel-flows.ipynb index ede0c63..4ba3196 100644 --- a/workshops/diy-agents-with-sagemaker-and-bedrock/4-frameworks/crewai/crewai-travel-flows.ipynb +++ b/workshops/diy-agents-with-sagemaker-and-bedrock/4-frameworks/crewai/crewai-travel-flows.ipynb @@ -183,24 +183,25 @@ "source": [ "from crewai.flow.flow import Flow, listen, start\n", "from pydantic import BaseModel\n", + "from IPython.display import Markdown, display\n", "\n", "\n", "class TravelAgentFlow(Flow[str]):\n", " @start()\n", " async def search_online(self):\n", - " query = \"Best things to do in {self.city}\"\n", + " query = f\"Best things to do in {self.state.get(\"city\")}\"\n", " result = await researcher_agent.kickoff_async(query)\n", " return result\n", "\n", " @listen(search_online)\n", " async def write_content(self, search_result):\n", - " query = \"{search_result}\\n\\n Based on the search results, write a listicle of 5 things to do in {self.city}\"\n", + " query = f\"{search_result}\\n\\n Based on the search results, write a listicle of 5 things to do in {self.state.get(\"city\")}\"\n", " result = await content_writer.kickoff_async(query)\n", " return result\n", " \n", " @listen(write_content)\n", " async def edit_content(self, listicle):\n", - " query = \"Review and edit the top 5 listicle article about things to do in {self.city}.\\n\\nContent:\\n{listicle}\\n\\nMake sure the content is well-structured, engaging, and error-free.\"\n", + " query = f\"Review and edit the top 5 listicle article about things to do in {self.state.get(\"city\")}.\\n\\nContent:\\n{listicle}\\n\\nMake sure the content is well-structured, engaging, and error-free.\"\n", " result = await editor_agent.kickoff_async(query)\n", " return result\n", "\n", @@ -208,7 +209,7 @@ "flow = TravelAgentFlow()\n", "final_output = await flow.kickoff_async({\"city\": \"Paris\"})\n", "print(\"---- Final Output ----\")\n", - "print(final_output)" + "display(Markdown(str(final_output)))" ] }, {