https://github.com/bigevilbeard/prompt_demo
Building Code Documentation with Amazon Bedrock
https://github.com/bigevilbeard/prompt_demo
Last synced: 12 months ago
JSON representation
Building Code Documentation with Amazon Bedrock
- Host: GitHub
- URL: https://github.com/bigevilbeard/prompt_demo
- Owner: bigevilbeard
- Created: 2025-01-23T09:53:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-23T10:09:40.000Z (over 1 year ago)
- Last Synced: 2025-01-23T10:35:13.428Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# prompt_demo
Building Code Documentation with Amazon Bedrock
##
Create consistent code documentation at scale with Amazon Bedrock Prompt Management. Watch how to automate your documentation workflow using foundation models while maintaining consistent standards across your team. See real implementation examples and learn how to get started with Amazon Bedrock Prompt Management.
# Amazon Bedrock Model Invocation Sample
## Description
This Python script demonstrates how to interact with Amazon Bedrock to invoke AI models using the AWS SDK (boto3). The sample shows how to set up a Bedrock client, make model invocations, and handle responses.
## Prerequisites
- Python 3.x
- AWS account with Bedrock access
- Configured AWS credentials
- Required Python packages:
- boto3
- json
## Installation
1. Clone this repository
2. Install required packages:
```
pip install boto3
```
## Configuration
Before running the script, you need to:
- Configure your AWS credentials
- Update the profile_name with your AWS profile
- Replace the modelId with your chosen Bedrock model ARN
## Features
- AWS Bedrock session initialization
- Model invocation with custom parameters
- JSON request and response handling
- Support for code analysis use cases
## Error Handling
The script includes basic response handling. For production use, consider adding:
- Error checking for AWS credentials
- Model invocation error handling
- Response validation
## Security Notes
- Never commit AWS credentials in your code
- Use environment variables or AWS profiles for authentication
- Ensure proper IAM permissions are set up