Skip to content

ChatMessage

MarcoDotIO edited this page Mar 1, 2023 · 1 revision

ChatMessage

The chat message object used for each chat conversation message.

public struct ChatMessage: Codable, Identifiable 

Inheritance

Codable, Identifiable

Initializers

init(role:content:)

public init(role: ChatRole, content: String) 

Properties

id

ID used for iterating through list of chat messages

public var id = UUID().uuidString

role

The person sending the message

public let role: ChatRole

content

The message itself

public let content: String

body

public var body: [String: String] 
Types
Global Functions
Clone this wiki locally