Package com.sap.ai.sdk.orchestration

# Class Grounding

java.lang.Object
com.sap.ai.sdk.orchestration.Grounding

All Implemented Interfaces:
  `GroundingProvider`

public class Grounding extends Object implements GroundingProvider
Grounding integrates external, contextually relevant, domain-specific, or real-time data into AI processes. This data supplements the natural language processing capabilities of pre-trained models, which are trained on general material.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Grounding()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Grounding`
  `create()`
  Create a new default grounding provider.
  `GroundingModuleConfig`
  `createConfig()`
  Create a grounding configuration.
  `OrchestrationPrompt`
  `createGroundingPrompt(String message)`
  Create a prompt with grounding parameters included in the message.
  `Grounding`
  `documentGroundingService(GroundingModuleConfig.TypeEnum documentGroundingService)`
  `Grounding`
  `filters(GroundingModuleConfigConfigFiltersInner... filters)`
  Set filters for grounding.
  `Grounding`
  `metadataParams(String... metadataParams)`
  Set which metadataParams are used in the grounding response.

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Grounding

    public Grounding()

- ## Method Details

  - ### create

    @Nonnull public static Grounding create()
    Create a new default grounding provider.

    It is by default a document grounding service with a vector data repository.

    Returns:
      The grounding provider.

  - ### filters

    @Nonnull public Grounding filters(@Nonnull GroundingModuleConfigConfigFiltersInner... filters)
    Set filters for grounding.
    Parameters:
      `filters` - List of filters to set.
    Returns:
      The modified grounding configuration.

  - ### metadataParams

    @Nonnull public Grounding metadataParams(@Nonnull String... metadataParams)
    Set which metadataParams are used in the grounding response.
    Parameters:
      `metadataParams` - List of metadataParams to set.
    Returns:
      The modified grounding configuration.
    Since:
      1.13.0

  - ### createGroundingPrompt

    @Nonnull public OrchestrationPrompt createGroundingPrompt(@Nonnull String message)
    Create a prompt with grounding parameters included in the message.

    It uses the inputParams `userMessage` for the user message and `groundingContext` for the grounding context.

    Parameters:
      `message` - The user message.
    Returns:
      The prompt with grounding.

  - ### createConfig

    @Nonnull public GroundingModuleConfig createConfig()
    Description copied from interface: `GroundingProvider`
    Create a grounding configuration.
    Specified by:
      `createConfig` in interface `GroundingProvider`
    Returns:
      the grounding configuration

  - ### documentGroundingService

    @Nonnull @Beta public Grounding documentGroundingService(GroundingModuleConfig.TypeEnum documentGroundingService)
    Returns:
      `this`.