Class TranscriptionCreateParams.ChunkingStrategy
-
- All Implemented Interfaces:
public final class TranscriptionCreateParams.ChunkingStrategyControls how the audio is cut into chunks. When set to
"auto", the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries.server_vadobject can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when usinggpt-4o-transcribe-diarizefor inputs longer than 30 seconds.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTranscriptionCreateParams.ChunkingStrategy.VisitorAn interface that defines how to map each variant of ChunkingStrategy to a value of type T.
public final classTranscriptionCreateParams.ChunkingStrategy.VadConfig
-
Method Summary
Modifier and Type Method Description final Optional<JsonValue>auto()Automatically set chunking parameters based on the audio. final Optional<TranscriptionCreateParams.ChunkingStrategy.VadConfig>vadConfig()final BooleanisAuto()final BooleanisVadConfig()final JsonValueasAuto()Automatically set chunking parameters based on the audio. final TranscriptionCreateParams.ChunkingStrategy.VadConfigasVadConfig()final Optional<JsonValue>_json()final <T extends Any> Taccept(TranscriptionCreateParams.ChunkingStrategy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final TranscriptionCreateParams.ChunkingStrategyvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static TranscriptionCreateParams.ChunkingStrategyofAuto()Automatically set chunking parameters based on the audio. final static TranscriptionCreateParams.ChunkingStrategyofVadConfig(TranscriptionCreateParams.ChunkingStrategy.VadConfig vadConfig)-
-
Method Detail
-
auto
final Optional<JsonValue> auto()
Automatically set chunking parameters based on the audio. Must be set to
"auto".
-
vadConfig
final Optional<TranscriptionCreateParams.ChunkingStrategy.VadConfig> vadConfig()
-
isVadConfig
final Boolean isVadConfig()
-
asAuto
final JsonValue asAuto()
Automatically set chunking parameters based on the audio. Must be set to
"auto".
-
asVadConfig
final TranscriptionCreateParams.ChunkingStrategy.VadConfig asVadConfig()
-
accept
final <T extends Any> T accept(TranscriptionCreateParams.ChunkingStrategy.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = chunkingStrategy.accept(new ChunkingStrategy.Visitor<Optional<String>>() { @Override public Optional<String> visitAuto(JsonValue auto) { return Optional.of(auto.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final TranscriptionCreateParams.ChunkingStrategy validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofAuto
final static TranscriptionCreateParams.ChunkingStrategy ofAuto()
Automatically set chunking parameters based on the audio. Must be set to
"auto".
-
ofVadConfig
final static TranscriptionCreateParams.ChunkingStrategy ofVadConfig(TranscriptionCreateParams.ChunkingStrategy.VadConfig vadConfig)
-
-
-
-