Class RetrievalChunk

java.lang.Object
com.sap.ai.sdk.grounding.model.RetrievalChunk

public class RetrievalChunk extends Object
RetrievalChunk
  • Constructor Details

    • RetrievalChunk

      protected RetrievalChunk()
      Default constructor for RetrievalChunk.
  • Method Details

    • id

      @Nonnull public RetrievalChunk id(@Nonnull String id)
      Set the id of this RetrievalChunk instance and return the same instance.
      Parameters:
      id - The id of this RetrievalChunk
      Returns:
      The same instance of this RetrievalChunk class
    • getId

      @Nonnull public String getId()
      Get id
      Returns:
      id The id of this RetrievalChunk instance.
    • setId

      public void setId(@Nonnull String id)
      Set the id of this RetrievalChunk instance.
      Parameters:
      id - The id of this RetrievalChunk
    • content

      @Nonnull public RetrievalChunk content(@Nonnull String content)
      Set the content of this RetrievalChunk instance and return the same instance.
      Parameters:
      content - The content of this RetrievalChunk
      Returns:
      The same instance of this RetrievalChunk class
    • getContent

      @Nonnull public String getContent()
      Get content
      Returns:
      content The content of this RetrievalChunk instance.
    • setContent

      public void setContent(@Nonnull String content)
      Set the content of this RetrievalChunk instance.
      Parameters:
      content - The content of this RetrievalChunk
    • metadata

      @Nonnull public RetrievalChunk metadata(@Nullable List<RetrievalKeyValueListPair> metadata)
      Set the metadata of this RetrievalChunk instance and return the same instance.
      Parameters:
      metadata - The metadata of this RetrievalChunk
      Returns:
      The same instance of this RetrievalChunk class
    • addMetadataItem

      @Nonnull public RetrievalChunk addMetadataItem(@Nonnull RetrievalKeyValueListPair metadataItem)
      Add one metadata instance to this RetrievalChunk.
      Parameters:
      metadataItem - The metadata that should be added
      Returns:
      The same instance of type RetrievalChunk
    • getMetadata

      @Nonnull public List<RetrievalKeyValueListPair> getMetadata()
      Get metadata
      Returns:
      metadata The metadata of this RetrievalChunk instance.
    • setMetadata

      public void setMetadata(@Nullable List<RetrievalKeyValueListPair> metadata)
      Set the metadata of this RetrievalChunk instance.
      Parameters:
      metadata - The metadata of this RetrievalChunk
    • searchScores

      @Nonnull public RetrievalChunk searchScores(@Nullable SearchScores searchScores)
      Set the searchScores of this RetrievalChunk instance and return the same instance.
      Parameters:
      searchScores - The searchScores of this RetrievalChunk
      Returns:
      The same instance of this RetrievalChunk class
    • getSearchScores

      @Nonnull public SearchScores getSearchScores()
      Get searchScores
      Returns:
      searchScores The searchScores of this RetrievalChunk instance.
    • setSearchScores

      public void setSearchScores(@Nullable SearchScores searchScores)
      Set the searchScores of this RetrievalChunk instance.
      Parameters:
      searchScores - The searchScores of this RetrievalChunk
    • postProcessingScore

      @Nonnull public RetrievalChunk postProcessingScore(@Nullable Score postProcessingScore)
      Set the postProcessingScore of this RetrievalChunk instance and return the same instance.
      Parameters:
      postProcessingScore - The postProcessingScore of this RetrievalChunk
      Returns:
      The same instance of this RetrievalChunk class
    • getPostProcessingScore

      @Nonnull public Score getPostProcessingScore()
      Get postProcessingScore
      Returns:
      postProcessingScore The postProcessingScore of this RetrievalChunk instance.
    • setPostProcessingScore

      public void setPostProcessingScore(@Nullable Score postProcessingScore)
      Set the postProcessingScore of this RetrievalChunk instance.
      Parameters:
      postProcessingScore - The postProcessingScore of this RetrievalChunk
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the RetrievalChunk.
      Returns:
      The set of properties names
    • getCustomField

      @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
      Deprecated.
      Use toMap() instead.
      Get the value of an unrecognizable property of this RetrievalChunk instance.
      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

      @Nonnull public Map<String,Object> toMap()
      Get the value of all properties of this RetrievalChunk instance including unrecognized properties.
      Returns:
      The map of all properties
    • setCustomField

      public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
      Set an unrecognizable property of this RetrievalChunk instance. 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 property
      customFieldValue - The value of the property
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • create

      public static RetrievalChunk.Builder create()
      Create a type-safe, fluent-api builder object to construct a new RetrievalChunk instance with all required arguments.