Package org.springframework.ai.deepseek
Class DeepSeekAssistantMessage.AbstractBuilder<B extends DeepSeekAssistantMessage.AbstractBuilder<B>>
java.lang.Object
org.springframework.ai.chat.messages.AssistantMessage.Builder<B>
org.springframework.ai.deepseek.DeepSeekAssistantMessage.AbstractBuilder<B>
- Direct Known Subclasses:
DeepSeekAssistantMessage.Builder
- Enclosing class:
- DeepSeekAssistantMessage
public static class DeepSeekAssistantMessage.AbstractBuilder<B extends DeepSeekAssistantMessage.AbstractBuilder<B>>
extends AssistantMessage.Builder<B>
-
Field Summary
FieldsFields inherited from class org.springframework.ai.chat.messages.AssistantMessage.Builder
content, explicitParts, media, properties, toolCalls -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()protected List<MessagePart>The parts this builder would put in the message: the explicit parts, with the text, tool call and media parts replaced by the corresponding legacy setters that were called.Sets the prefix completion flag, stored as theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.reasoningContent(@Nullable String reasoningContent) Sets the reasoning content.protected booleanWhetherAssistantMessage.Builder.build()of this builder honorsAssistantMessage.Builder.part(MessagePart),AssistantMessage.Builder.parts(List)andAssistantMessage.Builder.reasoning(ReasoningPart).Methods inherited from class org.springframework.ai.chat.messages.AssistantMessage.Builder
content, media, part, parts, properties, reasoning, reasoning, self, toolCalls
-
Field Details
-
prefix
-
reasoningContent
-
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
prefix
Sets the prefix completion flag, stored as theDeepSeekChatModel.PREFIX_METADATA_KEYmetadata entry.- Parameters:
prefix- the flag, ornullto keep the metadata as it is- Returns:
- this builder
-
reasoningContent
Sets the reasoning content. LikeAssistantMessage.Builder.content(String)for the text, it replaces theReasoningParts of the message, or goes before every other part when there is none; anullor empty value removes them.- Parameters:
reasoningContent- the reasoning content- Returns:
- this builder
-
supportsParts
protected boolean supportsParts()Description copied from class:AssistantMessage.BuilderWhetherAssistantMessage.Builder.build()of this builder honorsAssistantMessage.Builder.part(MessagePart),AssistantMessage.Builder.parts(List)andAssistantMessage.Builder.reasoning(ReasoningPart). The base builder does. A subclass builder that overridesAssistantMessage.Builder.build()must override this method to returntrueand construct its message fromAssistantMessage.Builder.buildParts(); otherwiseAssistantMessage.Builder.part(MessagePart)throws so parts are never dropped silently.- Overrides:
supportsPartsin classAssistantMessage.Builder<B extends DeepSeekAssistantMessage.AbstractBuilder<B>>- Returns:
- whether explicit parts are supported
-
buildParts
Description copied from class:AssistantMessage.BuilderThe parts this builder would put in the message: the explicit parts, with the text, tool call and media parts replaced by the corresponding legacy setters that were called. A setter whose part type is not among the explicit parts puts its parts where the legacy order has them: the text before the first tool call or media part, the tool calls before the first media part, the media at the end.- Overrides:
buildPartsin classAssistantMessage.Builder<B extends DeepSeekAssistantMessage.AbstractBuilder<B>>- Returns:
- the parts, in message order
-
build
- Overrides:
buildin classAssistantMessage.Builder<B extends DeepSeekAssistantMessage.AbstractBuilder<B>>
-