Uses of Interface
org.springframework.ai.chat.messages.part.MessagePart
Packages that use MessagePart
Package
Description
Ordered, typed content parts carried by chat messages: text, tool calls, tool results,
media and an opaque fallback for provider blocks that are not modeled yet.
Helpers for
SessionRepository implementations.-
Uses of MessagePart in org.springframework.ai.chat.messages
Fields in org.springframework.ai.chat.messages with type parameters of type MessagePartModifier and TypeFieldDescriptionprotected final List<MessagePart>AssistantMessage.Builder.explicitPartsMethods in org.springframework.ai.chat.messages with type parameters of type MessagePartMethods in org.springframework.ai.chat.messages that return types with arguments of type MessagePartModifier and TypeMethodDescriptionprotected List<MessagePart>AssistantMessage.Builder.buildParts()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.AbstractMessage.getParts()The ordered content parts of this message.protected static List<MessagePart>AbstractMessage.legacyParts(@Nullable String textContent) Methods in org.springframework.ai.chat.messages with parameters of type MessagePartModifier and TypeMethodDescriptionAssistantMessage.Builder.part(MessagePart part) Appends a content part.UserMessage.Builder.part(MessagePart part) Adds a part.Method parameters in org.springframework.ai.chat.messages with type arguments of type MessagePartModifier and TypeMethodDescriptionprotected static intAbstractMessage.firstIndexOf(List<MessagePart> parts, Class<? extends MessagePart>... types) The index of the first part that is an instance of any of the given types, for use as thefallbackIndexofAbstractMessage.replace(java.util.List<org.springframework.ai.chat.messages.part.MessagePart>, java.lang.Class<? extends org.springframework.ai.chat.messages.part.MessagePart>, java.util.List<? extends org.springframework.ai.chat.messages.part.MessagePart>, int).AssistantMessage.Builder.parts(List<MessagePart> parts) Appends content parts in order.ToolResponseMessage.Builder.parts(List<MessagePart> parts) Adds parts, in order, for example when rebuilding a persisted message.UserMessage.Builder.parts(List<MessagePart> parts) Adds parts, in order.protected static voidAbstractMessage.replace(List<MessagePart> parts, Class<? extends MessagePart> type, List<? extends MessagePart> replacements, int fallbackIndex) Removes every part of the given type and inserts the replacements where the first one was, or atfallbackIndexwhen there was none.protected static voidAbstractMessage.replace(List<MessagePart> parts, Class<? extends MessagePart> type, List<? extends MessagePart> replacements, int fallbackIndex) Removes every part of the given type and inserts the replacements where the first one was, or atfallbackIndexwhen there was none.Constructor parameters in org.springframework.ai.chat.messages with type arguments of type MessagePartModifierConstructorDescriptionprotectedAbstractMessage(MessageType messageType, List<MessagePart> parts, Map<String, Object> metadata) Create a new AbstractMessage from an ordered list of parts.protectedAssistantMessage(List<MessagePart> parts, Map<String, Object> properties) Creates a message from an ordered list of content parts, which may includeReasoningParts interleaved with the rest of the content.protectedToolResponseMessage(Map<String, Object> metadata, List<MessagePart> parts) Creates a message from an ordered list of parts.protectedUserMessage(List<MessagePart> parts, Map<String, Object> metadata) Creates a message from an ordered list of parts. -
Uses of MessagePart in org.springframework.ai.chat.messages.part
Classes in org.springframework.ai.chat.messages.part that implement MessagePartModifier and TypeClassDescriptionfinal recordA media element (image, audio, video, document) produced by the model or supplied by the caller.final recordModel reasoning (thinking) that preceded or accompanied the answer.final recordA run of text produced by the model or supplied by the caller.final recordA tool call requested by the model.final recordThe result of one tool call.final recordA part that neither an adapter nor this version of Spring AI recognizes, kept verbatim so nothing is silently dropped.Methods in org.springframework.ai.chat.messages.part that return MessagePartModifier and TypeMethodDescriptionstatic MessagePartStreamingParts.complete(MessagePart part, int index) Marks a part as the complete content block at the given index.static MessagePartStreamingParts.partial(MessagePart part, int index) Marks a part as a delta of the content block at the given index.StreamingPartIndexer.stamp(MessagePart part) Returns a copy of the part with its stream index set, and advances this indexer.static MessagePartStreamingParts.strip(MessagePart part) Removes the streaming attributes from a part.MessagePart.withAttributes(Map<String, String> attributes) Returns a copy of this part with the given attributes replacing the current ones.Methods in org.springframework.ai.chat.messages.part that return types with arguments of type MessagePartModifier and TypeMethodDescriptionToolResultPart.content()Returns the value of thecontentrecord component.Methods in org.springframework.ai.chat.messages.part with parameters of type MessagePartModifier and TypeMethodDescriptionstatic MessagePartStreamingParts.complete(MessagePart part, int index) Marks a part as the complete content block at the given index.static booleanStreamingParts.isPartial(MessagePart part) Whether a streamed part is a delta.static MessagePartStreamingParts.partial(MessagePart part, int index) Marks a part as a delta of the content block at the given index.static @Nullable IntegerStreamingParts.partIndex(MessagePart part) The content block index of a streamed part.StreamingPartIndexer.stamp(MessagePart part) Returns a copy of the part with its stream index set, and advances this indexer.static MessagePartStreamingParts.strip(MessagePart part) Removes the streaming attributes from a part.Constructor parameters in org.springframework.ai.chat.messages.part with type arguments of type MessagePartModifierConstructorDescriptionToolResultPart(@Nullable String id, @Nullable String name, List<MessagePart> content, boolean isError, @Nullable OpaquePayload payload, Map<String, String> attributes) Creates an instance of aToolResultPartrecord class. -
Uses of MessagePart in org.springframework.ai.deepseek
Methods in org.springframework.ai.deepseek that return types with arguments of type MessagePartModifier and TypeMethodDescriptionprotected List<MessagePart>DeepSeekAssistantMessage.AbstractBuilder.buildParts()Constructor parameters in org.springframework.ai.deepseek with type arguments of type MessagePartModifierConstructorDescriptionprotectedDeepSeekAssistantMessage(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. -
Uses of MessagePart in org.springframework.ai.session.support
Methods in org.springframework.ai.session.support that return types with arguments of type MessagePartModifier and TypeMethodDescriptionSessionEventCodec.MessageBody.parts()Returns the value of thepartsrecord component.Constructor parameters in org.springframework.ai.session.support with type arguments of type MessagePartModifierConstructorDescriptionMessageBody(List<MessagePart> parts, Map<String, Object> metadata) A body without an event payload, as a message event stores it.MessageBody(List<MessagePart> parts, Map<String, Object> metadata, Map<String, Object> payload) Creates an instance of aMessageBodyrecord class.