This repository provides code for Build Genai Agent Workflowsw with Step Functions workshop. This workshop uses Step Funtions and Bedrock to implement complex tasks with prompt chaining.
This workshop is based on Amazon Bedrock Serverless Prompt Chaining.
This example generates a short story about a given topic.
This task is broken down into multiple subtasks to first generate a list of characters for the story, generate each character's arc for the story, and then finally generate the short story using the character descriptions and arcs. This example illustrates using a loop in a Step Functions state machine to process a list generated by a foundation model in Bedrock, in this case to process the generated list of characters.
CDK code: stacks/story_writer_stack.py
Install both nodejs and python on your computer.
Install CDK:
npm install -g aws-cdk
Set up a virtual env:
python3 -m venv .venv
source .venv/bin/activate
pip install -requirements.txt
Deploy the example with CDK:
cdk deploy --all
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.