Skip to main content

oxa — Python Reference Implementation

Pure, in-process protocol-conversion library for OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages in Python.

Like the Go and Rust implementations, oxa in Python is not a proxy, HTTP client, router, retry layer, authentication service, or model capability database. It provides deterministic, pure conversions between protocol wire structures and oxa's shared Intermediate Representation (IR).

Architecture

  • Hub-and-spoke: Spoke packages (oxa.openai.chatcompletions, oxa.openai.responses, oxa.anthropic.messages) implement only face → IR and IR → face. No direct face-to-face conversions.
  • Zero runtime dependencies: Pure Python standard library only (dataclasses, typing, json, enum, etc.).
  • Opaque tool inputs (INV-1): Tool call arguments and streaming delta fragments remain unparsed raw JSON text.
  • Shared Golden Vectors: Conforms to the exact same shared vectors/ golden suite as Go and Rust.

Installation

pip install elkpi-oxa

Import in Python:

import oxa
from oxa.openai.chatcompletions import decode_request

Development

The project uses uv for development and environment management:

cd python

# Sync virtualenv and development dependencies
uv sync

# Run tests
uv run pytest

# Type check
uv run mypy

# Lint & format check
uv run ruff check .
uv run ruff format --check .

Vectors Location Convention

Test harnesses locate the shared vectors/ suite by walking up parent directories from python/ until finding a directory containing both vectors/ and .git/. Tests skip cleanly if the repository root is absent (e.g. when building a standalone package archive).

原始 JSON 入口

各 face 导出 decode_request_json(raw_text, table=None) / decode_response_json(raw_text, table=None);stream decoder 支持 feed_json(raw_text)。 旧 dict 接口仍可用;若同时提供 raw_text,它必须对应该 dict。参数原文按完整对象/数组 路径提取,不再通过 tool ID 的字符串位置关联。空 loss 列表不是业务准入证明。

Metadata

Release files for elkpi-oxa 2.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elkpi-oxa 2.5.2
File Size Uploaded Provenance Actions
elkpi_oxa-2.5.2.tar.gz 138.4 kB Without provenance Details for elkpi_oxa-2.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elkpi-oxa 2.5.2
File Interpreter ABI Platform Actions
elkpi_oxa-2.5.2-py3-none-any.whl Python 3 none any Details for elkpi_oxa-2.5.2-py3-none-any.whl

Total release size: 271.5 kB

Release files / elkpi_oxa-2.5.2.tar.gz

Download URL elkpi_oxa-2.5.2.tar.gz
Size 138.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7066cb8d6d92519fc3068c23e1f246cfbd60100208d9a39ad9f607c9aaa8ed4e
BLAKE2b-256 checksum
How to use checksums
de8b1ef6d344d6b1c321c22a225cd8b5a44bb8fbb235e8393759e494bc7e546c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / elkpi_oxa-2.5.2-py3-none-any.whl

Download URL elkpi_oxa-2.5.2-py3-none-any.whl
Size 133.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
789fbfcacf5e83dc8e22d677d3f9860b25012af727cab81713b251e5c0549080
BLAKE2b-256 checksum
How to use checksums
fabe77d0677b25cea9437dda63b3dafc22fec46cfea8bb4a03340241c8953e72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for elkpi-oxa 2.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.5.2 This release

2 release files No provenance

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