Class OpenAiAudioTranscriptionOptions

java.lang.Object
org.springframework.ai.openai.AbstractOpenAiOptions
org.springframework.ai.openai.OpenAiAudioTranscriptionOptions
All Implemented Interfaces:
AudioTranscriptionOptions, ModelOptions

public class OpenAiAudioTranscriptionOptions extends AbstractOpenAiOptions implements AudioTranscriptionOptions
OpenAI SDK Audio Transcription Options.
Author:
Michael Lavelle, Christian Tzolov, Piotr Olaszewski, Ilayaperumal Gopinathan
  • Field Details

    • DEFAULT_TRANSCRIPTION_MODEL

      public static final String DEFAULT_TRANSCRIPTION_MODEL
      Default transcription model (Whisper 1).
    • DEFAULT_RESPONSE_FORMAT

      public static final com.openai.models.audio.AudioResponseFormat DEFAULT_RESPONSE_FORMAT
      Default response format.
  • Constructor Details

    • OpenAiAudioTranscriptionOptions

      protected OpenAiAudioTranscriptionOptions(@Nullable String baseUrl, @Nullable String apiKey, @Nullable com.openai.credential.Credential credential, @Nullable String model, @Nullable String microsoftDeploymentName, @Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion, @Nullable String organizationId, @Nullable Boolean isMicrosoftFoundry, @Nullable Boolean isGitHubModels, @Nullable Duration timeout, @Nullable Integer maxRetries, @Nullable Proxy proxy, @Nullable Map<String,String> customHeaders, @Nullable com.openai.models.audio.AudioResponseFormat responseFormat, @Nullable String prompt, @Nullable String language, @Nullable Float temperature, @Nullable List<com.openai.models.audio.transcriptions.TranscriptionCreateParams.TimestampGranularity> timestampGranularities, @Nullable Boolean diarizedJsonWorkaroundEnabled, @Nullable com.openai.models.audio.transcriptions.TranscriptionCreateParams.ChunkingStrategy chunkingStrategy, @Nullable List<String> knownSpeakerNames, @Nullable List<String> knownSpeakerReferences)
  • Method Details

    • builder

      public static OpenAiAudioTranscriptionOptions.Builder builder()
    • getModel

      public String getModel()
      Specified by:
      getModel in interface AudioTranscriptionOptions
      Overrides:
      getModel in class AbstractOpenAiOptions
    • getResponseFormat

      public com.openai.models.audio.AudioResponseFormat getResponseFormat()
    • getPrompt

      public @Nullable String getPrompt()
    • getLanguage

      public @Nullable String getLanguage()
    • getTemperature

      public @Nullable Float getTemperature()
    • getTimestampGranularities

      public @Nullable List<com.openai.models.audio.transcriptions.TranscriptionCreateParams.TimestampGranularity> getTimestampGranularities()
    • isDiarizedJsonWorkaroundEnabled

      public boolean isDiarizedJsonWorkaroundEnabled()
      Whether the diarized_json misclassification workaround is applied. See DiarizedJsonMisclassificationRecovery for background. Defaults to true.
    • getChunkingStrategy

      public @Nullable com.openai.models.audio.transcriptions.TranscriptionCreateParams.ChunkingStrategy getChunkingStrategy()
      Controls how the audio is cut into chunks when streaming or when the model benefits from voice-activity-detection-based chunking. Build one via TranscriptionCreateParams.ChunkingStrategy.ofAuto() or TranscriptionCreateParams.ChunkingStrategy.ofVadConfig(com.openai.models.audio.transcriptions.TranscriptionCreateParams.ChunkingStrategy.VadConfig).
    • getKnownSpeakerNames

      public @Nullable List<String> getKnownSpeakerNames()
      Speaker identifiers (up to 4) matching, positionally, the audio samples in getKnownSpeakerReferences(). Only used with the gpt-4o-transcribe-diarize model.
    • getKnownSpeakerReferences

      public @Nullable List<String> getKnownSpeakerReferences()
      Audio samples (as data URLs, e.g. data:audio/wav;base64,...) containing known speaker references, positionally matching getKnownSpeakerNames(). Only used with the gpt-4o-transcribe-diarize model.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object