Metadata-Version: 2.5
Name: multichat-api
Version: 1.0.0
Summary: Python helpers for the MultiChat developer API: convert, optimise, compact, store context, RAG. Your own provider keys, never ours.
Author: Digital Deep Ltd
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25
Description-Content-Type: text/markdown

# multichat-api (Python)

Helpers for the MultiChat developer API (`docs/api/developer.openapi.yaml`, v1.0.0). They never sit
between you and your provider: convert, optimise, compact or store context here, then send the
request with your own key and the provider's own SDK.

```python
from multichat_api import Client
from openai import OpenAI

mc = Client()   # MULTICHAT_API_KEY; MULTICHAT_URL for your own instance
req = mc.optimise(request, format="openai.chat.completions",
                  steps=["trim", "tools", "reasoning", "model"],
                  settings={"turn": 12, "n": 10, "profile": 1})["request"]
reply = OpenAI().chat.completions.create(**req)
```

Every operation in the spec has a method: `convert`, `sync_encode`, `sync_decode`, `optimise`,
`truncate_tool_results`, `describe_media`, `compact`, `start_compact_job`, `get_job`, `cancel_job`,
`summarise`, contexts (`create_context`, `store_turns`, `history_tool`, `retrieve`, ...), RAG
(`create_collection`, `add_documents`, `query`), `embed`, `count_tokens`, `usage`. Errors raise
`MultichatError` with `status` and `code`.

Tests run against the engine itself (`MC_ENGINE`, default `/home/user/mc-engine`): `pytest`.

## Licence

Apache License 2.0: see `LICENSE`, with the attribution notices in `NOTICE`.
Copyright 2026 Digital Deep Ltd.

Licence headers: source files in this package carry no per-file licence header; the `LICENSE`
and `NOTICE` files at the package root cover every file in it, and are shipped with every
published build. New files may start with the two-line header below, and must not carry any
other licence. If you copy files out of this package, keep `LICENSE` and `NOTICE` with them
(Apache-2.0, section 4). Contributions are accepted under Apache-2.0 (section 5).

```
# Copyright 2026 Digital Deep Ltd
# SPDX-License-Identifier: Apache-2.0
```
