Skip to content

Commit e052f60

Browse files
authored
Use lwa_fastapi_middleware_bedrock_agent package in bedrock-agent-fastapi example (#361)
* Use `lwa_fastapi_middleware_bedrock_agent` middleware * Add a comment about the middleware
1 parent e092a60 commit e052f60

File tree

3 files changed

+3
-83
lines changed

3 files changed

+3
-83
lines changed

examples/bedrock-agent-fastapi/app/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import datetime
22

33
import boto3
4-
from middleware import BedrockAgentMiddleware
4+
# This is from "lwa_fastapi_middleware_bedrock_agent" package (https://pypi.org/project/lwa-fastapi-middleware-bedrock-agent/)
5+
from bedrock_agent.middleware import BedrockAgentMiddleware
56
from fastapi import FastAPI, Query
67
from pydantic import BaseModel, Field
78

examples/bedrock-agent-fastapi/app/middleware.py

Lines changed: 0 additions & 82 deletions
This file was deleted.

examples/bedrock-agent-fastapi/app/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ h11==0.14.0
99
httptools==0.6.1
1010
idna==3.6
1111
jmespath==1.0.1
12+
lwa_fastapi_middleware_bedrock_agent==0.0.4
1213
pydantic==2.5.3
1314
pydantic_core==2.14.6
1415
python-dateutil==2.8.2

0 commit comments

Comments
 (0)