# AiGateway

Ponto único de entrada para operações de IA no ImóvelZapAi (Sprint 006).

**Nenhum módulo deve chamar provedores de IA diretamente** — use `AiGateway::complete()`.

## Uso

```php
use ImovelZapAi\AiGateway\Application\Data\AiCompletionRequest;
use ImovelZapAi\AiGateway\Application\Data\AiMessageData;
use ImovelZapAi\AiGateway\Application\Services\AiGateway;
use ImovelZapAi\AiGateway\Domain\Enums\AiTaskType;

$response = $gateway->complete(new AiCompletionRequest(
    tenantId: $tenantId,
    taskType: AiTaskType::ConversationSummary,
    messages: [
        new AiMessageData('user', 'Resuma esta conversa...'),
    ],
));
```

## Configuração

`backend/config/ai_gateway.php` · variáveis em `.env.example`.

## Referências

- [`docs/architecture/AI_GATEWAY.md`](../../docs/architecture/AI_GATEWAY.md)
- [`docs/decisions/strategic/ADR-032_AI_Gateway.md`](../../docs/decisions/strategic/ADR-032_AI_Gateway.md)
