/**
 * TranscribeDto
 *
 * DTO for speech-to-text transcription requests.
 * Supports optional language and model overrides.
 *
 * The audio file itself is handled by Multer (FileInterceptor)
 * and validated by AudioValidationPipe.
 *
 * Issue #398
 */

import { IsString, IsOptional, IsNumber, Min, Max, MaxLength } from "class-validator";
import { Type } from "class-transformer";

export class TranscribeDto {
  /**
   * Language code for transcription (e.g., "en", "fr", "de").
   * If omitted, the default from speech config is used.
   */
  @IsOptional()
  @IsString({ message: "language must be a string" })
  @MaxLength(10, { message: "language must not exceed 10 characters" })
  language?: string;

  /**
   * Model override for transcription.
   * If omitted, the default model from speech config is used.
   */
  @IsOptional()
  @IsString({ message: "model must be a string" })
  @MaxLength(200, { message: "model must not exceed 200 characters" })
  model?: string;

  /**
   * Optional prompt to guide the transcription model.
   * Useful for providing context or expected vocabulary.
   */
  @IsOptional()
  @IsString({ message: "prompt must be a string" })
  @MaxLength(1000, { message: "prompt must not exceed 1000 characters" })
  prompt?: string;

  /**
   * Temperature for transcription (0.0 to 1.0).
   * Lower values produce more deterministic results.
   */
  @IsOptional()
  @Type(() => Number)
  @IsNumber({}, { message: "temperature must be a number" })
  @Min(0, { message: "temperature must be at least 0" })
  @Max(1, { message: "temperature must not exceed 1" })
  temperature?: number;
}
