<?php

namespace App\Providers;

use App\Services\AIPrompt\OpenAPIPrompt;
use App\Services\FileTools\OCR\IImageOCR;
use App\Services\FileTools\Transcription\IAudioTranscriptor;
use App\Services\FileTools\VideoDescriptor\IVideoDescriptor;
use Illuminate\Support\ServiceProvider;

class VideoDescriptorServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     */
    public function register(): void
    {
        // Register the VideoDescriptor service
        $this->app->singleton(IVideoDescriptor::class, function ($app) {
            return new \App\Services\FileTools\VideoDescriptor\LLMFullVideoDescriptor(
                $app->make(IImageOCR::class),
                $app->make(OpenAPIPrompt::class)
            );
        });

        // Register the VideoDescriptor service
        $this->app->singleton(\App\Browser\Jobs\InstagramRepost\ReelDescriptor::class);

        // Audio transcription service
        $this->app->singleton(IAudioTranscriptor::class, function ($app) {
            return new \App\Services\FileTools\Transcription\OpenAIAPIAudioTranscriptor();
        });
    }

    /**
     * Bootstrap services.
     */
    public function boot(): void
    {
        //
    }
}
