Orion Python SDK
Python 3.10+ SDK backed by an in-process abi3 PyO3 module. The supported API is
intentionally small: Agent, provider models such as OpenAI, typed results,
lifecycle events, and SDK errors.
import asyncio
from dataclasses import dataclass
from orion_sdk import Agent, OpenAI
@dataclass(frozen=True, slots=True)
class WeatherResult:
city: str
temperature_c: int
@dataclass(frozen=True, slots=True)
class WeatherAnswer:
city: str
temperature_c: int
summary: str
async def get_weather(city: str) -> WeatherResult:
"""Get the current weather for a city."""
return WeatherResult(city, 31)
async def main() -> None:
agent = Agent(
model=OpenAI("gpt-5-mini"),
tools=[get_weather],
output=WeatherAnswer,
instructions="Use the weather tool.",
)
result = await agent.run("What is the weather in Delhi?")
print(result.output.summary)
if __name__ == "__main__":
asyncio.run(main())
Function annotations and docstrings define the tool contract. The SDK derives
schemas internally; Rust validates tool arguments and terminal structured
output; result.output is already the configured Python type.
Use agent.stream(...) for ordered lifecycle events followed by one typed
AgentResult. Registry, runner, codec, raw-schema, adapter, model-reference,
protocol, and native-session APIs are internal and unsupported for application
use.
OrionError exposes the stable Rust error category and retry metadata without
requiring access to runtime internals:
from orion_sdk import Agent, ErrorCode, OrionError
async def run_weather(agent: Agent[WeatherAnswer]) -> None:
try:
result = await agent.run("What is the weather in Delhi?")
print(result.output.summary)
except OrionError as error:
if error.code is ErrorCode.RATE_LIMITED and error.retryable:
print(f"retry after {error.retry_after_ms} ms")
raise
Cancelling the calling task still raises asyncio.CancelledError; Orion does not
replace structured task cancellation with a generic SDK error.
See the complete weather application.
Install for local development
python3.10 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip maturin
cd sdks/python
maturin develop --release
cd ../..
python -m examples.python.weather_agent.main
The example calls an OpenAI-compatible endpoint and requires OPENAI_API_KEY.
To build a distributable wheel without installing it, run:
cd sdks/python
uvx maturin build --release --locked
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orion_agent_sdk-0.0.1.tar.gz.
File metadata
- Download URL: orion_agent_sdk-0.0.1.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb18899adeb4a58bd3c7aa9ccffb3c0a58c84ae207ecf6b260667ff03e0f255
|
|
| MD5 |
7d0342ac59e2c52030a578b2eab0a23e
|
|
| BLAKE2b-256 |
5b3830c398caf440b62fb0a6e848e2f88d174eb3d02c866d7cb8d48505d15fa1
|
Provenance
The following attestation bundles were made for orion_agent_sdk-0.0.1.tar.gz:
Publisher:
release.yml on GtechGovind/orion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orion_agent_sdk-0.0.1.tar.gz -
Subject digest:
3cb18899adeb4a58bd3c7aa9ccffb3c0a58c84ae207ecf6b260667ff03e0f255 - Sigstore transparency entry: 2492750618
- Sigstore integration time:
-
Permalink:
GtechGovind/orion@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/GtechGovind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Trigger Event:
push
-
Statement type:
File details
Details for the file orion_agent_sdk-0.0.1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: orion_agent_sdk-0.0.1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd1bc0605a68a3822562b24fcb5e532c8ed61e361c188cab7135b638ee212b89
|
|
| MD5 |
591c517592c11b96403751c309b8a654
|
|
| BLAKE2b-256 |
95b8696f497778548cd1f52ee1ece2420d749754751b4e47fb0b94d4007a921c
|
Provenance
The following attestation bundles were made for orion_agent_sdk-0.0.1-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on GtechGovind/orion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orion_agent_sdk-0.0.1-cp310-abi3-win_amd64.whl -
Subject digest:
fd1bc0605a68a3822562b24fcb5e532c8ed61e361c188cab7135b638ee212b89 - Sigstore transparency entry: 2492750800
- Sigstore integration time:
-
Permalink:
GtechGovind/orion@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/GtechGovind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Trigger Event:
push
-
Statement type:
File details
Details for the file orion_agent_sdk-0.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: orion_agent_sdk-0.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
985ce895e6a3f954c3ad5375abbdb9bc664e21abb003095ef0d99996fad741bf
|
|
| MD5 |
9cb68eca5d58d1ac57464763f42603f2
|
|
| BLAKE2b-256 |
9dab65603de301b498e5c8e29a064811ca02cc0286adf837b4874279d4db55f5
|
Provenance
The following attestation bundles were made for orion_agent_sdk-0.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on GtechGovind/orion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orion_agent_sdk-0.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
985ce895e6a3f954c3ad5375abbdb9bc664e21abb003095ef0d99996fad741bf - Sigstore transparency entry: 2492750717
- Sigstore integration time:
-
Permalink:
GtechGovind/orion@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/GtechGovind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Trigger Event:
push
-
Statement type:
File details
Details for the file orion_agent_sdk-0.0.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: orion_agent_sdk-0.0.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edbbfb0ff2484b1bd7f28b648fb0d5e3e3d6d3178fe0bfec24d0adcc5066ed20
|
|
| MD5 |
6ec7037e6af0922fa68259c041411dd0
|
|
| BLAKE2b-256 |
edd2a23ba14976315cf64ac9b71fc31265a300c8774ab375e5b63bf55aab1236
|
Provenance
The following attestation bundles were made for orion_agent_sdk-0.0.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on GtechGovind/orion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orion_agent_sdk-0.0.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
edbbfb0ff2484b1bd7f28b648fb0d5e3e3d6d3178fe0bfec24d0adcc5066ed20 - Sigstore transparency entry: 2492750915
- Sigstore integration time:
-
Permalink:
GtechGovind/orion@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/GtechGovind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f2ec02e4b513e1ec6511fc5ec627cc452233f569 -
Trigger Event:
push
-
Statement type: