AssistantMessageWithToolCalls

class AssistantMessageWithToolCalls constructor(content: String = "", val toolCalls: List<ToolCall>, val name: String? = null, val timestamp: Instant = Instant.now()) : Message, AssistantContent

An assistant message that includes tool calls. When an LLM requests tool calls, it may or may not include text content. This class handles both cases - empty content is valid for tool-call-only responses.

Constructors

Link copied to clipboard
constructor(content: String = "", toolCalls: List<ToolCall>, name: String? = null, timestamp: Instant = Instant.now())

Properties

Link copied to clipboard
open override val content: String

Get the text content, or empty string if none.

Link copied to clipboard

Returns all image parts in this message.

Link copied to clipboard

Returns true if this message contains any non-text content.

Link copied to clipboard
val name: String? = null
Link copied to clipboard
Link copied to clipboard
val role: Role
Link copied to clipboard
Link copied to clipboard

Returns the text content of the message by concatenating all TextParts.

Link copied to clipboard
open val timestamp: Instant
Link copied to clipboard

Functions

Link copied to clipboard
fun Message.toSpringAiMessage(): <Error class: unknown class>

Convert one of our messages to a Spring AI message with multimodal support.

Link copied to clipboard
open override fun toString(): String