Skip to content

Commit a0ed878

Browse files
committed
Update READMEs with template.
1 parent 61433ed commit a0ed878

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

python/example_code/bedrock-agent-runtime/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ Code excerpts that show you how to call individual service functions.
4848
- [InvokeAgent](bedrock_agent_runtime_wrapper.py#L33)
4949
- [InvokeFlow](bedrock_agent_runtime_wrapper.py#L71)
5050

51+
### Scenarios
52+
53+
Code examples that show you how to accomplish a specific task by calling multiple
54+
functions within the same service.
55+
56+
- [Create and invoke a flow](../bedrock-agent/flows/playlist_flow.py)
57+
5158

5259
<!--custom.examples.start-->
5360
<!--custom.examples.end-->
@@ -80,6 +87,29 @@ python flows/flow-conversation.py
8087
<!--custom.basics.bedrock-agent-runtime_Scenario_ConverseWithFlow.end-->
8188

8289

90+
#### Create and invoke a flow
91+
92+
This example shows you how to do the following:
93+
94+
- Create an execution role for the flow.
95+
- Create the flow.
96+
- Deploy the fully configured flow.
97+
- Invoke the flow with user-provided prompts.
98+
- Delete all created resources.
99+
100+
<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockFlows.start-->
101+
<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockFlows.end-->
102+
103+
Start the example by running the following at a command prompt:
104+
105+
```
106+
python ../bedrock-agent/flows/playlist_flow.py
107+
```
108+
109+
110+
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockFlows.start-->
111+
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockFlows.end-->
112+
83113
### Tests
84114

85115
⚠ Running tests might result in charges to your AWS account.

python/example_code/bedrock-agent/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ _Amazon Bedrock Agents offer you the ability to build and configure autonomous a
1111

1212
## ⚠ Important
1313

14-
- Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
15-
- Running the tests might result in charges to your AWS account.
16-
- We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
17-
- This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
14+
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
15+
* Running the tests might result in charges to your AWS account.
16+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
17+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
1818

1919
<!--custom.important.start-->
2020
<!--custom.important.end-->
@@ -82,16 +82,20 @@ functions within the same service.
8282
- [Create and invoke a managed prompt](prompts/scenario_get_started_with_prompts.py)
8383
- [Create and invoke an agent](scenario_get_started_with_agents.py)
8484

85+
8586
<!--custom.examples.start-->
8687
<!--custom.examples.end-->
8788

8889
## Run the examples
8990

9091
### Instructions
9192

93+
9294
<!--custom.instructions.start-->
9395
<!--custom.instructions.end-->
9496

97+
98+
9599
#### Create and invoke a flow
96100

97101
This example shows you how to do the following:
@@ -116,6 +120,7 @@ Start the example by running the following at a command prompt:
116120
python flows/playlist_flow.py
117121
```
118122

123+
119124
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockFlows.start-->
120125

121126
When prompted, enter the genre of music and the number of songs you want
@@ -142,6 +147,7 @@ Start the example by running the following at a command prompt:
142147
python prompts/scenario_get_started_with_prompts.py
143148
```
144149

150+
145151
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockPrompts.start-->
146152

147153
This example shows you how to do the following:
@@ -195,16 +201,20 @@ Start the example by running the following at a command prompt:
195201
python scenario_get_started_with_agents.py
196202
```
197203

204+
198205
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockAgents.start-->
199206
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockAgents.end-->
200207

201208
### Tests
202209

203210
⚠ Running tests might result in charges to your AWS account.
204211

212+
205213
To find instructions for running these tests, see the [README](../../README.md#Tests)
206214
in the `python` folder.
207215

216+
217+
208218
<!--custom.tests.start-->
209219
<!--custom.tests.end-->
210220

python/example_code/bedrock-runtime/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ python -m pip install -r requirements.txt
4848
Code examples that show you how to accomplish a specific task by calling multiple
4949
functions within the same service.
5050

51+
- [Create and invoke a managed prompt](../bedrock-agent/prompts/scenario_get_started_with_prompts.py)
5152
- [Tool use with the Converse API](cross-model-scenarios/tool_use_demo/tool_use_demo.py)
5253

5354
### AI21 Labs Jurassic-2
@@ -154,6 +155,28 @@ python hello/hello_bedrock_runtime_invoke.py
154155
```
155156

156157

158+
#### Create and invoke a managed prompt
159+
160+
This example shows you how to do the following:
161+
162+
- Create a managed prompt.
163+
- Create a version of the prompt.
164+
- Invoke the prompt using the version.
165+
- Clean up resources (optional).
166+
167+
<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockPrompts.start-->
168+
<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockPrompts.end-->
169+
170+
Start the example by running the following at a command prompt:
171+
172+
```
173+
python ../bedrock-agent/prompts/scenario_get_started_with_prompts.py
174+
```
175+
176+
177+
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockPrompts.start-->
178+
<!--custom.scenarios.bedrock-agent_GettingStartedWithBedrockPrompts.end-->
179+
157180
#### Tool use with the Converse API
158181

159182
This example shows you how to build a typical interaction between an application, a generative AI model, and connected tools or APIs to mediate interactions between the AI and the outside world. It uses the example of connecting an external weather API to the AI model so it can provide real-time weather information based on user input.

0 commit comments

Comments
 (0)