Class FileChunkingStrategy
-
- All Implemented Interfaces:
public final class FileChunkingStrategyThe strategy used to chunk the file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceFileChunkingStrategy.VisitorAn interface that defines how to map each variant of FileChunkingStrategy to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<StaticFileChunkingStrategyObject>static_()final Optional<OtherFileChunkingStrategyObject>other()This is returned when the chunking strategy is unknown. final BooleanisStatic()final BooleanisOther()final StaticFileChunkingStrategyObjectasStatic()final OtherFileChunkingStrategyObjectasOther()This is returned when the chunking strategy is unknown. final Optional<JsonValue>_json()final <T extends Any> Taccept(FileChunkingStrategy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final FileChunkingStrategyvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static FileChunkingStrategyofStatic(StaticFileChunkingStrategyObject static_)final static FileChunkingStrategyofOther(OtherFileChunkingStrategyObject other)This is returned when the chunking strategy is unknown. -
-
Method Detail
-
static_
final Optional<StaticFileChunkingStrategyObject> static_()
-
other
final Optional<OtherFileChunkingStrategyObject> other()
This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the
chunking_strategyconcept was introduced in the API.
-
asStatic
final StaticFileChunkingStrategyObject asStatic()
-
asOther
final OtherFileChunkingStrategyObject asOther()
This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the
chunking_strategyconcept was introduced in the API.
-
accept
final <T extends Any> T accept(FileChunkingStrategy.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 = fileChunkingStrategy.accept(new FileChunkingStrategy.Visitor<Optional<String>>() { @Override public Optional<String> visitStatic(StaticFileChunkingStrategyObject static_) { return Optional.of(static_.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final FileChunkingStrategy 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.
-
ofStatic
final static FileChunkingStrategy ofStatic(StaticFileChunkingStrategyObject static_)
-
ofOther
final static FileChunkingStrategy ofOther(OtherFileChunkingStrategyObject other)
This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the
chunking_strategyconcept was introduced in the API.
-
-
-
-