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.2.1.tar.gz (18.8 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.2.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydantic_ai_bedrock-0.2.1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pydantic_ai_bedrock-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8da67628172aa547f1605bc54ca92624c57834ccc85977290be255e81071f1c3
MD5 09a031c8f94c6dc869008788f76bf271
BLAKE2b-256 b2258b399ed5c137c431a5e4cfbb3c5193593adca512d153faa6413456d10afc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantic_ai_bedrock-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4dfa836720cef33c1c4fe99d825feb7cb64befabd5ed50895d8a19ad7784ae3
MD5 9e6823faaa8d9356171d9b3406a24812
BLAKE2b-256 8c2f22616f53d65f364113dababeb31f7a6dcbd67a69dc844523084528f760cf

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