Package com.sap.ai.sdk.grounding.model

# Class MergeStrategyReranker

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

All Implemented Interfaces:
  `RetrievalSearchInputPostProcessingInnerStrategy`, `Strategy`

public class MergeStrategyReranker extends Object implements RetrievalSearchInputPostProcessingInnerStrategy, Strategy
The MergeStrategyReranker will call a reranker LLM to merge the given PerFilterSearchResult instances. This strategy adds latency, but yields good results.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `MergeStrategyReranker.ModelEnum`
  The RerankerModel to use.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `MergeStrategyReranker()`
  Default constructor for MergeStrategyReranker.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MergeStrategyReranker`
  `addBoostingItem(MergeStrategyRerankerBoostingInner boostingItem)`
  Add one boosting instance to this `MergeStrategyReranker`.
  `MergeStrategyReranker`
  `boosting(List<MergeStrategyRerankerBoostingInner> boosting)`
  Set the boosting of this `MergeStrategyReranker` instance and return the same instance.
  `static MergeStrategyReranker`
  `create()`
  Create a new `MergeStrategyReranker` instance.
  `boolean`
  `equals(Object o)`
  `List<MergeStrategyRerankerBoostingInner>`
  `getBoosting()`
  Key-value pairs to be included in the ranking process, to boost related chunks according to chunk content and metadata, if includeMetaData is true.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `MergeStrategyReranker`.
  `MergeStrategyReranker.ModelEnum`
  `getModel()`
  The RerankerModel to use.
  `MergeStrategyType`
  `getType()`
  Get type
  `int`
  `hashCode()`
  `MergeStrategyReranker`
  `includeAllMetaData(Boolean includeAllMetaData)`
  Set the includeAllMetaData of this `MergeStrategyReranker` instance and return the same instance.
  `Boolean`
  `isIncludeAllMetaData()`
  If true, document and chunk metadata are sent to the reranker LLM along with the text content of the chunk.
  `MergeStrategyReranker`
  `model(MergeStrategyReranker.ModelEnum model)`
  Set the model of this `MergeStrategyReranker` instance and return the same instance.
  `void`
  `setBoosting(List<MergeStrategyRerankerBoostingInner> boosting)`
  Set the boosting of this `MergeStrategyReranker` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `MergeStrategyReranker` instance.
  `void`
  `setIncludeAllMetaData(Boolean includeAllMetaData)`
  Set the includeAllMetaData of this `MergeStrategyReranker` instance.
  `void`
  `setModel(MergeStrategyReranker.ModelEnum model)`
  Set the model of this `MergeStrategyReranker` instance.
  `void`
  `setType(MergeStrategyType type)`
  Set the type of this `MergeStrategyReranker` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `MergeStrategyReranker` instance including unrecognized properties.
  `String`
  `toString()`
  `MergeStrategyReranker`
  `type(MergeStrategyType type)`
  Set the type of this `MergeStrategyReranker` instance and return the same instance.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### MergeStrategyReranker

    protected MergeStrategyReranker()
    Default constructor for MergeStrategyReranker.

- ## Method Details

  - ### type

    @Nonnull public MergeStrategyReranker type(@Nullable MergeStrategyType type)
    Set the type of this `MergeStrategyReranker` instance and return the same instance.
    Parameters:
      `type` - The type of this `MergeStrategyReranker`
    Returns:
      The same instance of this `MergeStrategyReranker` class

  - ### getType

    @Nonnull public MergeStrategyType getType()
    Get type
    Returns:
      type The type of this `MergeStrategyReranker` instance.

  - ### setType

    public void setType(@Nullable MergeStrategyType type)
    Set the type of this `MergeStrategyReranker` instance.
    Parameters:
      `type` - The type of this `MergeStrategyReranker`

  - ### model

    @Nonnull public MergeStrategyReranker model(@Nullable MergeStrategyReranker.ModelEnum model)
    Set the model of this `MergeStrategyReranker` instance and return the same instance.
    Parameters:
      `model` - The RerankerModel to use.
    Returns:
      The same instance of this `MergeStrategyReranker` class

  - ### getModel

    @Nullable public MergeStrategyReranker.ModelEnum getModel()
    The RerankerModel to use.
    Returns:
      model The model of this `MergeStrategyReranker` instance.

  - ### setModel

    public void setModel(@Nullable MergeStrategyReranker.ModelEnum model)
    Set the model of this `MergeStrategyReranker` instance.
    Parameters:
      `model` - The RerankerModel to use.

  - ### boosting

    @Nonnull public MergeStrategyReranker boosting(@Nullable List<MergeStrategyRerankerBoostingInner> boosting)
    Set the boosting of this `MergeStrategyReranker` instance and return the same instance.
    Parameters:
      `boosting` - Key-value pairs to be included in the ranking process, to boost related chunks according to chunk content and metadata, if includeMetaData is true.
    Returns:
      The same instance of this `MergeStrategyReranker` class

  - ### addBoostingItem

    @Nonnull public MergeStrategyReranker addBoostingItem(@Nonnull MergeStrategyRerankerBoostingInner boostingItem)
    Add one boosting instance to this `MergeStrategyReranker`.
    Parameters:
      `boostingItem` - The boosting that should be added
    Returns:
      The same instance of type `MergeStrategyReranker`

  - ### getBoosting

    @Nullable public List<MergeStrategyRerankerBoostingInner> getBoosting()
    Key-value pairs to be included in the ranking process, to boost related chunks according to chunk content and metadata, if includeMetaData is true.
    Returns:
      boosting The boosting of this `MergeStrategyReranker` instance.

  - ### setBoosting

    public void setBoosting(@Nullable List<MergeStrategyRerankerBoostingInner> boosting)
    Set the boosting of this `MergeStrategyReranker` instance.
    Parameters:
      `boosting` - Key-value pairs to be included in the ranking process, to boost related chunks according to chunk content and metadata, if includeMetaData is true.

  - ### includeAllMetaData

    @Nonnull public MergeStrategyReranker includeAllMetaData(@Nullable Boolean includeAllMetaData)
    Set the includeAllMetaData of this `MergeStrategyReranker` instance and return the same instance.
    Parameters:
      `includeAllMetaData` - If true, document and chunk metadata are sent to the reranker LLM along with the text content of the chunk.
    Returns:
      The same instance of this `MergeStrategyReranker` class

  - ### isIncludeAllMetaData

    @Nullable public Boolean isIncludeAllMetaData()
    If true, document and chunk metadata are sent to the reranker LLM along with the text content of the chunk.
    Returns:
      includeAllMetaData The includeAllMetaData of this `MergeStrategyReranker` instance.

  - ### setIncludeAllMetaData

    public void setIncludeAllMetaData(@Nullable Boolean includeAllMetaData)
    Set the includeAllMetaData of this `MergeStrategyReranker` instance.
    Parameters:
      `includeAllMetaData` - If true, document and chunk metadata are sent to the reranker LLM along with the text content of the chunk.

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `MergeStrategyReranker`.
    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 `MergeStrategyReranker` 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 `MergeStrategyReranker` 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 `MergeStrategyReranker` 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 MergeStrategyReranker create()
    Create a new `MergeStrategyReranker` instance. No arguments are required.