Skip to main content

pydantic_ai_bedrock

Project description

pydantic_ai_bedrock

https://github.com/pydantic/pydantic-ai/issues/118#issuecomment-2589200395

Install

pip install pydantic_ai_bedrock

Usage

from pydantic_ai import Agent
from pydantic_ai_bedrock.bedrock import (
    BedrockModel,
)  # Replace with `pydantic_ai.bedrock import BedrockModel` when pydantic_ai support bedrock

model = BedrockModel(
    model_name="anthropic.claude-3-5-sonnet-20241022-v2:0",
)
agent = Agent(model, system_prompt="You are a helpful assistant.")


if __name__ == "__main__":
    result = agent.run_sync("Hello world!")
    print(result.data)
    print(result.usage())

Develop

Install pre-commit before commit

pip install pre-commit
pre-commit install

Install package locally

pip install -e .[test]

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

pydantic_ai_bedrock-0.0.4.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_ai_bedrock-0.0.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_ai_bedrock-0.0.4.tar.gz.

File metadata

  • Download URL: pydantic_ai_bedrock-0.0.4.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pydantic_ai_bedrock-0.0.4.tar.gz
Algorithm Hash digest
SHA256 80c6702b2852c842ab2074c3006c9dc5e1d8997ce99523fa92d3424a2427805c
MD5 dd704e876310745feaaca8cd0fa74dd5
BLAKE2b-256 d9fdf12bc45180dce4c50f57b2a084fe33e4b7e8d27b2967716b7eac9098f730

See more details on using hashes here.

File details

Details for the file pydantic_ai_bedrock-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_ai_bedrock-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c8c0da82aa390bca6d14fd4617180cba647b2193120755ca3fa1dc072a9affa5
MD5 d20485bbbc3c2fcd36374bd81aa681ac
BLAKE2b-256 d5a56b9f0db9a46a66e1585836de2364e083f53d7045dc636f3ec21adffed9d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page