ChatMessage

@Serializable
data class ChatMessage(val role: ChatRole, val messageContent: Content? = null, val name: String? = null, val functionCall: FunctionCall? = null, val toolCalls: List<ToolCall>? = null, val toolCallId: ToolId? = null, val contentFilterResults: List<ContentFilterResults>? = null, val contentFilterOffsets: List<ContentFilterOffsets>? = null)

The messages to generate chat completions for.

Constructors

Link copied to clipboard
constructor(role: ChatRole, content: String? = null, name: String? = null, functionCall: FunctionCall? = null, toolCalls: List<ToolCall>? = null, toolCallId: ToolId? = null, contentFilterResults: List<ContentFilterResults>? = null, contentFilterOffsets: List<ContentFilterOffsets>? = null)
constructor(role: ChatRole, content: List<ContentPart>? = null, name: String? = null, functionCall: FunctionCall? = null, toolCalls: List<ToolCall>? = null, toolCallId: ToolId? = null, contentFilterResults: List<ContentFilterResults>? = null, contentFilterOffsets: List<ContentFilterOffsets>? = null)
constructor(role: ChatRole, messageContent: Content? = null, name: String? = null, functionCall: FunctionCall? = null, toolCalls: List<ToolCall>? = null, toolCallId: ToolId? = null, contentFilterResults: List<ContentFilterResults>? = null, contentFilterOffsets: List<ContentFilterOffsets>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "content_filter_offsets")
val contentFilterOffsets: List<ContentFilterOffsets>? = null

Azure Content Filter Offsets

Link copied to clipboard
@SerialName(value = "content_filter_results")
val contentFilterResults: List<ContentFilterResults>? = null

Azure Content Filter Results

Link copied to clipboard
@SerialName(value = "function_call")
val functionCall: FunctionCall? = null

The name and arguments of a function that should be called, as generated by the model.

Link copied to clipboard
@SerialName(value = "content")
val messageContent: Content? = null

The contents of the message. This is required for requests, and optional for responses.

Link copied to clipboard
@SerialName(value = "name")
val name: String? = null

The author's name of this message. name is required if the role is `ChatRole.Function, and it should be the name of the function whose response is in the content. It May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.

Link copied to clipboard
@SerialName(value = "role")
val role: ChatRole

The role of the author of this message.

Link copied to clipboard
@SerialName(value = "tool_call_id")
val toolCallId: ToolId? = null

Tool call ID.

Link copied to clipboard
@SerialName(value = "tool_calls")
val toolCalls: List<ToolCall>? = null

The tool calls generated by the model, such as function calls.