Skip to main content

Rust-powered Python SDK for OpenAI-compatible text generation and streaming

Project description

rusty-agent-sdk

PyPI License

Rust-powered Python SDK for OpenAI-compatible text generation and streaming.

Installation

pip install rusty-agent-sdk

Quick Start

Set your API key:

export OPENROUTER_API_KEY="your-key"

Then use the SDK:

from rusty_agent_sdk import Provider

provider = Provider("openai/gpt-4o-mini")

# Blocking generation
text = provider.generate_text("Say hello in one sentence.")
print(text)

# Streaming
for chunk in provider.stream_text("Count to 3."):
    print(chunk, end="", flush=True)
print()

Custom Endpoint

provider = Provider(
    "gpt-4o-mini",
    api_key="sk-...",
    base_url="https://api.openai.com/v1",
)

Example

See examples/basic_usage.py for a runnable demo.

Development

# Build and install locally
uv run maturin develop

# Run checks
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test

License

Apache 2.0

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

rusty_agent_sdk-0.1.0.tar.gz (31.6 kB view details)

Uploaded Source

Built Distributions

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

rusty_agent_sdk-0.1.0-cp39-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rusty_agent_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rusty_agent_sdk-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rusty_agent_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 491fb618c8350d88306f7681189682ac1ebe04e2e00928f956b6e7273fa528eb
MD5 6e544ee024661fe516f461a69732765c
BLAKE2b-256 a6e556aca31793b066ec040e72a1a4936538e5060513f23c8baed54632031c18

See more details on using hashes here.

Provenance

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

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 20380e9c6ea62c0275c11b49454a1ed7a2682daef1878b6e7404c71266f53b70
MD5 668a9b96452da0fbbe71bd8e9a5b7270
BLAKE2b-256 8797eb9caf6345874997c2477291507be76879ed4874184777fe52b8bc0cc40d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-win_amd64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a5bf01d7c4d90b7c522e7677f03eafc995b3bf94438ff61a2ae019b5ef401fdf
MD5 ad63b4f63ec372bb3a630a0b599ffb4b
BLAKE2b-256 10a2c78d2a0e2593cf8922d3d76fd0c30e0a42b6171e08866fa3febd43c9f1f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b59b1d5f42a185c254e073a67bc4a9abc6283d91f39a788e4890ecabad65cd2b
MD5 9eaa71be55ad5230fe4d2a9fff503de1
BLAKE2b-256 f631801c3f531f3e5aebe15b63cbe02fa7793a4cc0a0fff97b480ceb0d5a389b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 822ebb38adeb250d41385897ee2916b4b50d8fd7a925714a7422a4091cfc0554
MD5 4533efd8e200b6857022a1b596eb7ad0
BLAKE2b-256 00769d9ac633aae82a8c6ff22ade9338ae3e0fa34bb03f1ab81c7f6135bfd96f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 df6e78ea66261bb863a6b36dfe3d7faf5d16117c50be875e8f706a643cfec5a6
MD5 1b77bec6c73fb424b763a6dac78a72db
BLAKE2b-256 b401ee88b629c129aef31533757f428b017ef823637c55047ded275b9fa6a69b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b51bfacc6103be2b18a9b4bf144809fb1a9c7d833faf59837cb6023726eb9c29
MD5 ccf9ea058679f15965bea98beec4d6ad
BLAKE2b-256 75f94cf5847bef072dae5914dfffc197a7f9bafc432b71d94539c351fe013306

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

File details

Details for the file rusty_agent_sdk-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rusty_agent_sdk-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 738b7e5489dac80077d46597a50b392e62772a2f1b53beec52860b785fc46888
MD5 680073536118dad7f74e9df954279da5
BLAKE2b-256 fc35d2c09f76a9ef42c2ad7101f51a688e0afb670adb53e910f4085697392bff

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_agent_sdk-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: CI.yml on LEO2822/rusty-agent-sdk

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

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