<?php

declare(strict_types=1);

namespace App\Domain\Ai\Contracts;

interface AiProvider
{
    /**
     * @param  array<int, array{role: string, content: string}>  $messages
     * @return array{text: string, tokens_used: int, model: string, finish_reason: string}
     */
    public function chat(array $messages, array $options = []): array;

    /** Stream response — generator that yields string chunks */
    public function chatStream(array $messages, array $options = []): \Generator;

    public function name(): string;

    public function defaultModel(): string;

    public function isConfigured(): bool;
}
