Reasoning

data class Reasoning(val id: String? = null, val encrypted: String? = null, val parts: List<ContentPart.Text>, val summary: List<ContentPart.Text>? = null, val metaInfo: ResponseMetaInfo) : Message.Response(source)

Represents a reasoning message exchanged in a chat system, encapsulating the content, role, and associated metadata, with an optional reference to the original thinking process.

Constructors

Link copied to clipboard
constructor(id: String? = null, encrypted: String? = null, parts: List<ContentPart.Text>, summary: List<ContentPart.Text>? = null, metaInfo: ResponseMetaInfo)
constructor(id: String? = null, encrypted: String? = null, summary: String? = null, content: String, metaInfo: ResponseMetaInfo)

Single content part reasoning message constructor

Properties

Link copied to clipboard
open val content: String

The textual content of the message aggregated from all ContentPart.Text parts joined to String separated by newlines.

Link copied to clipboard

The encrypted content of the reasoning message.

Link copied to clipboard
val id: String?

An optional identifier for the reasoning process.

Link copied to clipboard
open override val metaInfo: ResponseMetaInfo

Metadata associated with the reasoning, captured as a ResponseMetaInfo instance. Provides details such as token usage and timestamps.

Link copied to clipboard
open override val parts: List<ContentPart.Text>

The parts of the reasoning message. Only the ContentPart.Text part is allowed.

Link copied to clipboard
open override val role: Message.Role

The Role of the message, indicating its source or function in the chat (e.g., assistant, user). Defaults to Role.Assistant.

Link copied to clipboard

An optional summary of the reasoning process. Only the ContentPart.Text part is allowed.

Functions

Link copied to clipboard
open override fun copy(updatedMetaInfo: ResponseMetaInfo): Message.Reasoning

Creates a copy of the current Response instance with updated metadata.

Link copied to clipboard

Checks weather the message consists of attachments.

Link copied to clipboard

Checks weather the message consists of only sungle text content.

Link copied to clipboard

Converts a Message.Response to a list of StreamFrame. First it emits the delta frames for each content part for each message, then complete frame with the full message content.