Metadata-Version: 2.4
Name: kiapi-relay
Version: 0.3.0
Summary: Shared relay transport for kiapi: request/response schemas, the relay protocol, and a client to reach a kiapi instance over a relay (local filesystem or GCP).
Project-URL: Homepage, https://github.com/kiarina/kiapi
Project-URL: Repository, https://github.com/kiarina/kiapi
Project-URL: Changelog, https://github.com/kiarina/kiapi/blob/main/packages/kiapi-relay/CHANGELOG.md
Author-email: kiarina <kiarinadawa@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,api,kiapi,relay
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Requires-Python: >=3.12
Requires-Dist: fastapi
Requires-Dist: httpx
Requires-Dist: kiarina-utils-common>=2.2.0
Requires-Dist: pydantic-settings
Requires-Dist: pydantic-settings-manager>=3.8.0
Requires-Dist: pydantic>=2
Provides-Extra: gcp
Requires-Dist: google-cloud-storage>=3.7.0; extra == 'gcp'
Requires-Dist: kiarina-lib-google>=2.2.1; extra == 'gcp'
Description-Content-Type: text/markdown

<!-- Language: **English** | [日本語](README.ja.md) -->

# kiapi-relay

[English](README.md) | [日本語](README.ja.md)

Shared relay transport for [kiapi](https://github.com/kiarina/kiapi). It provides
the relay protocol, the request/response schemas, the in-process request runner,
and a client for issuing requests to a kiapi instance over a relay.

This package is platform-agnostic and is depended on by both `kiapi` (the server
side, which runs the relay runner) and `kiapi-proxy` (the client side, which
forwards HTTP requests over a relay).

## Installation

```bash
pip install kiapi-relay

# With the GCP relay backend
pip install "kiapi-relay[gcp]"
```

## Backends

| Module | Description | Extra |
| --- | --- | --- |
| `kiapi_relay.impl.local` | Filesystem-backed relay for local development and verification. | — |
| `kiapi_relay.impl.gcp` | GCP relay (GCS payloads + Firebase Realtime Database notifications). | `gcp` |

## Usage

```python
from kiapi_relay import RelayRequest, RelayResponse, relay_registry

# Resolve a configured relay and issue a request over it.
relay = relay_registry.get("local")
response: RelayResponse = await relay.request(
    RelayRequest(method="GET", path="/health")
)
```

See the [kiapi documentation](https://kiarina.github.io/kiapi/) for the full relay
architecture.

## License

MIT
