AssistantMessage

open class AssistantMessage constructor(content: String, val name: String? = null, val awaitable: Awaitable<*, *>? = null, val assets: List<Asset> = emptyList(), val timestamp: Instant = Instant.now()) : BaseMessage, AssistantContent, AssetView

Message sent by the assistant - currently text-only

Parameters

content

Content of the message

name

Name of the assistant, if available

awaitable

Awaitable associated with this message, if any Enables forms to be put in front of users

Constructors

Link copied to clipboard
constructor(content: String, name: String? = null, awaitable: Awaitable<*, *>? = null, assets: List<Asset> = emptyList(), timestamp: Instant = Instant.now())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val assets: List<Asset>

All tracked assets, in order in which they were added

Link copied to clipboard
val awaitable: Awaitable<*, *>? = null
Link copied to clipboard
open override val content: String

Maintains backward compatibility with HasContent interface. Returns concatenated text from all TextParts.

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
open override 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 override val timestamp: Instant

Functions

Link copied to clipboard
open fun mostRecent(n: Int): AssetView

The most recently timestamped assets

Link copied to clipboard

The most recently added assets

Link copied to clipboard

Convenience method to return references. References will be converted to matryoshka tools

Link copied to clipboard
open fun since(instant: Instant): AssetView

Assets timestamped since the given instant

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