<?php

declare(strict_types=1);

namespace Drupal\ffmpeg_media_whisper\Service;

use Drupal\ffmpeg_media_whisper\Plugin\FFmpegProcessor\WhisperProcessor;

/**
 * Default provider for supported Whisper models and output formats.
 *
 * @internal
 */
final class WhisperOptionsProvider implements WhisperOptionsProviderInterface {

  /**
   * {@inheritdoc}
   */
  #[\Override]
  public function getAvailableModels(): array {
    return WhisperProcessor::getAvailableModels();
  }

  /**
   * {@inheritdoc}
   */
  #[\Override]
  public function getAvailableFormats(): array {
    return WhisperProcessor::getAvailableFormats();
  }

  /**
   * {@inheritdoc}
   */
  #[\Override]
  public function isValidModel(string $model): bool {
    return isset($this->getAvailableModels()[$model]);
  }

  /**
   * {@inheritdoc}
   */
  #[\Override]
  public function isValidFormat(string $format): bool {
    return isset($this->getAvailableFormats()[$format]);
  }

}
