An abstraction layer for AWS Bedrock. Removes the need to keep track of response/request schemas.
Project description
BasicBedrock
AWS Bedrock provides a variety of foundational models to AWS customers. Each model family requires their own request structure, yet the underlying semantics are roughly common; there is always a field for the textual input prompt, and often there are fields to define maximum desired output, stop words, P, K and Temperature values.
This package aims to abstract away all of that. Currently, it only abstracts the input prompt and the answer text, but I plan to also inlcude abstraction layers for the other parameters as well.
Usage
Rather simple to use. See example/simple.py for some usage.
import boto3
from basicbedrock import BasicBedrock
session = boto3.session.Session(profile_name="default",region_name="us-west-2")
bb = BasicBedrock(session=session)
model = "anthropic.claude-3-sonnet-20240229-v1:0"
prompt = "Tell me about flowers"
r = bb.invoke(model, prompt)
print(r.get_answer())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basicbedrock-0.0.1.tar.gz.
File metadata
- Download URL: basicbedrock-0.0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e7b7f372322efb497b428cbf0023f4e4378311ac668fa51f9da75f354b7216f
|
|
| MD5 |
da08fb3050428b9174e8142bebbe56be
|
|
| BLAKE2b-256 |
ccf3614894fe00f2ad513e21607ab94d74d69ab45831c97d2863c7ddea8c4917
|
File details
Details for the file basicbedrock-0.0.1-py3-none-any.whl.
File metadata
- Download URL: basicbedrock-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67c222b1d94884039fac500afdc7ebd5f2bee7491c5d35488dd3ce22a0d8603f
|
|
| MD5 |
3aaf0f510e301053ddd669726a8f45c8
|
|
| BLAKE2b-256 |
831c15d5ffb4da613d5bdfbfe2dea5a84324620693a85f024d4e7a66ba0fd2fd
|