class Llama::ChatMessage

Overview

Represents a message in a chat conversation

Defined in:

llama/chat.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(role : String, content : String) #

Creates a new ChatMessage

Parameters:

  • role: The role of the message sender
  • content: The content of the message

[View source]

Instance Method Detail

def content : String #

The content of the message


[View source]
def content=(content : String) #

The content of the message


[View source]
def role : String #

The role of the message sender (e.g., "system", "user", "assistant")


[View source]
def role=(role : String) #

The role of the message sender (e.g., "system", "user", "assistant")


[View source]
def to_unsafe : LibLlama::LlamaChatMessage #

Converts to the C structure


[View source]