Class DeepSeekAssistantMessage

All Implemented Interfaces:
Message, Content, MediaContent

@Deprecated(since="2.1.0", forRemoval=true) public class DeepSeekAssistantMessage extends AssistantMessage
Deprecated, for removal: This API element is subject to removal in a future version.
since 2.1.0 for removal: read the reasoning through AssistantMessage.getReasoning(), and build a prefix message as an AssistantMessage whose metadata holds true under DeepSeekChatModel.PREFIX_METADATA_KEY
DeepSeek-specific AssistantMessage that exposes the reasoning content and the prefix completion flag through dedicated accessors.

Both are views over state the plain AssistantMessage carries: the reasoning content is the text of the ReasoningParts of the message (see AssistantMessage.getReasoning()), and the prefix flag is the DeepSeekChatModel.PREFIX_METADATA_KEY metadata entry. DeepSeekChatModel still returns this type, so existing casts keep working.

Author:
Mark Pollack, Soby Chacko, Sun Yuhan, guan xu, Dimitar Proynov
  • Constructor Details

    • DeepSeekAssistantMessage

      protected DeepSeekAssistantMessage(@Nullable String content, @Nullable String reasoningContent, @Nullable Boolean prefix, Map<String,Object> properties, List<AssistantMessage.ToolCall> toolCalls, List<Media> media)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • DeepSeekAssistantMessage

      protected DeepSeekAssistantMessage(List<MessagePart> parts, Map<String,Object> properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a message from an ordered list of parts.
      Parameters:
      parts - the parts, in order
      properties - the message metadata, holding the prefix flag under DeepSeekChatModel.PREFIX_METADATA_KEY, if any
      Since:
      2.1.0
  • Method Details

    • getPrefix

      public @Nullable Boolean getPrefix()
      Deprecated, for removal: This API element is subject to removal in a future version.
      The prefix completion flag, read from the DeepSeekChatModel.PREFIX_METADATA_KEY metadata entry.
      Returns:
      the flag, or null when it is not set
    • setPrefix

      public void setPrefix(Boolean prefix)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the prefix completion flag, as the DeepSeekChatModel.PREFIX_METADATA_KEY metadata entry.
      Parameters:
      prefix - the flag
    • getReasoningContent

      public @Nullable String getReasoningContent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      The reasoning content: the joined text of the ReasoningParts, unless it was overridden through setReasoningContent(String).
      Returns:
      the reasoning content, or null when there is none
    • setReasoningContent

      public void setReasoningContent(@Nullable String reasoningContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides the reasoning content returned by getReasoningContent() and sent back to DeepSeek. The parts of a message are immutable, so they keep the original ReasoningParts; mutate() and AssistantMessage.copy() turn the override into the reasoning part of the new message.

      To replace the reasoning parts themselves, build a new message instead: message.mutate().reasoningContent("...").build().

      Parameters:
      reasoningContent - the reasoning content
    • mutate

      Deprecated, for removal: This API element is subject to removal in a future version.
      A builder pre-populated with this message's parts and metadata, the prefix flag included. A reasoning content set through setReasoningContent(String) replaces the ReasoningParts.
      Overrides:
      mutate in class AssistantMessage
      Returns:
      the builder
    • equals

      public boolean equals(@Nullable Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class AbstractMessage
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class AbstractMessage
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class AssistantMessage
    • builder

      public static DeepSeekAssistantMessage.Builder builder()
      Deprecated, for removal: This API element is subject to removal in a future version.