Class ChatDelta

java.lang.Object
com.sap.ai.sdk.orchestration.model.ChatDelta

public class ChatDelta extends Object
ChatDelta
  • Constructor Details

    • ChatDelta

      protected ChatDelta()
      Default constructor for ChatDelta.
  • Method Details

    • role

      @Nonnull public ChatDelta role(@Nullable String role)
      Set the role of this ChatDelta instance and return the same instance.
      Parameters:
      role - The role of this ChatDelta
      Returns:
      The same instance of this ChatDelta class
    • getRole

      @Nonnull public String getRole()
      Get role
      Returns:
      role The role of this ChatDelta instance.
    • setRole

      public void setRole(@Nullable String role)
      Set the role of this ChatDelta instance.
      Parameters:
      role - The role of this ChatDelta
    • content

      @Nonnull public ChatDelta content(@Nonnull String content)
      Set the content of this ChatDelta instance and return the same instance.
      Parameters:
      content - The content of this ChatDelta
      Returns:
      The same instance of this ChatDelta class
    • getContent

      @Nonnull public String getContent()
      Get content
      Returns:
      content The content of this ChatDelta instance.
    • setContent

      public void setContent(@Nonnull String content)
      Set the content of this ChatDelta instance.
      Parameters:
      content - The content of this ChatDelta
    • refusal

      @Nonnull public ChatDelta refusal(@Nullable String refusal)
      Set the refusal of this ChatDelta instance and return the same instance.
      Parameters:
      refusal - The refusal message generated by the model.
      Returns:
      The same instance of this ChatDelta class
    • getRefusal

      @Nonnull public String getRefusal()
      The refusal message generated by the model.
      Returns:
      refusal The refusal of this ChatDelta instance.
    • setRefusal

      public void setRefusal(@Nullable String refusal)
      Set the refusal of this ChatDelta instance.
      Parameters:
      refusal - The refusal message generated by the model.
    • toolCalls

      @Nonnull public ChatDelta toolCalls(@Nullable List<ToolCallChunk> toolCalls)
      Set the toolCalls of this ChatDelta instance and return the same instance.
      Parameters:
      toolCalls - The toolCalls of this ChatDelta
      Returns:
      The same instance of this ChatDelta class
    • addToolCallsItem

      @Nonnull public ChatDelta addToolCallsItem(@Nonnull ToolCallChunk toolCallsItem)
      Add one toolCalls instance to this ChatDelta.
      Parameters:
      toolCallsItem - The toolCalls that should be added
      Returns:
      The same instance of type ChatDelta
    • getToolCalls

      @Nonnull public List<ToolCallChunk> getToolCalls()
      Get toolCalls
      Returns:
      toolCalls The toolCalls of this ChatDelta instance.
    • setToolCalls

      public void setToolCalls(@Nullable List<ToolCallChunk> toolCalls)
      Set the toolCalls of this ChatDelta instance.
      Parameters:
      toolCalls - The toolCalls of this ChatDelta
    • getCustomFieldNames

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