Skip to main content

Refario Python telemetry SDK for LLM run and span ingestion

Project description

Python SDK

Refario Python ingestion SDK package: refario-sdk. This package publishes Refario telemetry helpers for LLM run and span ingestion from Python services.

Install

pip install refario-sdk

Usage

from refario_sdk import refario

client = refario.init(
    endpoint="http://localhost:3000",
    api_key="YOUR_API_KEY",
)

run = client.start_run(workflow="example-workflow", environment="prod")

run.llm_call(
    name="openai-call",
    provider="openai",
    model="gpt-4o",
    status="success",
    prompt_tokens=120,
    completion_tokens=80,
    latency_ms=900,
)

run.end(success=True)

TS-Style Compatibility Helpers

  • refario.init({ "endpoint": "...", "apiKey": "..." })
  • client.startRun({ "workflow": "...", "environment": "..." })
  • run.llmCall({ ... }), run.toolCall({ ... }), run.chainCall({ ... })

Local tests

From python-sdk/:

PYTHONPATH=src python3 -m unittest discover -s tests -p "test_*.py"

Local package checks

From repo root:

python3 -m pip install --upgrade build twine
PYTHONPATH=python-sdk/src python3 -m unittest discover -s python-sdk/tests -p "test_*.py"
python3 -m build python-sdk
python3 -m twine check python-sdk/dist/*

Release process

  1. Bump version in python-sdk/pyproject.toml.
  2. Commit and push to main.
  3. Create and push a release tag matching the package version (for example python-sdk-v0.1.0):
git tag python-sdk-v<version>
git push origin python-sdk-v<version>

The Release Python SDK GitHub Action publishes to PyPI when the tag is pushed. You can also run the workflow manually via workflow_dispatch and optionally select a version bump (patch, minor, major, or custom) before publishing.

Required GitHub secret

  • PYPI_API_TOKEN with publish access to the refario-sdk package on PyPI.

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

refario_sdk-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

refario_sdk-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file refario_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: refario_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for refario_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 598c0a5b12664a7be6642bda0b593364db38fb2b1a701eb387f156305a46568d
MD5 5b6d6bb62f0238393d38ece5d4be1ae3
BLAKE2b-256 19de3f3a4c87e8bb4ea8401d7e966ba84b7f96df0b8e23d447d9d1ebaa9e102a

See more details on using hashes here.

File details

Details for the file refario_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: refario_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for refario_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa3d7e2eff9e7623238d5695441d9df5a7d99e2607b5fade855c5d762815cc03
MD5 6309b2bd597cbe3d8446ba858bfe0aaf
BLAKE2b-256 afbdc00cb3529273b05e96bba138c2066621543189355c83877081db6797dec9

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