Package com.sap.ai.sdk.orchestration
Class OrchestrationModuleConfig
java.lang.Object
com.sap.ai.sdk.orchestration.OrchestrationModuleConfig
Represents the configuration for the orchestration service. Allows for configuring the different
modules of the orchestration service via a fluent API.
The orchestration pipeline combines different modules into a single execution flow where the output of one module serves as input for the next. The pipeline consists of the following modules:
- LLM Config (Mandatory)
- Templating (Optional)
- Data Masking (Optional)
- Input Content Filtering (Optional)
- Output Content Filtering (Optional)
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new OrchestrationModuleConfig with only the AI Model as parameter. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of this OrchestrationModuleConfig.booleanA content filter to filter the prompt.A grounding configuration to provide additional context to the AI model.Configuration for translating input content before processing.The configured language model settings.A masking configuration to pseudonymous or anonymize sensitive data in the input.Configuration for translating output content after processing.inthashCode()toString()withFilteringConfig(FilteringModuleConfig filteringConfig) A content filter to filter the prompt.withGrounding(GroundingProvider groundingProvider) Creates a new configuration with the given grounding configuration.withGroundingConfig(GroundingModuleConfig groundingConfig) A grounding configuration to provide additional context to the AI model.withInputFiltering(ContentFilter contentFilter, ContentFilter... contentFilters) Adds input content filters to the orchestration configuration.withInputTranslationConfig(SAPDocumentTranslationInput inputTranslationConfig) Configuration for translating input content before processing.withInputTranslationConfig(TranslationConfig.Input translationConfig) Configure input translation using a high-level TranslationConfig.withLlmConfig(LLMModelDetails llmConfig) The configured language model settings.withLlmConfig(OrchestrationAiModel aiModel) Creates a new configuration with the given LLM configuration.withMaskingConfig(MaskingProvider maskingProvider, MaskingProvider... maskingProviders) Creates a new configuration with the given Data Masking configuration.withMaskingConfig(MaskingModuleConfig maskingConfig) A masking configuration to pseudonymous or anonymize sensitive data in the input.withOutputFiltering(ContentFilter contentFilter, ContentFilter... contentFilters) Adds output content filters to the orchestration configuration.withOutputTranslationConfig(SAPDocumentTranslationOutput outputTranslationConfig) Configuration for translating output content after processing.withOutputTranslationConfig(TranslationConfig.Output translationConfig) Configure output translation using a high-level TranslationConfig.Creates a new configuration with the given stream configuration.
-
Constructor Details
-
OrchestrationModuleConfig
Creates a new OrchestrationModuleConfig with only the AI Model as parameter.- Parameters:
aiModel- name of the AI Model
-
-
Method Details
-
withLlmConfig
Creates a new configuration with the given LLM configuration.- Parameters:
aiModel- the LLM configuration to use.- Returns:
- a new configuration with the given LLM configuration.
-
withStreamConfig
@Nonnull public OrchestrationModuleConfig withStreamConfig(@Nonnull OrchestrationStreamConfig config) Creates a new configuration with the given stream configuration.- Parameters:
config- the stream configuration to use.- Returns:
- a new configuration with the given stream configuration.
- Since:
- 1.12.0
-
withMaskingConfig
@Nonnull public OrchestrationModuleConfig withMaskingConfig(@Nonnull MaskingProvider maskingProvider, @Nonnull MaskingProvider... maskingProviders) Creates a new configuration with the given Data Masking configuration.- Parameters:
maskingProvider- the Data Masking configuration to use.maskingProviders- additional Data Masking configurations to use.- Returns:
- a new configuration with the given Data Masking configuration.
-
withInputFiltering
@Nonnull public OrchestrationModuleConfig withInputFiltering(@Nonnull ContentFilter contentFilter, @Nonnull ContentFilter... contentFilters) Adds input content filters to the orchestration configuration.Preferred over
withFilteringConfig(FilteringModuleConfig)for adding input filters.- Parameters:
contentFilter- a filter to apply to the input.contentFilters- zero or more additional content filters to apply to the input.- Returns:
- a new
OrchestrationModuleConfiginstance with the specified input filters added.
-
withOutputFiltering
@Nonnull public OrchestrationModuleConfig withOutputFiltering(@Nonnull ContentFilter contentFilter, @Nonnull ContentFilter... contentFilters) Adds output content filters to the orchestration configuration.Preferred over
withFilteringConfig(FilteringModuleConfig)for adding output filters.- Parameters:
contentFilter- a filter to apply to the input.contentFilters- zero or more additional content filters to apply to the input.- Returns:
- a new
OrchestrationModuleConfiginstance with the specified output filters added.
-
withGrounding
@Nonnull public OrchestrationModuleConfig withGrounding(@Nonnull GroundingProvider groundingProvider) Creates a new configuration with the given grounding configuration.- Parameters:
groundingProvider- the grounding configuration to use.- Returns:
- a new configuration with the given grounding configuration.
-
withInputTranslationConfig
@Nonnull public OrchestrationModuleConfig withInputTranslationConfig(@Nonnull TranslationConfig.Input translationConfig) Configure input translation using a high-level TranslationConfig.- Parameters:
translationConfig- the translation configuration.- Returns:
- a new OrchestrationModuleConfig with input translation configured.
-
withOutputTranslationConfig
@Nonnull public OrchestrationModuleConfig withOutputTranslationConfig(@Nonnull TranslationConfig.Output translationConfig) Configure output translation using a high-level TranslationConfig.- Parameters:
translationConfig- the translation configuration.- Returns:
- a new OrchestrationModuleConfig with output translation configured.
-
copy
Creates a copy of this OrchestrationModuleConfig.- Returns:
- a copy of this OrchestrationModuleConfig.
-
getLlmConfig
The configured language model settings. This configuration is required when executing requests. -
getMaskingConfig
A masking configuration to pseudonymous or anonymize sensitive data in the input. -
getFilteringConfig
A content filter to filter the prompt. -
getGroundingConfig
A grounding configuration to provide additional context to the AI model.- Since:
- 1.1.0
-
getInputTranslationConfig
Configuration for translating input content before processing.- Since:
- 1.8.0
-
getOutputTranslationConfig
Configuration for translating output content after processing.- Since:
- 1.8.0
-
equals
-
hashCode
public int hashCode() -
toString
-
withLlmConfig
The configured language model settings. This configuration is required when executing requests.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMaskingConfig
A masking configuration to pseudonymous or anonymize sensitive data in the input.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withFilteringConfig
public OrchestrationModuleConfig withFilteringConfig(@Nullable FilteringModuleConfig filteringConfig) A content filter to filter the prompt.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withGroundingConfig
public OrchestrationModuleConfig withGroundingConfig(@Nullable GroundingModuleConfig groundingConfig) A grounding configuration to provide additional context to the AI model.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - Since:
- 1.1.0
-
withInputTranslationConfig
public OrchestrationModuleConfig withInputTranslationConfig(@Nullable SAPDocumentTranslationInput inputTranslationConfig) Configuration for translating input content before processing.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - Since:
- 1.8.0
-
withOutputTranslationConfig
public OrchestrationModuleConfig withOutputTranslationConfig(@Nullable SAPDocumentTranslationOutput outputTranslationConfig) Configuration for translating output content after processing.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - Since:
- 1.8.0
-