Skip to content

Commit 3694cb2

Browse files
More documentation
1 parent df3f29b commit 3694cb2

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/core/event_handler/bedrock_agents.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Create [Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/usergu
3232

3333
**Function details** consist of a list of parameters, defined by their name, [data type](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ParameterDetail.html), and whether they are required. The agent uses these configurations to determine what information it needs to elicit from the user.
3434

35-
**Action group** is a collection of two resources where you define the actions that the agent should carry out: an OpenAPI schema to define the APIs that the agent can invoke to carry out its tasks, and a Lambda function to execute those actions.
35+
**Action group** is a collection of two resources where you define the actions that the agent should carry out when invoking your Lambda function.
3636

3737
**Large Language Models (LLM)** are very large deep learning models that are pre-trained on vast amounts of data, capable of extracting meanings from a sequence of text and understanding the relationship between words and phrases on it.
3838

@@ -46,11 +46,11 @@ An action group defines actions that the agent can help the user perform. You ca
4646

4747
| Aspect | OpenAPI-based Actions | Function-based Actions |
4848
|----------------------|------------------------------------------------------------------|----------------------------------------------------------------|
49-
| Definition Style | `@app.get("/path", description="")`<br>`@app.post("/path", description="")` | `@app.tool(name="")` |
50-
| Parameter Handling | Path, query, and body parameters | Function parameters |
51-
| Use Case | REST-like APIs, complex request/response structures | Direct function calls, simpler input/output |
52-
| Response object | Via `BedrockResponse` | Via `BedrockFunctionResponse` |
53-
| Best For | - Complex APIs with multiple endpoints<br>- When OpenAPI spec is required<br>- Integration with existing REST APIs | - Simple function-based actions<br>- Direct LLM-to-function mapping<br>- When function descriptions are sufficient |
49+
| Definition Style | `@app.get("/path", description="")`<br>`@app.post("/path", description="")` | `@app.tool(name="")` |
50+
| Parameter Handling | Path, query, and body parameters | Function parameters |
51+
| Use Case | REST-like APIs, complex request/response structures | Direct function calls, simpler input |
52+
| Response object | Via `BedrockResponse` | Via `BedrockFunctionResponse` |
53+
| Best For | - Complex APIs with multiple endpoints<br>- When OpenAPI spec is required<br>- Integration with existing REST APIs | - Simple function-based actions<br>- Direct LLM-to-function mapping |
5454

5555
## Getting started
5656

@@ -121,16 +121,6 @@ For reference, we use [Logger](../logger.md) and [Tracer](../tracer.md) in this
121121
--8<-- "examples/event_handler_bedrock_agents/src/getting_started_output_func.json"
122122
```
123123

124-
??? note "What happens under the hood?"
125-
Powertools will handle the request from the Agent, parse, validate, and route it to the correct method in your code.
126-
The response is then validated and formatted back to the Agent.
127-
128-
<center>
129-
```mermaid
130-
--8<-- "docs/core/event_handler/bedrock_agents_getting_started.mermaid"
131-
```
132-
</center>
133-
134124
### Accessing custom request fields
135125

136126
The event sent by Amazon Bedrock Agents into your Lambda function contains a [number of extra event fields](#request_fields_table), exposed in the `app.current_event` field.
@@ -346,6 +336,16 @@ You can use `BedrockResponse` class to add additional fields as needed, such as
346336
--8<-- "examples/event_handler_bedrock_agents/src/working_with_bedrockresponse.py"
347337
```
348338

339+
#### Bedrock requests under the hood
340+
341+
Powertools handle the request from the Agent, parse, validate, and route it to the correct method in your code. The response is then validated and formatted back to the Agent.
342+
343+
<center>
344+
```mermaid
345+
--8<-- "docs/core/event_handler/bedrock_agents_getting_started.mermaid"
346+
```
347+
</center>
348+
349349
### Testing your code
350350

351351
Test your routes by passing an [Agent for Amazon Bedrock proxy event](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html#agents-lambda-input) request:

0 commit comments

Comments
 (0)