Package org.springframework.ai.deepseek
Class DeepSeekAssistantMessage
java.lang.Object
org.springframework.ai.chat.messages.AbstractMessage
org.springframework.ai.chat.messages.AssistantMessage
org.springframework.ai.deepseek.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.
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.static classDeprecated, for removal: This API element is subject to removal in a future version.Nested classes/interfaces inherited from class org.springframework.ai.chat.messages.AssistantMessage
AssistantMessage.ToolCall -
Field Summary
Fields inherited from class org.springframework.ai.chat.messages.AssistantMessage
mediaFields inherited from class org.springframework.ai.chat.messages.AbstractMessage
MESSAGE_TYPE, messageType, metadata, textContent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeepSeekAssistantMessage(@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.protectedDeepSeekAssistantMessage(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. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.@Nullable BooleanDeprecated, for removal: This API element is subject to removal in a future version.The prefix completion flag, read from theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.@Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.The reasoning content: the joined text of theReasoningParts, unless it was overridden throughsetReasoningContent(String).inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.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.voidDeprecated, for removal: This API element is subject to removal in a future version.Sets the prefix completion flag, as theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.voidsetReasoningContent(@Nullable String reasoningContent) Deprecated, for removal: This API element is subject to removal in a future version.Overrides the reasoning content returned bygetReasoningContent()and sent back to DeepSeek.toString()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.springframework.ai.chat.messages.AssistantMessage
copy, getMedia, getReasoning, getToolCalls, hasToolCallsMethods inherited from class org.springframework.ai.chat.messages.AbstractMessage
firstIndexOf, getMessageType, getMetadata, getParts, getText, legacyParts, replace, selectMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.ai.content.Content
getMetadata, getText
-
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
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 orderproperties- the message metadata, holding the prefix flag underDeepSeekChatModel.PREFIX_METADATA_KEY, if any- Since:
- 2.1.0
-
-
Method Details
-
getPrefix
Deprecated, for removal: This API element is subject to removal in a future version.The prefix completion flag, read from theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.- Returns:
- the flag, or
nullwhen it is not set
-
setPrefix
Deprecated, for removal: This API element is subject to removal in a future version.Sets the prefix completion flag, as theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.- Parameters:
prefix- the flag
-
getReasoningContent
Deprecated, for removal: This API element is subject to removal in a future version.The reasoning content: the joined text of theReasoningParts, unless it was overridden throughsetReasoningContent(String).- Returns:
- the reasoning content, or
nullwhen there is none
-
setReasoningContent
Deprecated, for removal: This API element is subject to removal in a future version.Overrides the reasoning content returned bygetReasoningContent()and sent back to DeepSeek. The parts of a message are immutable, so they keep the originalReasoningParts;mutate()andAssistantMessage.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 throughsetReasoningContent(String)replaces theReasoningParts.- Overrides:
mutatein classAssistantMessage- Returns:
- the builder
-
equals
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
equalsin classAbstractMessage
-
hashCode
public int hashCode()Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
hashCodein classAbstractMessage
-
toString
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
toStringin classAssistantMessage
-
builder
Deprecated, for removal: This API element is subject to removal in a future version.
-
AssistantMessage.getReasoning(), and build a prefix message as anAssistantMessagewhose metadata holdstrueunderDeepSeekChatModel.PREFIX_METADATA_KEY