Metadata-Version: 2.4
Name: assistableai
Version: 0.1.0
Summary: Official Python SDK and MCP server for the Assistable AI v3 API (generated from OpenAPI).
Project-URL: Homepage, https://github.com/assistableai/assistableai-sdk
Project-URL: Repository, https://github.com/assistableai/assistableai-sdk
Author: Assistable AI
License-Expression: MIT
Keywords: ai,api,assistable,assistableai,mcp,sdk,voice
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: attrs>=22.2.0
Requires-Dist: httpx<0.29,>=0.23.1
Requires-Dist: python-dateutil>=2.8.0
Provides-Extra: mcp
Requires-Dist: fastmcp<3,>=2.8; extra == 'mcp'
Description-Content-Type: text/markdown

# assistableai (Python)

Official Python SDK **and** MCP server for the **Assistable AI v3 API**, generated
from [`spec/openapi.json`](../../spec/openapi.json) — the same source of truth as
the TypeScript SDK, CLI, and MCP server.

- **SDK** — typed operation functions + models (openapi-python-client: attrs + httpx) with a thin auth wrapper.
- **MCP server** — every v3 operation as an MCP tool, via FastMCP's `from_openapi` (optional `[mcp]` extra).

## Install

```bash
pip install assistableai            # SDK only
pip install 'assistableai[mcp]'     # SDK + MCP server
```

## SDK usage

```python
import assistableai
from assistableai.api.assistants import list_assistants, get_assistant
from assistableai.api.contacts import create_contact
from assistableai.models import ContactCreate  # example model

client = assistableai.configure(
    api_key="ask_live_…",
    subaccount_id="<subaccount-id>",   # sent as X-Subaccount-Id (optional)
)

# Every op exposes sync / sync_detailed / asyncio / asyncio_detailed.
# Responses are the full {data, error, request_id} envelope (a typed model).
envelope = list_assistants.sync(client=client.raw, limit=2)

# Need status codes / headers? Use *_detailed:
resp = get_assistant.sync_detailed("<assistant-id>", client=client.raw)
print(resp.status_code, resp.parsed)

# Per-call subaccount override:
list_assistants.sync(client=client.raw, x_subaccount_id="<other-subaccount>")
```

Credentials resolve from explicit args, then the environment
(`ASSISTABLE_API_KEY`, `ASSISTABLE_SUBACCOUNT_ID`, `ASSISTABLE_BASE_URL`). Default
base URL is `https://api.assistable.ai`.

`configure()` stores a process-global client (`assistableai.get_client()`); for
multiple credentials, construct `assistableai.AssistableAI(...)` instances
directly and pass `.raw`.

## MCP server

```bash
ASSISTABLE_API_KEY=ask_live_… ASSISTABLE_SUBACCOUNT_ID=<id> assistableai-mcp
# or: python -m assistableai.mcp
```

Add to an MCP client (e.g. Claude Desktop):

```json
{
  "mcpServers": {
    "assistableai": {
      "command": "assistableai-mcp",
      "env": {
        "ASSISTABLE_API_KEY": "ask_live_…",
        "ASSISTABLE_SUBACCOUNT_ID": "<subaccount-id>"
      }
    }
  }
}
```

## Develop

```bash
uv sync --all-extras          # create the dev venv
uv run python scripts/generate.py   # regenerate assistableai._client from the spec
uv build                      # build wheel + sdist
```

The generated client (`src/assistableai/_client`) and the bundled spec
(`src/assistableai/spec/openapi.json`) are committed; regenerate them whenever
`spec/openapi.json` changes.
