Skip to main content

Refario Python ingestion SDK

Project description

Python SDK

Refario Python ingestion SDK package: refario-sdk.

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 to publish the current python-sdk/pyproject.toml version.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: refario_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 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.0.tar.gz
Algorithm Hash digest
SHA256 dc185a2af76e2fb10f696a01b1a31c73492ee51d608b66ca397db07f4591021d
MD5 2da29a3b471bfe8458eed2d942c2ac5e
BLAKE2b-256 8daca221080fe5d182bd758fedef0fa4b644c76880a2253184edb8a6f1f3458d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refario_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9229950713d212536c80d2c97d9a534af66512a3ba2bbbc687e28c26e4781a30
MD5 7a110d741808636faf021e35da12b2bd
BLAKE2b-256 229d81788909875bfc9e4594cb9431f64bab8a0e356d65ffeacbc79f6b780c11

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