Skip to main content

Raindrop integration for Pydantic AI

Project description

raindrop-pydantic-ai

Raindrop integration for Pydantic AI. Automatically captures Agent run() and run_sync() calls including input, output, model name, and token usage.

Installation

pip install raindrop-pydantic-ai pydantic-ai

Usage

from raindrop_pydantic_ai import create_raindrop_pydantic_ai
from pydantic_ai import Agent

raindrop = create_raindrop_pydantic_ai(
    api_key="rk_...",
    user_id="user-123",
)

agent = Agent("openai:gpt-4o", system_prompt="Be helpful")
wrapped = raindrop["wrap"](agent)

result = wrapped.run_sync("What is the capital of France?")
print(result.output)

raindrop["flush"]()

What gets captured

  • Agent runs: input prompt, output text (including structured output), model name
  • Token usage: input_tokens and output_tokens from the result
  • Errors: tracked and re-raised to the caller
  • Async support: both run() (async) and run_sync() (sync) are instrumented

Options

Option Type Default Description
api_key str required Raindrop API key
user_id str None Associate all events with a user
convo_id str None Group events into a conversation

Testing

cd packages/pydantic-ai-python
pip install -e .
python -m pytest tests/ -v

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

raindrop_pydantic_ai-0.0.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

raindrop_pydantic_ai-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file raindrop_pydantic_ai-0.0.2.tar.gz.

File metadata

  • Download URL: raindrop_pydantic_ai-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for raindrop_pydantic_ai-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f7ad3066452af3e81c32447fe821bed1e80f701230a76298bdd2686d2bd752ec
MD5 e56618c109c00c9c8afd393eca5368a3
BLAKE2b-256 224033a84120221aab1bfafd86fe7a22721f698128b697c0f93e7b8767072ef5

See more details on using hashes here.

File details

Details for the file raindrop_pydantic_ai-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for raindrop_pydantic_ai-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 70a04d1640ceb5a8203ede47deff36472fca16797073ad051442aa54253bc771
MD5 f808d81ab36ea4163399fe71beee11e1
BLAKE2b-256 115c18a4f4a61d8a7167cf575362c390a7b514fb08be21f1de41bb939d7e39eb

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