Package com.sap.ai.sdk.grounding.model
Class BaseDocument
java.lang.Object
com.sap.ai.sdk.grounding.model.BaseDocument
Base class for documents, document requests and responses.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChunksItem(TextOnlyBaseChunkCreate chunksItem) Add one chunks instance to thisBaseDocument.addMetadataItem(VectorDocumentKeyValueListPair metadataItem) Add one metadata instance to thisBaseDocument.chunks(List<TextOnlyBaseChunkCreate> chunks) Set the chunks of thisBaseDocumentinstance and return the same instance.static BaseDocument.Buildercreate()Create a type-safe, fluent-api builder object to construct a newBaseDocumentinstance with all required arguments.booleanGet chunksgetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theBaseDocument.Get metadatainthashCode()metadata(List<VectorDocumentKeyValueListPair> metadata) Set the metadata of thisBaseDocumentinstance and return the same instance.voidsetChunks(List<TextOnlyBaseChunkCreate> chunks) Set the chunks of thisBaseDocumentinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisBaseDocumentinstance.voidsetMetadata(List<VectorDocumentKeyValueListPair> metadata) Set the metadata of thisBaseDocumentinstance.toMap()Get the value of all properties of thisBaseDocumentinstance including unrecognized properties.toString()
-
Constructor Details
-
BaseDocument
protected BaseDocument()Default constructor for BaseDocument.
-
-
Method Details
-
chunks
Set the chunks of thisBaseDocumentinstance and return the same instance.- Parameters:
chunks- The chunks of thisBaseDocument- Returns:
- The same instance of this
BaseDocumentclass
-
addChunksItem
Add one chunks instance to thisBaseDocument.- Parameters:
chunksItem- The chunks that should be added- Returns:
- The same instance of type
BaseDocument
-
getChunks
Get chunks- Returns:
- chunks The chunks of this
BaseDocumentinstance.
-
setChunks
Set the chunks of thisBaseDocumentinstance.- Parameters:
chunks- The chunks of thisBaseDocument
-
metadata
Set the metadata of thisBaseDocumentinstance and return the same instance.- Parameters:
metadata- The metadata of thisBaseDocument- Returns:
- The same instance of this
BaseDocumentclass
-
addMetadataItem
Add one metadata instance to thisBaseDocument.- Parameters:
metadataItem- The metadata that should be added- Returns:
- The same instance of type
BaseDocument
-
getMetadata
Get metadata- Returns:
- metadata The metadata of this
BaseDocumentinstance.
-
setMetadata
Set the metadata of thisBaseDocumentinstance.- Parameters:
metadata- The metadata of thisBaseDocument
-
getCustomFieldNames
Get the names of the unrecognizable properties of theBaseDocument.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisBaseDocumentinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisBaseDocumentinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisBaseDocumentinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a type-safe, fluent-api builder object to construct a newBaseDocumentinstance with all required arguments.
-
toMap()instead.