Package org.springframework.ai.openai
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.springframework.ai.openai.AbstractOpenAiOptions
AbstractOpenAiOptions.AbstractBuilder<O extends AbstractOpenAiOptions,B extends AbstractOpenAiOptions.AbstractBuilder<O, B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.openai.models.audio.AudioResponseFormatDefault response format.static final StringDefault transcription model (Whisper 1).Fields inherited from class org.springframework.ai.openai.AbstractOpenAiOptions
DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenAiAudioTranscriptionOptions(@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 Summary
Modifier and TypeMethodDescriptionbuilder()boolean@Nullable com.openai.models.audio.transcriptions.TranscriptionCreateParams.ChunkingStrategyControls how the audio is cut into chunks when streaming or when the model benefits from voice-activity-detection-based chunking.Speaker identifiers (up to 4) matching, positionally, the audio samples ingetKnownSpeakerReferences().Audio samples (as data URLs, e.g.@Nullable StringgetModel()@Nullable Stringcom.openai.models.audio.AudioResponseFormat@Nullable Float@Nullable List<com.openai.models.audio.transcriptions.TranscriptionCreateParams.TimestampGranularity>inthashCode()booleanWhether thediarized_jsonmisclassification workaround is applied.Methods inherited from class org.springframework.ai.openai.AbstractOpenAiOptions
getApiKey, getBaseUrl, getCredential, getCustomHeaders, getDeploymentName, getMaxRetries, getMicrosoftDeploymentName, getMicrosoftFoundryServiceVersion, getOrganizationId, getProxy, getTimeout, isGitHubModels, isMicrosoftFoundry
-
Field Details
-
DEFAULT_TRANSCRIPTION_MODEL
Default transcription model (Whisper 1). -
DEFAULT_RESPONSE_FORMAT
public static final com.openai.models.audio.AudioResponseFormat DEFAULT_RESPONSE_FORMATDefault 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
-
getModel
- Specified by:
getModelin interfaceAudioTranscriptionOptions- Overrides:
getModelin classAbstractOpenAiOptions
-
getResponseFormat
public com.openai.models.audio.AudioResponseFormat getResponseFormat() -
getPrompt
-
getLanguage
-
getTemperature
-
getTimestampGranularities
public @Nullable List<com.openai.models.audio.transcriptions.TranscriptionCreateParams.TimestampGranularity> getTimestampGranularities() -
isDiarizedJsonWorkaroundEnabled
public boolean isDiarizedJsonWorkaroundEnabled()Whether thediarized_jsonmisclassification workaround is applied. SeeDiarizedJsonMisclassificationRecoveryfor background. Defaults totrue. -
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 viaTranscriptionCreateParams.ChunkingStrategy.ofAuto()orTranscriptionCreateParams.ChunkingStrategy.ofVadConfig(com.openai.models.audio.transcriptions.TranscriptionCreateParams.ChunkingStrategy.VadConfig). -
getKnownSpeakerNames
Speaker identifiers (up to 4) matching, positionally, the audio samples ingetKnownSpeakerReferences(). Only used with thegpt-4o-transcribe-diarizemodel. -
getKnownSpeakerReferences
Audio samples (as data URLs, e.g.data:audio/wav;base64,...) containing known speaker references, positionally matchinggetKnownSpeakerNames(). Only used with thegpt-4o-transcribe-diarizemodel. -
equals
-
hashCode
public int hashCode()
-