Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions agent_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from bedrock_agentcore import BedrockAgentCoreApp
from strands import Agent

app = BedrockAgentCoreApp()
agent = Agent()


@app.entrypoint
def agent_invocation(payload):
"""Handler for agent invocation"""
user_message = payload.get(
"prompt", "No prompt found in input, please guide customer to create a json payload with prompt key"
)
app.logger.info("invoking agent with user message: %s", payload)
response = agent(user_message)
app.logger.info("response payload: %s", response)
return response
# return "hello"


app.run()
30 changes: 30 additions & 0 deletions buildspec-lambda-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 0.2

phases:
pre_build:
commands:
- echo "Lambda compute build starting (no Docker)..."
- start=$(date +%s)
- echo "Setting up Python environment..."
- python3 -m venv /tmp/venv
- source /tmp/venv/bin/activate
- pip install --upgrade pip

build:
commands:
- echo "Installing dependencies..."
- pip install -e . --target /tmp/layer
- echo "Creating deployment package..."
- cd /tmp/layer
- zip -r /tmp/deployment.zip .
- cd $CODEBUILD_SRC_DIR
- zip -r /tmp/deployment.zip . -x "*.git*" -x "*__pycache__*"
- echo "Package size: $(du -h /tmp/deployment.zip)"

post_build:
commands:
- end=$(date +%s)
- echo "Build completed in $((end - start)) seconds"
- echo "Uploading to S3..."
- aws s3 cp /tmp/deployment.zip s3://bedrock-agentcore-codebuild-sources-309149493152-us-west-2/test_siwabhi_9_6_3/lambda-deployment.zip
- echo "Lambda package ready (no container needed)"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies = [
"questionary>=2.1.0",
"openapi-spec-validator>=0.7.2",
"py-openapi-schema-to-json-schema>=0.0.3",
"strands-agents>=1.7.1",
]

[project.scripts]
Expand Down
Loading