Metadata-Version: 2.4
Name: chatatp-studio
Version: 0.1.0
Summary: Official Python SDK for ChatATP Studio Developer API
Author-email: Samuel Obinna Chimdi <sammyfirst6@gmail.com>
License: MIT
Project-URL: Homepage, https://studio.chat-atp.com
Project-URL: Documentation, https://studio.chat-atp.com/docs
Project-URL: Source, https://github.com/sam-14uel/chatatp_studio_python
Project-URL: Issues, https://github.com/sam-14uel/chatatp_studio_python/issues
Keywords: chatatp,chatatp-studio,agent-sdk,ai-agents,llm-agents,chatbot-sdk,api-client,developer-tools,async-client,python-sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-httpx>=0.30; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# ChatATP Studio SDK

Python SDK for building and interacting with agents created in ChatATP Studio.

- Async-first API
- Conversation lifecycle management
- Streaming support
- Fully typed

![PyPI](https://img.shields.io/pypi/v/chatatp-studio)
![Python](https://img.shields.io/pypi/pyversions/chatatp-studio)

# chatatp-studio

Official Python SDK for the [ChatATP Studio](https://studio.chat-atp.com) Developer API.

## Requirements

- Python 3.10+

## Installation

```bash
pip install chatatp-studio
```

## Quick start

```python
import asyncio
from chatatp_studio import ChatATPClient

async def main():
    client = ChatATPClient(api_key="chatatp_sk_...")

    # Send a message — conversation lifecycle handled automatically
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Do you ship to Lagos?",
    )

    print(result.agent_message.content)
    # → "Yes, shipping is available."

    await client.aclose()

asyncio.run(main())
```

## Context manager

```python
async with ChatATPClient(api_key="chatatp_sk_...") as client:
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Hello!",
    )
```

## Streaming

```python
async for event in await client.chat_stream(
    agent_id=7,
    external_user_id="user_12345",
    message="Give me a summary of your return policy.",
):
    if event.type == "agent.response.completed":
        print(event.data)
```

## Resources

```python
# Agents
page  = await client.agents.list()
agent = await client.agents.retrieve(7)

# Conversations
conv = await client.conversations.create(7, "user_12345")
page = await client.conversations.list(agent_id=7)
await client.conversations.delete(conv.id)

# Messages
history = await client.messages.list(conv.id)
reply   = await client.messages.send(conv.id, "Hello")

# Usage
usage = await client.usage.retrieve()
```

## Error handling

```python
from chatatp_studio import NotFoundError, RateLimitError

try:
    await client.agents.retrieve(999)
except NotFoundError:
    print("Not found")
except RateLimitError:
    print("Rate limited")
```

## License

MIT
