Metadata-Version: 2.4
Name: autodial
Version: 0.3.0
Summary: A self-hosted automated outbound dialer phone bot
Author: Autodial Maintainers
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: python-dotenv
Requires-Dist: twilio
Requires-Dist: faster-whisper
Requires-Dist: aiohttp
Requires-Dist: numpy
Requires-Dist: pydantic
Requires-Dist: requests

# Autodial PhoneBot

A self-hosted automated outbound dialer phone bot capable of using speech recognition and LLM to navigate IVRs and DTMFs, understand calls intelligently, process multiple calls concurrently, and broadcast messages.

## Key Advanced Capabilities
- **Python Client Engine**: Includes a native `AutodialClient` for programmatic orchestration.
- **Webhook Callbacks**: Automatic POST notification to `callback_url` upon call completion with full session transcript.
- **Dynamic Context Injection**: Override bot personality, goals, and keyword focus per-call.
- **Broadcast Execution**: Automated message delivery with instant terminal disconnect.

## Installation
```bash
pip install autodial
```

## Programmatic Usage Example (Python Client)

The library now includes a high-level client for easy integration into your own workflows.

```python
from autodial import AutodialClient

# Initialize client pointing to your local or hosted Autodial server
client = AutodialClient("http://localhost:8000")

# 1. Trigger an interactive call with custom instructions
client.dial(
    target_number="+1234567890",
    context="Outbound appointment confirmation",
    goals="Confirm availability for Friday at 3 PM",
    keywords="Appointment, Friday, Confirmed",
    callback_url="https://your-webhook.com/api/v1/call-log"
)

# 2. Trigger a mass broadcast message
client.broadcast(
    numbers=["+123...", "+145..."],
    message="This is an automated system alert. Please check your dashboard.",
    callback_url="https://your-webhook.com/api/v1/broadcast-log"
)
```

## API Endpoint Reference

### `POST /dial`
Trigger a single interactive AI session.
- **Body**:
    - `to_number` (str, Required)
    - `context` (str): Optional background information for the bot.
    - `goals` (str): Specific results sought from the call.
    - `keywords` (str): Key phrases for the AI to prioritize.
    - `callback_url` (str): Endpoint to notify after call ends.

### `POST /broadcast`
Deliver a static message to many recipients.
- **Body**:
    - `numbers` (List[str], Required)
    - `message` (str): If provided, the call will play this message and hang up immediately.
    - `context`/`goals`/`keywords`: Applied if `message` is omitted.
    - `callback_url` (str): Endpoint for final transcript/status.

## Server Commands
```bash
# Start the server
autodial
```
