antonnia-conversations


Nameantonnia-conversations JSON
Version 2.0.12 PyPI version JSON
download
home_pageNone
SummaryAntonnia Conversations Python SDK
upload_time2025-07-12 17:30:45
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords antonnia api chat conversations messaging sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Antonnia Conversations Python SDK

[![PyPI version](https://badge.fury.io/py/antonnia-conversations.svg)](https://badge.fury.io/py/antonnia-conversations)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python client library for the Antonnia Conversations API v2. This SDK provides a clean, async-first interface for managing conversation sessions, messages, and agents.

Part of the Antonnia namespace packages - install only what you need:
- `pip install antonnia-conversations` for conversations API
- `pip install antonnia-orchestrator` for orchestrator API  
- `pip install antonnia-auth` for authentication API
- Or install multiple: `pip install antonnia-conversations antonnia-orchestrator`

## Features

- 🚀 **Async/await support** - Built with modern Python async patterns
- 🔒 **Type safety** - Full type hints and Pydantic models
- 🛡️ **Error handling** - Comprehensive exception handling with proper HTTP status codes
- 📝 **Rich content** - Support for text, images, audio, files, and function calls
- 🔄 **Session management** - Create, transfer, and manage conversation sessions
- 💬 **Message handling** - Send, receive, and search messages
- 🤖 **Agent support** - Work with both AI and human agents
- 🔧 **Namespace packages** - Modular installation, use only what you need

## Installation

```bash
pip install antonnia-conversations
```

## Quick Start

```python
import asyncio
from antonnia.conversations import Conversations
from antonnia.conversations.types import MessageContentText

async def main():
    async with Conversations(
        token="your_api_token",
        base_url="https://api.antonnia.com"
    ) as client:
        # Create a new conversation session
        session = await client.sessions.create(
            contact_id="user_12345",
            contact_name="John Doe",
            metadata={"priority": "high", "department": "support"}
        )
        
        # Send a message from the user
        message = await client.sessions.messages.create(
            session_id=session.id,
            content=MessageContentText(type="text", text="Hello, I need help with my account"),
            role="user"
        )
        
        # Trigger an AI agent response
        updated_session = await client.sessions.reply(session_id=session.id)
        
        # Search for messages in the session
        messages = await client.sessions.messages.search(
            session_id=session.id,
            limit=10
        )
        
        print(f"Session {session.id} has {len(messages)} messages")

if __name__ == "__main__":
    asyncio.run(main())
```

## Authentication

The SDK requires an API token for authentication. You can obtain this from your Antonnia dashboard.

```python
from antonnia.conversations import Conversations

# Initialize with your API token
client = Conversations(
    token="your_api_token_here",
    base_url="https://api.antonnia.com"  # or your custom API endpoint
)
```

## Core Concepts

### Sessions

Sessions represent active conversations between contacts and agents. Each session can contain multiple messages and be transferred between agents.

```python
# Create a session
session = await client.sessions.create(
    contact_id="contact_123",
    contact_name="Jane Smith",
    agent_id="agent_456",  # Optional
    status="open",
    metadata={"source": "website", "priority": "normal"}
)

# Get session details
session = await client.sessions.get(session_id="sess_123")

# Update session metadata
session = await client.sessions.update(
    session_id="sess_123",
    metadata={"priority": "urgent", "escalated": True}
)

# Transfer to another agent
session = await client.sessions.transfer(
    session_id="sess_123",
    agent_id="agent_789"
)

# Finish the session
session = await client.sessions.finish(
    session_id="sess_123",
    ending_survey_id="survey_123"  # Optional
)
```

### Messages

Messages are the individual communications within a session. They support various content types and roles.

```python
from antonnia.conversations.types import MessageContentText, MessageContentImage

# Send a text message
text_message = await client.sessions.messages.create(
    session_id="sess_123",
    content=MessageContentText(type="text", text="Hello there!"),
    role="user"
)

# Send an image message
image_message = await client.sessions.messages.create(
    session_id="sess_123",
    content=MessageContentImage(type="image", url="https://example.com/image.jpg"),
    role="user"
)

# Get a specific message
message = await client.sessions.messages.get(
    session_id="sess_123",
    message_id="msg_456"
)

# Search messages
messages = await client.sessions.messages.search(
    session_id="sess_123",
    offset=0,
    limit=50
)
```

### Content Types

The SDK supports various message content types:

#### Text Messages
```python
from antonnia.conversations.types import MessageContentText

content = MessageContentText(
    type="text",
    text="Hello, how can I help you?"
)
```

#### Image Messages
```python
from antonnia.conversations.types import MessageContentImage

content = MessageContentImage(
    type="image",
    url="https://example.com/image.jpg"
)
```

#### Audio Messages
```python
from antonnia.conversations.types import MessageContentAudio

content = MessageContentAudio(
    type="audio",
    url="https://example.com/audio.mp3",
    transcript="This is the audio transcript"  # Optional
)
```

#### File Messages
```python
from antonnia.conversations.types import MessageContentFile

content = MessageContentFile(
    type="file",
    url="https://example.com/document.pdf",
    mime_type="application/pdf",
    name="document.pdf"
)
```

#### Function Calls (AI Agents)
```python
from antonnia.conversations.types import MessageContentFunctionCall, MessageContentFunctionResult

# Function call from AI
function_call = MessageContentFunctionCall(
    type="function_call",
    id="call_123",
    name="get_weather",
    input='{"location": "New York"}'
)

# Function result
function_result = MessageContentFunctionResult(
    type="function_result",
    id="call_123",
    name="get_weather",
    output='{"temperature": 72, "condition": "sunny"}'
)
```

## Error Handling

The SDK provides structured exception handling:

```python
from antonnia.conversations import Conversations
from antonnia.conversations.exceptions import (
    AuthenticationError,
    NotFoundError,
    ValidationError,
    RateLimitError,
    APIError
)

try:
    session = await client.sessions.get("invalid_session_id")
except AuthenticationError:
    print("Invalid API token")
except NotFoundError:
    print("Session not found")
except ValidationError as e:
    print(f"Validation error: {e.message}")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except APIError as e:
    print(f"API error {e.status_code}: {e.message}")
```

## Advanced Usage

### Custom HTTP Client

You can provide your own HTTP client for advanced configuration:

```python
import httpx
from antonnia.conversations import Conversations

# Custom HTTP client with proxy
http_client = httpx.AsyncClient(
    proxies="http://proxy.example.com:8080",
    timeout=30.0
)

async with Conversations(
    token="your_token",
    base_url="https://api.antonnia.com",
    http_client=http_client
) as client:
    # Use client as normal
    session = await client.sessions.create(...)
```

### Session Search and Filtering

```python
# Search sessions by contact
sessions = await client.sessions.search(
    contact_id="contact_123",
    status="open",
    limit=10
)

# Pagination
page_1 = await client.sessions.search(
    contact_id="contact_123",
    offset=0,
    limit=20
)

page_2 = await client.sessions.search(
    contact_id="contact_123",
    offset=20,
    limit=20
)
```

### Webhook Events

The Antonnia API supports webhook events for real-time updates. Configure your webhook endpoint to receive these events:

- `session.created` - New session created
- `session.transferred` - Session transferred between agents  
- `session.finished` - Session completed
- `message.created` - New message in session

## API Reference

### Conversations Client

The main client class for accessing the Antonnia API.

#### `Conversations(token, base_url, timeout, http_client)`

**Parameters:**
- `token` (str): Your API authentication token
- `base_url` (str): API base URL (default: "https://api.antonnia.com")
- `timeout` (float): Request timeout in seconds (default: 60.0)
- `http_client` (httpx.AsyncClient, optional): Custom HTTP client

**Properties:**
- `sessions`: Sessions client for session management

### Sessions Client

Manage conversation sessions.

#### `sessions.create(contact_id, contact_name, agent_id=None, status="open", metadata=None)`
#### `sessions.get(session_id)`
#### `sessions.update(session_id, metadata=None)`
#### `sessions.transfer(session_id, agent_id)`
#### `sessions.finish(session_id, ending_survey_id=None)`
#### `sessions.reply(session_id, debounce_time=0)`
#### `sessions.search(contact_id=None, status=None, offset=None, limit=None)`

### Messages Client

Manage messages within sessions. Accessed via `client.sessions.messages`.

#### `messages.create(session_id, content, role="user", provider_message_id=None, replied_provider_message_id=None)`
#### `messages.get(session_id, message_id)`
#### `messages.update(session_id, message_id, provider_message_id=None, replied_provider_message_id=None)`
#### `messages.search(session_id=None, provider_message_id=None, replied_provider_message_id=None, offset=None, limit=None)`

## Requirements

- Python 3.8+
- httpx >= 0.25.0
- pydantic >= 2.7.0

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Namespace Packages

This SDK is part of the **Antonnia namespace packages** ecosystem. Each service has its own installable package, but they all work together under the `antonnia` namespace.

### Available Packages

- **`antonnia-conversations`** - Conversations API (sessions, messages, agents)
- **`antonnia-orchestrator`** - Orchestrator API (threads, runs, assistants) 
- **`antonnia-auth`** - Authentication API (users, tokens, permissions)
- **`antonnia-contacts`** - Contacts API (contact management)
- **`antonnia-events`** - Events API (webhooks, event streams)
- **`antonnia-functions`** - Functions API (serverless functions)

### Usage Examples

**Install only what you need:**
```bash
# Just conversations
pip install antonnia-conversations

# Just orchestrator  
pip install antonnia-orchestrator

# Multiple services
pip install antonnia-conversations antonnia-orchestrator antonnia-auth
```

**Use together seamlessly:**
```python
# Each package provides its own client and types
from antonnia.conversations import Conversations
from antonnia.conversations.types import Session, MessageContentText
from antonnia.conversations.exceptions import AuthenticationError

from antonnia.orchestrator import Orchestrator  
from antonnia.orchestrator.types import Thread, Run
from antonnia.orchestrator.exceptions import OrchestratorError

from antonnia.auth import Auth
from antonnia.auth.types import User, Token
from antonnia.auth.exceptions import TokenExpiredError

async def integrated_example():
    # Initialize multiple services
    conversations = Conversations(token="conv_token")
    orchestrator = Orchestrator(token="orch_token") 
    auth = Auth(token="auth_token")
    
    # Use them together
    user = await auth.users.get("user_123")
    session = await conversations.sessions.create(
        contact_id=user.id,
        contact_name=user.name
    )
    thread = await orchestrator.threads.create(
        user_id=user.id,
        metadata={"session_id": session.id}
    )
```

### Creating Additional Services

To add a new service (e.g., `antonnia-analytics`):

1. **Create package structure:**
   ```
   antonnia-analytics/
   ├── antonnia/
   │   └── analytics/
   │       ├── __init__.py       # Export main Analytics client
   │       ├── client.py         # Analytics client class
   │       ├── types/
   │       │   ├── __init__.py   # Export all types
   │       │   └── reports.py    # Analytics types
   │       └── exceptions.py     # Analytics exceptions
   ├── pyproject.toml           # Package config
   └── setup.py                 # Alternative setup
   ```

2. **Configure namespace package:**
   ```toml
   # pyproject.toml
   [project]
   name = "antonnia-analytics"
   
   [tool.setuptools.packages.find]
   include = ["antonnia*"]
   
   [tool.setuptools.package-data]
   "antonnia.analytics" = ["py.typed"]
   ```

3. **Use consistent imports:**
   ```python
   # User imports
   from antonnia.analytics import Analytics
   from antonnia.analytics.types import Report, ChartData
   from antonnia.analytics.exceptions import AnalyticsError
   ```

This approach provides:
- **Modular installation** - Install only needed services
- **Consistent API** - All services follow the same patterns  
- **Type safety** - Each service has its own typed interfaces
- **No conflicts** - Services can evolve independently
- **Easy integration** - Services work together seamlessly

## Support

- 📖 [Documentation](https://docs.antonnia.com)
- 💬 [Discord Community](https://discord.gg/antonnia)
- 📧 [Email Support](mailto:support@antonnia.com)
- 🐛 [Issue Tracker](https://github.com/antonnia/antonnia-python/issues) 
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "antonnia-conversations",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "antonnia, api, chat, conversations, messaging, sdk",
    "author": null,
    "author_email": "Antonnia <support@antonnia.com>",
    "download_url": "https://files.pythonhosted.org/packages/63/39/b723dd1500cf8d39505883484770165bfc960a0b322478db3f0c10d53bc6/antonnia_conversations-2.0.12.tar.gz",
    "platform": null,
    "description": "# Antonnia Conversations Python SDK\n\n[![PyPI version](https://badge.fury.io/py/antonnia-conversations.svg)](https://badge.fury.io/py/antonnia-conversations)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Python client library for the Antonnia Conversations API v2. This SDK provides a clean, async-first interface for managing conversation sessions, messages, and agents.\n\nPart of the Antonnia namespace packages - install only what you need:\n- `pip install antonnia-conversations` for conversations API\n- `pip install antonnia-orchestrator` for orchestrator API  \n- `pip install antonnia-auth` for authentication API\n- Or install multiple: `pip install antonnia-conversations antonnia-orchestrator`\n\n## Features\n\n- \ud83d\ude80 **Async/await support** - Built with modern Python async patterns\n- \ud83d\udd12 **Type safety** - Full type hints and Pydantic models\n- \ud83d\udee1\ufe0f **Error handling** - Comprehensive exception handling with proper HTTP status codes\n- \ud83d\udcdd **Rich content** - Support for text, images, audio, files, and function calls\n- \ud83d\udd04 **Session management** - Create, transfer, and manage conversation sessions\n- \ud83d\udcac **Message handling** - Send, receive, and search messages\n- \ud83e\udd16 **Agent support** - Work with both AI and human agents\n- \ud83d\udd27 **Namespace packages** - Modular installation, use only what you need\n\n## Installation\n\n```bash\npip install antonnia-conversations\n```\n\n## Quick Start\n\n```python\nimport asyncio\nfrom antonnia.conversations import Conversations\nfrom antonnia.conversations.types import MessageContentText\n\nasync def main():\n    async with Conversations(\n        token=\"your_api_token\",\n        base_url=\"https://api.antonnia.com\"\n    ) as client:\n        # Create a new conversation session\n        session = await client.sessions.create(\n            contact_id=\"user_12345\",\n            contact_name=\"John Doe\",\n            metadata={\"priority\": \"high\", \"department\": \"support\"}\n        )\n        \n        # Send a message from the user\n        message = await client.sessions.messages.create(\n            session_id=session.id,\n            content=MessageContentText(type=\"text\", text=\"Hello, I need help with my account\"),\n            role=\"user\"\n        )\n        \n        # Trigger an AI agent response\n        updated_session = await client.sessions.reply(session_id=session.id)\n        \n        # Search for messages in the session\n        messages = await client.sessions.messages.search(\n            session_id=session.id,\n            limit=10\n        )\n        \n        print(f\"Session {session.id} has {len(messages)} messages\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Authentication\n\nThe SDK requires an API token for authentication. You can obtain this from your Antonnia dashboard.\n\n```python\nfrom antonnia.conversations import Conversations\n\n# Initialize with your API token\nclient = Conversations(\n    token=\"your_api_token_here\",\n    base_url=\"https://api.antonnia.com\"  # or your custom API endpoint\n)\n```\n\n## Core Concepts\n\n### Sessions\n\nSessions represent active conversations between contacts and agents. Each session can contain multiple messages and be transferred between agents.\n\n```python\n# Create a session\nsession = await client.sessions.create(\n    contact_id=\"contact_123\",\n    contact_name=\"Jane Smith\",\n    agent_id=\"agent_456\",  # Optional\n    status=\"open\",\n    metadata={\"source\": \"website\", \"priority\": \"normal\"}\n)\n\n# Get session details\nsession = await client.sessions.get(session_id=\"sess_123\")\n\n# Update session metadata\nsession = await client.sessions.update(\n    session_id=\"sess_123\",\n    metadata={\"priority\": \"urgent\", \"escalated\": True}\n)\n\n# Transfer to another agent\nsession = await client.sessions.transfer(\n    session_id=\"sess_123\",\n    agent_id=\"agent_789\"\n)\n\n# Finish the session\nsession = await client.sessions.finish(\n    session_id=\"sess_123\",\n    ending_survey_id=\"survey_123\"  # Optional\n)\n```\n\n### Messages\n\nMessages are the individual communications within a session. They support various content types and roles.\n\n```python\nfrom antonnia.conversations.types import MessageContentText, MessageContentImage\n\n# Send a text message\ntext_message = await client.sessions.messages.create(\n    session_id=\"sess_123\",\n    content=MessageContentText(type=\"text\", text=\"Hello there!\"),\n    role=\"user\"\n)\n\n# Send an image message\nimage_message = await client.sessions.messages.create(\n    session_id=\"sess_123\",\n    content=MessageContentImage(type=\"image\", url=\"https://example.com/image.jpg\"),\n    role=\"user\"\n)\n\n# Get a specific message\nmessage = await client.sessions.messages.get(\n    session_id=\"sess_123\",\n    message_id=\"msg_456\"\n)\n\n# Search messages\nmessages = await client.sessions.messages.search(\n    session_id=\"sess_123\",\n    offset=0,\n    limit=50\n)\n```\n\n### Content Types\n\nThe SDK supports various message content types:\n\n#### Text Messages\n```python\nfrom antonnia.conversations.types import MessageContentText\n\ncontent = MessageContentText(\n    type=\"text\",\n    text=\"Hello, how can I help you?\"\n)\n```\n\n#### Image Messages\n```python\nfrom antonnia.conversations.types import MessageContentImage\n\ncontent = MessageContentImage(\n    type=\"image\",\n    url=\"https://example.com/image.jpg\"\n)\n```\n\n#### Audio Messages\n```python\nfrom antonnia.conversations.types import MessageContentAudio\n\ncontent = MessageContentAudio(\n    type=\"audio\",\n    url=\"https://example.com/audio.mp3\",\n    transcript=\"This is the audio transcript\"  # Optional\n)\n```\n\n#### File Messages\n```python\nfrom antonnia.conversations.types import MessageContentFile\n\ncontent = MessageContentFile(\n    type=\"file\",\n    url=\"https://example.com/document.pdf\",\n    mime_type=\"application/pdf\",\n    name=\"document.pdf\"\n)\n```\n\n#### Function Calls (AI Agents)\n```python\nfrom antonnia.conversations.types import MessageContentFunctionCall, MessageContentFunctionResult\n\n# Function call from AI\nfunction_call = MessageContentFunctionCall(\n    type=\"function_call\",\n    id=\"call_123\",\n    name=\"get_weather\",\n    input='{\"location\": \"New York\"}'\n)\n\n# Function result\nfunction_result = MessageContentFunctionResult(\n    type=\"function_result\",\n    id=\"call_123\",\n    name=\"get_weather\",\n    output='{\"temperature\": 72, \"condition\": \"sunny\"}'\n)\n```\n\n## Error Handling\n\nThe SDK provides structured exception handling:\n\n```python\nfrom antonnia.conversations import Conversations\nfrom antonnia.conversations.exceptions import (\n    AuthenticationError,\n    NotFoundError,\n    ValidationError,\n    RateLimitError,\n    APIError\n)\n\ntry:\n    session = await client.sessions.get(\"invalid_session_id\")\nexcept AuthenticationError:\n    print(\"Invalid API token\")\nexcept NotFoundError:\n    print(\"Session not found\")\nexcept ValidationError as e:\n    print(f\"Validation error: {e.message}\")\nexcept RateLimitError as e:\n    print(f\"Rate limited. Retry after {e.retry_after} seconds\")\nexcept APIError as e:\n    print(f\"API error {e.status_code}: {e.message}\")\n```\n\n## Advanced Usage\n\n### Custom HTTP Client\n\nYou can provide your own HTTP client for advanced configuration:\n\n```python\nimport httpx\nfrom antonnia.conversations import Conversations\n\n# Custom HTTP client with proxy\nhttp_client = httpx.AsyncClient(\n    proxies=\"http://proxy.example.com:8080\",\n    timeout=30.0\n)\n\nasync with Conversations(\n    token=\"your_token\",\n    base_url=\"https://api.antonnia.com\",\n    http_client=http_client\n) as client:\n    # Use client as normal\n    session = await client.sessions.create(...)\n```\n\n### Session Search and Filtering\n\n```python\n# Search sessions by contact\nsessions = await client.sessions.search(\n    contact_id=\"contact_123\",\n    status=\"open\",\n    limit=10\n)\n\n# Pagination\npage_1 = await client.sessions.search(\n    contact_id=\"contact_123\",\n    offset=0,\n    limit=20\n)\n\npage_2 = await client.sessions.search(\n    contact_id=\"contact_123\",\n    offset=20,\n    limit=20\n)\n```\n\n### Webhook Events\n\nThe Antonnia API supports webhook events for real-time updates. Configure your webhook endpoint to receive these events:\n\n- `session.created` - New session created\n- `session.transferred` - Session transferred between agents  \n- `session.finished` - Session completed\n- `message.created` - New message in session\n\n## API Reference\n\n### Conversations Client\n\nThe main client class for accessing the Antonnia API.\n\n#### `Conversations(token, base_url, timeout, http_client)`\n\n**Parameters:**\n- `token` (str): Your API authentication token\n- `base_url` (str): API base URL (default: \"https://api.antonnia.com\")\n- `timeout` (float): Request timeout in seconds (default: 60.0)\n- `http_client` (httpx.AsyncClient, optional): Custom HTTP client\n\n**Properties:**\n- `sessions`: Sessions client for session management\n\n### Sessions Client\n\nManage conversation sessions.\n\n#### `sessions.create(contact_id, contact_name, agent_id=None, status=\"open\", metadata=None)`\n#### `sessions.get(session_id)`\n#### `sessions.update(session_id, metadata=None)`\n#### `sessions.transfer(session_id, agent_id)`\n#### `sessions.finish(session_id, ending_survey_id=None)`\n#### `sessions.reply(session_id, debounce_time=0)`\n#### `sessions.search(contact_id=None, status=None, offset=None, limit=None)`\n\n### Messages Client\n\nManage messages within sessions. Accessed via `client.sessions.messages`.\n\n#### `messages.create(session_id, content, role=\"user\", provider_message_id=None, replied_provider_message_id=None)`\n#### `messages.get(session_id, message_id)`\n#### `messages.update(session_id, message_id, provider_message_id=None, replied_provider_message_id=None)`\n#### `messages.search(session_id=None, provider_message_id=None, replied_provider_message_id=None, offset=None, limit=None)`\n\n## Requirements\n\n- Python 3.8+\n- httpx >= 0.25.0\n- pydantic >= 2.7.0\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Namespace Packages\n\nThis SDK is part of the **Antonnia namespace packages** ecosystem. Each service has its own installable package, but they all work together under the `antonnia` namespace.\n\n### Available Packages\n\n- **`antonnia-conversations`** - Conversations API (sessions, messages, agents)\n- **`antonnia-orchestrator`** - Orchestrator API (threads, runs, assistants) \n- **`antonnia-auth`** - Authentication API (users, tokens, permissions)\n- **`antonnia-contacts`** - Contacts API (contact management)\n- **`antonnia-events`** - Events API (webhooks, event streams)\n- **`antonnia-functions`** - Functions API (serverless functions)\n\n### Usage Examples\n\n**Install only what you need:**\n```bash\n# Just conversations\npip install antonnia-conversations\n\n# Just orchestrator  \npip install antonnia-orchestrator\n\n# Multiple services\npip install antonnia-conversations antonnia-orchestrator antonnia-auth\n```\n\n**Use together seamlessly:**\n```python\n# Each package provides its own client and types\nfrom antonnia.conversations import Conversations\nfrom antonnia.conversations.types import Session, MessageContentText\nfrom antonnia.conversations.exceptions import AuthenticationError\n\nfrom antonnia.orchestrator import Orchestrator  \nfrom antonnia.orchestrator.types import Thread, Run\nfrom antonnia.orchestrator.exceptions import OrchestratorError\n\nfrom antonnia.auth import Auth\nfrom antonnia.auth.types import User, Token\nfrom antonnia.auth.exceptions import TokenExpiredError\n\nasync def integrated_example():\n    # Initialize multiple services\n    conversations = Conversations(token=\"conv_token\")\n    orchestrator = Orchestrator(token=\"orch_token\") \n    auth = Auth(token=\"auth_token\")\n    \n    # Use them together\n    user = await auth.users.get(\"user_123\")\n    session = await conversations.sessions.create(\n        contact_id=user.id,\n        contact_name=user.name\n    )\n    thread = await orchestrator.threads.create(\n        user_id=user.id,\n        metadata={\"session_id\": session.id}\n    )\n```\n\n### Creating Additional Services\n\nTo add a new service (e.g., `antonnia-analytics`):\n\n1. **Create package structure:**\n   ```\n   antonnia-analytics/\n   \u251c\u2500\u2500 antonnia/\n   \u2502   \u2514\u2500\u2500 analytics/\n   \u2502       \u251c\u2500\u2500 __init__.py       # Export main Analytics client\n   \u2502       \u251c\u2500\u2500 client.py         # Analytics client class\n   \u2502       \u251c\u2500\u2500 types/\n   \u2502       \u2502   \u251c\u2500\u2500 __init__.py   # Export all types\n   \u2502       \u2502   \u2514\u2500\u2500 reports.py    # Analytics types\n   \u2502       \u2514\u2500\u2500 exceptions.py     # Analytics exceptions\n   \u251c\u2500\u2500 pyproject.toml           # Package config\n   \u2514\u2500\u2500 setup.py                 # Alternative setup\n   ```\n\n2. **Configure namespace package:**\n   ```toml\n   # pyproject.toml\n   [project]\n   name = \"antonnia-analytics\"\n   \n   [tool.setuptools.packages.find]\n   include = [\"antonnia*\"]\n   \n   [tool.setuptools.package-data]\n   \"antonnia.analytics\" = [\"py.typed\"]\n   ```\n\n3. **Use consistent imports:**\n   ```python\n   # User imports\n   from antonnia.analytics import Analytics\n   from antonnia.analytics.types import Report, ChartData\n   from antonnia.analytics.exceptions import AnalyticsError\n   ```\n\nThis approach provides:\n- **Modular installation** - Install only needed services\n- **Consistent API** - All services follow the same patterns  \n- **Type safety** - Each service has its own typed interfaces\n- **No conflicts** - Services can evolve independently\n- **Easy integration** - Services work together seamlessly\n\n## Support\n\n- \ud83d\udcd6 [Documentation](https://docs.antonnia.com)\n- \ud83d\udcac [Discord Community](https://discord.gg/antonnia)\n- \ud83d\udce7 [Email Support](mailto:support@antonnia.com)\n- \ud83d\udc1b [Issue Tracker](https://github.com/antonnia/antonnia-python/issues) ",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Antonnia Conversations Python SDK",
    "version": "2.0.12",
    "project_urls": {
        "Bug Tracker": "https://github.com/antonnia-com-br/antonnia-conversations/issues",
        "Documentation": "https://docs.antonnia.com",
        "Homepage": "https://antonnia.com",
        "Repository": "https://github.com/antonnia-com-br/antonnia-conversations"
    },
    "split_keywords": [
        "antonnia",
        " api",
        " chat",
        " conversations",
        " messaging",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dd81b54805504916397efb175f58812ccd0352939491cc9cc945ae5f2321e88b",
                "md5": "6889b5c70660225bd39af598f526ba62",
                "sha256": "9a49ff1ffe408114bbda3950390b99618d137bda94b744ccd96894cf6baf19f4"
            },
            "downloads": -1,
            "filename": "antonnia_conversations-2.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6889b5c70660225bd39af598f526ba62",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25360,
            "upload_time": "2025-07-12T17:30:43",
            "upload_time_iso_8601": "2025-07-12T17:30:43.930341Z",
            "url": "https://files.pythonhosted.org/packages/dd/81/b54805504916397efb175f58812ccd0352939491cc9cc945ae5f2321e88b/antonnia_conversations-2.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6339b723dd1500cf8d39505883484770165bfc960a0b322478db3f0c10d53bc6",
                "md5": "9453e854d655d068c2bd01d7000b4a75",
                "sha256": "008e9a53b5f48710897d91f4e3fd4e2611971f6385f52a1b9371faa054ca6ffd"
            },
            "downloads": -1,
            "filename": "antonnia_conversations-2.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "9453e854d655d068c2bd01d7000b4a75",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26218,
            "upload_time": "2025-07-12T17:30:45",
            "upload_time_iso_8601": "2025-07-12T17:30:45.496442Z",
            "url": "https://files.pythonhosted.org/packages/63/39/b723dd1500cf8d39505883484770165bfc960a0b322478db3f0c10d53bc6/antonnia_conversations-2.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 17:30:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "antonnia-com-br",
    "github_project": "antonnia-conversations",
    "github_not_found": true,
    "lcname": "antonnia-conversations"
}
        
Elapsed time: 0.42919s