Package com.sap.ai.sdk.grounding.model
Class DocumentResponse
java.lang.Object
com.sap.ai.sdk.grounding.model.DocumentResponse
A response containing information about a newly created, single document.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for DocumentResponse. -
Method Summary
Modifier and TypeMethodDescriptionaddChunksItem(TextOnlyBaseChunk chunksItem) Add one chunks instance to thisDocumentResponse.addMetadataItem(VectorDocumentKeyValueListPair metadataItem) Add one metadata instance to thisDocumentResponse.chunks(List<TextOnlyBaseChunk> chunks) Set the chunks of thisDocumentResponseinstance and return the same instance.static DocumentResponse.Buildercreate()Create a type-safe, fluent-api builder object to construct a newDocumentResponseinstance with all required arguments.booleanGet chunksgetCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theDocumentResponse.getId()Unique identifier of a document.Get metadatainthashCode()Set the id of thisDocumentResponseinstance and return the same instance.metadata(List<VectorDocumentKeyValueListPair> metadata) Set the metadata of thisDocumentResponseinstance and return the same instance.voidsetChunks(List<TextOnlyBaseChunk> chunks) Set the chunks of thisDocumentResponseinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisDocumentResponseinstance.voidSet the id of thisDocumentResponseinstance.voidsetMetadata(List<VectorDocumentKeyValueListPair> metadata) Set the metadata of thisDocumentResponseinstance.toMap()Get the value of all properties of thisDocumentResponseinstance including unrecognized properties.toString()
-
Constructor Details
-
DocumentResponse
protected DocumentResponse()Default constructor for DocumentResponse.
-
-
Method Details
-
chunks
Set the chunks of thisDocumentResponseinstance and return the same instance.- Parameters:
chunks- The chunks of thisDocumentResponse- Returns:
- The same instance of this
DocumentResponseclass
-
addChunksItem
Add one chunks instance to thisDocumentResponse.- Parameters:
chunksItem- The chunks that should be added- Returns:
- The same instance of type
DocumentResponse
-
getChunks
Get chunks- Returns:
- chunks The chunks of this
DocumentResponseinstance.
-
setChunks
Set the chunks of thisDocumentResponseinstance.- Parameters:
chunks- The chunks of thisDocumentResponse
-
metadata
Set the metadata of thisDocumentResponseinstance and return the same instance.- Parameters:
metadata- The metadata of thisDocumentResponse- Returns:
- The same instance of this
DocumentResponseclass
-
addMetadataItem
@Nonnull public DocumentResponse addMetadataItem(@Nonnull VectorDocumentKeyValueListPair metadataItem) Add one metadata instance to thisDocumentResponse.- Parameters:
metadataItem- The metadata that should be added- Returns:
- The same instance of type
DocumentResponse
-
getMetadata
Get metadata- Returns:
- metadata The metadata of this
DocumentResponseinstance.
-
setMetadata
Set the metadata of thisDocumentResponseinstance.- Parameters:
metadata- The metadata of thisDocumentResponse
-
id
Set the id of thisDocumentResponseinstance and return the same instance.- Parameters:
id- Unique identifier of a document.- Returns:
- The same instance of this
DocumentResponseclass
-
getId
Unique identifier of a document.- Returns:
- id The id of this
DocumentResponseinstance.
-
setId
Set the id of thisDocumentResponseinstance.- Parameters:
id- Unique identifier of a document.
-
getCustomFieldNames
Get the names of the unrecognizable properties of theDocumentResponse.- 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 thisDocumentResponseinstance.- 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 thisDocumentResponseinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisDocumentResponseinstance. 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 newDocumentResponseinstance with all required arguments.
-
toMap()instead.