Skip to main content

capybara-sdk

Emit OpenTelemetry gen_ai.* traces to a local capybara trace debugger. Import name is capybara.

pip install capybara-sdk
import capybara
from pydantic import BaseModel

capybara.init()  # export to a local capybara on 127.0.0.1:4318


class Price(BaseModel):
    price: float
    currency: str


capybara.schema("lookup_price", Price)  # declared beats learned


@capybara.trace(tool="lookup_price")
def lookup_price(sku: str) -> dict:
    return {"price": 42.0, "currency": "USD"}

init() reuses a TracerProvider you already configured, so OpenInference or OpenLLMetry instrumentors covering OpenAI, Anthropic, or LangChain keep working; capybara only adds an OTLP exporter and the schema processor.

@capybara.trace wraps un-instrumented functions. A bare @capybara.trace records a tool span named after the function; kind="agent" or kind="llm" records other span kinds. capybara.schema(tool, model) attaches a Pydantic model's JSON Schema to that tool's spans so capybara reports contract drift on the first violating call.

Sync and async functions are both supported.

capybara.replay is invoked by the binary, not by you: pressing r in the TUI re-executes the recorded process, serving the recorded model responses and tool outputs so nothing touches the network. A call that is not in the recording stops the replay instead of running live; only model calls made after an edited value has been served are allowed to diverge.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capybara_sdk-0.1.0.tar.gz (73.2 kB view details)

Uploaded Source

Built Distribution

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

capybara_sdk-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file capybara_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: capybara_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 73.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for capybara_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4b0f3b927aa080d7b82fa0cd59647fe025b560054dab254e1b41b5d6b7cbb86
MD5 212a89edec77110ac39e9ef5b8eda758
BLAKE2b-256 4f00c0e9b3645f9a79267a14390df2326eff0a5a9307a8ed2137c3ea5cf89532

See more details on using hashes here.

Provenance

The following attestation bundles were made for capybara_sdk-0.1.0.tar.gz:

Publisher: publish-sdk.yml on tonquoc0407/capybara

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file capybara_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: capybara_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for capybara_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9decbb5c617283224fef97b41f6ecc1dbde0e5909505e9bc4b998582d0bf105e
MD5 0af25696e124a454c8d236aa757d61ae
BLAKE2b-256 0c897bab3ffe070c2ea50fc616be7f3ee4b57ec53aa2b26846c49e210bec8235

See more details on using hashes here.

Provenance

The following attestation bundles were made for capybara_sdk-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on tonquoc0407/capybara

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page