Package com.sap.ai.sdk.orchestration

# Class OrchestrationTemplate

java.lang.Object
com.sap.ai.sdk.orchestration.TemplateConfig
com.sap.ai.sdk.orchestration.OrchestrationTemplate

public final class OrchestrationTemplate extends TemplateConfig
A template to use in `OrchestrationModuleConfig`.

Since:
  1.4.0

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.sap.ai.sdk.orchestration.TemplateConfig

  `TemplateConfig.ReferenceBuilder, TemplateConfig.ReferenceBuilder1, TemplateConfig.ReferenceBuilder2`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `canEqual(Object other)`
  `boolean`
  `equals(Object o)`
  `OrchestrationTemplate`
  `fromYaml(String inputYaml)`
  Create a `Template` object from a YAML provided as String.
  `Map<String,String>`
  `getDefaults()`
  `TemplateResponseFormat`
  `getResponseFormat()`
  `List<ChatMessage>`
  `getTemplate()`
  Please use `withMessages(Message...)` instead.
  `List<ChatCompletionTool>`
  `getTools()`
  `int`
  `hashCode()`
  `protected PromptTemplatingModuleConfigPrompt`
  `toLowLevel()`
  Create a low-level representation of the template.
  `String`
  `toString()`
  `OrchestrationTemplate`
  `withDefaults(Map<String,String> defaults)`
  `OrchestrationTemplate`
  `withJsonResponse()`
  Set the response format to JSON object.
  `OrchestrationTemplate`
  `withJsonSchemaResponse(ResponseJsonSchema schema)`
  Set the response format to the given JSON schema.
  `OrchestrationTemplate`
  `withMessages(Message... messages)`
  Create a new template with the given messages.
  `OrchestrationTemplate`
  `withTemplate(List<ChatMessage> template)`
  Deprecated.
  `OrchestrationTemplate`
  `withTools(List<ChatCompletionTool> tools)`

  ### Methods inherited from class com.sap.ai.sdk.orchestration.TemplateConfig

  `create, reference`

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

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

- ## Method Details

  - ### withMessages

    @Nonnull public OrchestrationTemplate withMessages(@Nonnull Message... messages)
    Create a new template with the given messages.
    Parameters:
      `messages` - The messages to use in the template.
    Returns:
      The updated template.

  - ### toLowLevel

    @Nonnull protected PromptTemplatingModuleConfigPrompt toLowLevel()
    Create a low-level representation of the template.
    Specified by:
      `toLowLevel` in class `TemplateConfig`
    Returns:
      The low-level representation of the template.

  - ### withJsonSchemaResponse

    @Nonnull public OrchestrationTemplate withJsonSchemaResponse(@Nonnull ResponseJsonSchema schema)
    Set the response format to the given JSON schema.
    Parameters:
      `schema` - The JSON schema to use.
    Returns:
      The updated template.

  - ### withJsonResponse

    @Nonnull public OrchestrationTemplate withJsonResponse()
    Set the response format to JSON object.
    Returns:
      The updated template.

  - ### fromYaml

    @Nullable public OrchestrationTemplate fromYaml(@Nonnull String inputYaml) throws IOException
    Create a `Template` object from a YAML provided as String.
    Parameters:
      `inputYaml` - the provided YAML
    Returns:
      A Template object representing the provided YAML
    Throws:
      `IOException` - if the YAML cannot be parsed or deserialized
    Since:
      1.7.0

  - ### getTemplate

    @Nullable public List<ChatMessage> getTemplate()
    Please use `withMessages(Message...)` instead.

  - ### getDefaults

    @Nullable public Map<String,String> getDefaults()

  - ### getResponseFormat

    @Nullable public TemplateResponseFormat getResponseFormat()

  - ### getTools

    @Nullable public List<ChatCompletionTool> getTools()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `TemplateConfig`

  - ### canEqual

    protected boolean canEqual(Object other)
    Overrides:
      `canEqual` in class `TemplateConfig`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `TemplateConfig`

  - ### withDefaults

    public OrchestrationTemplate withDefaults(@Nullable Map<String,String> defaults)
    Returns:
      a clone of this object, except with this updated property (returns `this` if an identical value is passed).

  - ### withTools

    public OrchestrationTemplate withTools(@Nullable List<ChatCompletionTool> tools)
    Returns:
      a clone of this object, except with this updated property (returns `this` if an identical value is passed).

  - ### withTemplate

    @Deprecated public OrchestrationTemplate withTemplate(@Nullable List<ChatMessage> template)
    Deprecated.
    Please use `withMessages(Message...)` instead.
    Returns:
      a clone of this object, except with this updated property (returns `this` if an identical value is passed).