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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydantic_ai_bedrock-0.0.7.tar.gz
  • Upload date:
  • Size: 18.7 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.7.tar.gz
Algorithm Hash digest
SHA256 47c547398cbfb2a25c89c491bff1873b2e9bda254f2f41f739ac9265c5aabb3a
MD5 80171b579df0fa248e6976ff636ec01d
BLAKE2b-256 956b13d8596cab90f231708ec3935bf4e5e455782b0198aab1918390aa4cd2af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantic_ai_bedrock-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2d103af8c6dfa0c458fe774e59582e9adeb1eaa070dd8be5e73cd165bbfe6688
MD5 a43a9da485d7892d31f58099ef4b5714
BLAKE2b-256 51e4b01cf4882fb92810dd0507d6c13a23a6b242fdc674ed216b90e630c8a08b

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