Metadata-Version: 2.4
Name: soyaos
Version: 0.0.0.dev0
Summary: Reserved namespace for SoyaOS — see https://soyaos.ai. Real SDK ships in 0.1.0.
Project-URL: Homepage, https://soyaos.ai
Project-URL: Documentation, https://docs.soyaos.ai
Project-URL: Repository, https://github.com/soyaos/sdk-python
Project-URL: Issues, https://github.com/soyaos/sdk-python/issues
Project-URL: Changelog, https://github.com/soyaos/sdk-python/blob/main/CHANGELOG.md
Author: SoyaOS Contributors
License: MIT License
        
        Copyright (c) 2026 SoyaOS Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agent,llm,openai-compatible,sdk,soyaos
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: ruff>=0.7; extra == 'dev'
Description-Content-Type: text/markdown

# soyaos

Official **Python SDK** for [SoyaOS](https://soyaos.ai). Pure-Python, no
required runtime dependencies, works on CPython 3.10+ and PyPy.

## Install

```bash
pip install soyaos
# or, with uv
uv add soyaos
```

## Two clients

```python
from soyaos import SoyaOSClient, ControlClient
from soyaos.openai_compat import ChatCompletionRequest, ChatMessage

# 1) Talk to soya:* virtual models (OpenAI-compatible surface).
ai = SoyaOSClient(
    base_url="https://api.soyaos.ai/v1",
    api_key="sk-...",
)

resp = ai.chat.completions.create(
    ChatCompletionRequest(
        model="soya:echo",
        messages=[ChatMessage(role="user", content="hello")],
    )
)

# 2) Drive the control plane (Agents, keys, Scope events).
ctl = ControlClient(
    base_url="https://api.soyaos.ai",
    api_key="sk-...",
)
agents = ctl.agents.list()
```

There is also an async variant: `from soyaos import AsyncSoyaOSClient`.

> Because SoyaOS speaks the OpenAI HTTP wire format, you can also point
> the official `openai` Python package at it. This SDK exists for callers
> who want typed access to SoyaOS-specific metadata such as `soya_trace_id`.

## 中文 Quickstart

`soyaos` 是 SoyaOS 的官方 Python SDK，纯 Python 实现，零运行时依赖：

```bash
pip install soyaos
```

```python
from soyaos import SoyaOSClient
from soyaos.openai_compat import ChatCompletionRequest, ChatMessage

client = SoyaOSClient(
    base_url="https://api.soyaos.ai/v1",
    api_key="sk-xxx",
)

resp = client.chat.completions.create(
    ChatCompletionRequest(
        model="soya:echo",
        messages=[ChatMessage(role="user", content="你好")],
    )
)
print(resp.choices[0].message.content)
```

异步用户改用 `AsyncSoyaOSClient`；`ControlClient` 用来管理 Agent / Key /
订阅 Scope 事件。`0.1.0a0` 仅含类型签名，实际 RPC 在 `0.1.0a1` 接通。

## Development

```bash
uv sync --all-extras
uv run ruff check .
uv run mypy
uv run pytest
```

## Release & publish

PyPI publishing is automated by `.github/workflows/publish-pypi.yml`. To cut a
release:

1. Bump `project.version` in `pyproject.toml` (PEP 440) and update `CHANGELOG.md`.
2. Commit, tag `vX.Y.Z` (must match `project.version`), and push the tag.
3. Create a **GitHub Release** from the tag. Publishing the release triggers the
   workflow, which builds an sdist + wheel, verifies the tag/pyproject versions
   match, and uploads to PyPI via the `PYPI_API_TOKEN` repository secret.

The first release of this package is the placeholder `0.0.0.dev0`, published to
reserve the `soyaos` name on PyPI (see APP-433). Real SDK releases start at
`0.1.0a0`; `pip install soyaos` resolves to the highest non-pre-release version,
so the dev0 placeholder does not block normal installs.

## Status

`0.1.0a0` ships **types + signatures only**. Calls raise
`NotImplementedError`. Real RPCs land in `0.1.0a1` — see
[CHANGELOG.md](./CHANGELOG.md).

## License

[MIT](./LICENSE) — © 2026 SoyaOS Contributors.
