Package com.sap.ai.sdk.prompt.registry.model

# Class PromptTemplateSpec

java.lang.Object
com.sap.ai.sdk.prompt.registry.model.PromptTemplateSpec

public class PromptTemplateSpec extends Object
PromptTemplateSpec

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `PromptTemplateSpec.Builder`
  Builder helper class.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PromptTemplateSpec`
  `additionalFields(Object additionalFields)`
  Set the additionalFields of this `PromptTemplateSpec` instance and return the same instance.
  `PromptTemplateSpec`
  `addTemplateItem(PromptTemplate templateItem)`
  Add one template instance to this `PromptTemplateSpec`.
  `PromptTemplateSpec`
  `addToolsItem(ChatCompletionTool toolsItem)`
  Add one tools instance to this `PromptTemplateSpec`.
  `static PromptTemplateSpec.Builder`
  `create()`
  Create a type-safe, fluent-api builder object to construct a new `PromptTemplateSpec` instance with all required arguments.
  `PromptTemplateSpec`
  `defaults(Object defaults)`
  Set the defaults of this `PromptTemplateSpec` instance and return the same instance.
  `boolean`
  `equals(Object o)`
  `Object`
  `getAdditionalFields()`
  Deprecated.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `PromptTemplateSpec`.
  `Object`
  `getDefaults()`
  Get defaults
  `PromptTemplateSpecResponseFormat`
  `getResponseFormat()`
  Get responseFormat
  `List<PromptTemplate>`
  `getTemplate()`
  Get template
  `List<ChatCompletionTool>`
  `getTools()`
  A list of tools the model may call.
  `int`
  `hashCode()`
  `PromptTemplateSpec`
  `responseFormat(PromptTemplateSpecResponseFormat responseFormat)`
  Set the responseFormat of this `PromptTemplateSpec` instance and return the same instance.
  `void`
  `setAdditionalFields(Object additionalFields)`
  Set the additionalFields of this `PromptTemplateSpec` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `PromptTemplateSpec` instance.
  `void`
  `setDefaults(Object defaults)`
  Set the defaults of this `PromptTemplateSpec` instance.
  `void`
  `setResponseFormat(PromptTemplateSpecResponseFormat responseFormat)`
  Set the responseFormat of this `PromptTemplateSpec` instance.
  `void`
  `setTemplate(List<PromptTemplate> template)`
  Set the template of this `PromptTemplateSpec` instance.
  `void`
  `setTools(List<ChatCompletionTool> tools)`
  Set the tools of this `PromptTemplateSpec` instance.
  `PromptTemplateSpec`
  `template(List<PromptTemplate> template)`
  Set the template of this `PromptTemplateSpec` instance and return the same instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `PromptTemplateSpec` instance including unrecognized properties.
  `PromptTemplateSpec`
  `tools(List<ChatCompletionTool> tools)`
  Set the tools of this `PromptTemplateSpec` instance and return the same instance.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### PromptTemplateSpec

    protected PromptTemplateSpec()
    Default constructor for PromptTemplateSpec.

- ## Method Details

  - ### template

    @Nonnull public PromptTemplateSpec template(@Nonnull List<PromptTemplate> template)
    Set the template of this `PromptTemplateSpec` instance and return the same instance.
    Parameters:
      `template` - The template of this `PromptTemplateSpec`
    Returns:
      The same instance of this `PromptTemplateSpec` class

  - ### addTemplateItem

    @Nonnull public PromptTemplateSpec addTemplateItem(@Nonnull PromptTemplate templateItem)
    Add one template instance to this `PromptTemplateSpec`.
    Parameters:
      `templateItem` - The template that should be added
    Returns:
      The same instance of type `PromptTemplateSpec`

  - ### getTemplate

    @Nonnull public List<PromptTemplate> getTemplate()
    Get template
    Returns:
      template The template of this `PromptTemplateSpec` instance.

  - ### setTemplate

    public void setTemplate(@Nonnull List<PromptTemplate> template)
    Set the template of this `PromptTemplateSpec` instance.
    Parameters:
      `template` - The template of this `PromptTemplateSpec`

  - ### defaults

    @Nonnull public PromptTemplateSpec defaults(@Nullable Object defaults)
    Set the defaults of this `PromptTemplateSpec` instance and return the same instance.
    Parameters:
      `defaults` - The defaults of this `PromptTemplateSpec`
    Returns:
      The same instance of this `PromptTemplateSpec` class

  - ### getDefaults

    @Nonnull public Object getDefaults()
    Get defaults
    Returns:
      defaults The defaults of this `PromptTemplateSpec` instance.

  - ### setDefaults

    public void setDefaults(@Nullable Object defaults)
    Set the defaults of this `PromptTemplateSpec` instance.
    Parameters:
      `defaults` - The defaults of this `PromptTemplateSpec`

  - ### additionalFields

    @Nonnull public PromptTemplateSpec additionalFields(@Nullable Object additionalFields)
    Set the additionalFields of this `PromptTemplateSpec` instance and return the same instance.
    Parameters:
      `additionalFields` - DEPRECATED. Please use additional_fields instead.
    Returns:
      The same instance of this `PromptTemplateSpec` class

  - ### getAdditionalFields

    @Deprecated @Nonnull public Object getAdditionalFields()
    Deprecated.
    DEPRECATED. Please use additional_fields instead.
    Returns:
      additionalFields The additionalFields of this `PromptTemplateSpec` instance.

  - ### setAdditionalFields

    public void setAdditionalFields(@Nullable Object additionalFields)
    Set the additionalFields of this `PromptTemplateSpec` instance.
    Parameters:
      `additionalFields` - DEPRECATED. Please use additional_fields instead.

  - ### responseFormat

    @Nonnull public PromptTemplateSpec responseFormat(@Nullable PromptTemplateSpecResponseFormat responseFormat)
    Set the responseFormat of this `PromptTemplateSpec` instance and return the same instance.
    Parameters:
      `responseFormat` - The responseFormat of this `PromptTemplateSpec`
    Returns:
      The same instance of this `PromptTemplateSpec` class

  - ### getResponseFormat

    @Nonnull public PromptTemplateSpecResponseFormat getResponseFormat()
    Get responseFormat
    Returns:
      responseFormat The responseFormat of this `PromptTemplateSpec` instance.

  - ### setResponseFormat

    public void setResponseFormat(@Nullable PromptTemplateSpecResponseFormat responseFormat)
    Set the responseFormat of this `PromptTemplateSpec` instance.
    Parameters:
      `responseFormat` - The responseFormat of this `PromptTemplateSpec`

  - ### tools

    @Nonnull public PromptTemplateSpec tools(@Nullable List<ChatCompletionTool> tools)
    Set the tools of this `PromptTemplateSpec` instance and return the same instance.
    Parameters:
      `tools` - A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.
    Returns:
      The same instance of this `PromptTemplateSpec` class

  - ### addToolsItem

    @Nonnull public PromptTemplateSpec addToolsItem(@Nonnull ChatCompletionTool toolsItem)
    Add one tools instance to this `PromptTemplateSpec`.
    Parameters:
      `toolsItem` - The tools that should be added
    Returns:
      The same instance of type `PromptTemplateSpec`

  - ### getTools

    @Nonnull public List<ChatCompletionTool> getTools()
    A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.
    Returns:
      tools The tools of this `PromptTemplateSpec` instance.

  - ### setTools

    public void setTools(@Nullable List<ChatCompletionTool> tools)
    Set the tools of this `PromptTemplateSpec` instance.
    Parameters:
      `tools` - A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition.

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `PromptTemplateSpec`.
    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 `PromptTemplateSpec` 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 `PromptTemplateSpec` 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 `PromptTemplateSpec` 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 PromptTemplateSpec.Builder create()
    Create a type-safe, fluent-api builder object to construct a new `PromptTemplateSpec` instance with all required arguments.