LangExtract provider plugin for AWS Bedrock
Project description
LangExtract AWS Bedrock Provider
A provider plugin for LangExtract that supports AWS Bedrock models.
Installation
pip install langextract-bedrock
Supported Model IDs
You can use any AWS Bedrock model by specifying it's ARN, for example:
config = factory.ModelConfig(model_id="anthropic.claude-3-5-sonnet-20240620-v1:0", provider="BedrockLanguageModel")
model = factory.create_model(config)
Environment Variables
Set any of the following environment variables:
For credentials:
AWS_PROFILEAWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY
For settings:
AWS_DEFAULT_REGION(defaults to us-east-1)
Usage
Use with lx.extract by pre-pending the model ARN with bedrock/:
import langextract as lx
result = lx.extract(
text="Your document here",
model_id="bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0",
prompt_description="Extract entities",
examples=[...]
)
Development
- Install in development mode:
pip install -e . - Run tests:
python test_plugin.py,pytest -v tests/(run pytest with AWS creds for AWS Bedrock inference tests) - Build package:
python -m build - Publish to PyPI:
twine upload dist/*
License
Apache License 2.0
Project details
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 langextract_bedrock-0.1.3.tar.gz.
File metadata
- Download URL: langextract_bedrock-0.1.3.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd2ba87bd9d0e2f4e49899be70c661c144f149e190db0a7929ba5250f86d732e
|
|
| MD5 |
69f2385be442b1e98263e49a07470976
|
|
| BLAKE2b-256 |
9cc82f9c4bffa8137824243c2d1b3ee757d244c54adf25312d00437725cf23d8
|
Provenance
The following attestation bundles were made for langextract_bedrock-0.1.3.tar.gz:
Publisher:
python-publish.yml on andyxhadji/langextract-bedrock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langextract_bedrock-0.1.3.tar.gz -
Subject digest:
fd2ba87bd9d0e2f4e49899be70c661c144f149e190db0a7929ba5250f86d732e - Sigstore transparency entry: 805024727
- Sigstore integration time:
-
Permalink:
andyxhadji/langextract-bedrock@bf36743d5c4963a48617ffc3756aec8b21511211 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/andyxhadji
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bf36743d5c4963a48617ffc3756aec8b21511211 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langextract_bedrock-0.1.3-py3-none-any.whl.
File metadata
- Download URL: langextract_bedrock-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
007bd5c80781528e063ee4cd79affa8d8e31ca03cde485618be583acd19ea59f
|
|
| MD5 |
d8dd5f4eb3fa0774d1d08d3579fc48d4
|
|
| BLAKE2b-256 |
aca25fda8c2d938aad98bfd0bb565e796b01376835889a5bd6ebfb75231e6ecd
|
Provenance
The following attestation bundles were made for langextract_bedrock-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on andyxhadji/langextract-bedrock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langextract_bedrock-0.1.3-py3-none-any.whl -
Subject digest:
007bd5c80781528e063ee4cd79affa8d8e31ca03cde485618be583acd19ea59f - Sigstore transparency entry: 805024733
- Sigstore integration time:
-
Permalink:
andyxhadji/langextract-bedrock@bf36743d5c4963a48617ffc3756aec8b21511211 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/andyxhadji
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bf36743d5c4963a48617ffc3756aec8b21511211 -
Trigger Event:
release
-
Statement type: