Metadata-Version: 2.4
Name: analogaisdk
Version: 0.4.0
Summary: Minimal Python SDK for AnalogAI completion endpoints
Author: AnalogAI
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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: Programming Language :: Python :: 3.14
Requires-Dist: python-dotenv (>=1.0.1)
Requires-Dist: requests (>=2.31.0)
Description-Content-Type: text/markdown

# AnalogAI SDK (minimal)

Tiny Python client for the Deepthink OpenAI-compatible chat server
(`analogai.deepthink.chat`). It calls `POST {CHAT_BASE_URL}/v1/chat/completions`
— a stateful endpoint: memory tenancy is keyed by `user_id` + `agent_id`
(both created server-side on first use), Deepthink memory is retrieved per
turn, and messages are ingested in the background.

## Install

```bash
pip install analogaisdk
```

## Setup

Set environment variables in `.env`:
- `CHAT_BASE_URL` (default `https://cloud.analogai.net:8010`; set to `http://localhost:8010` for a local server)
- `ANALOGAI_AGENT_ID` / `ANALOGAI_USER_ID` (memory tenant; auto-created)
- `ANALOGAI_API_KEY` (optional, if your server requires auth)
- `ANALOGAI_MODEL` (optional; server default is used when omitted)

## Usage

```python
from analogaisdk import AnalogAIClient

client = AnalogAIClient(agent_id="my-agent", user_id="my-user")

# Non-streaming (default).
print(client.generate_completion("are humans mortal?"))

# Streaming.
for chunk in client.generate_streaming_completion("are humans mortal?"):
    print(chunk, end="", flush=True)
```

### Working memory

Working memory (a string or list of strings) is appended to the LLM system
prompt alongside the Deepthink memory:

```python
client.generate_completion(
    "is Socrates mortal?",
    working_memory=["Socrates is a human"],
)
```

### Explicit messages and model

```python
client.generate_completion(
    messages=[
        {"role": "user", "content": "Say hello"},
    ],
    model="azure:gpt-4o-mini",  # optional, provider-prefixed
    temperature=0.2,
)
```

