Class: HermesAgent::Client::Entities::ChatMessage

Inherits:
HermesAgent::Client::Entity show all
Defined in:
lib/hermes_agent/client/entities/chat_completion.rb

Overview

A single message in a chat completion (the message of a ChatChoice).

Instance Method Summary collapse

Methods inherited from HermesAgent::Client::Entity

#==, #[], #eql?, #hash, #to_h

Instance Method Details

#contentString?

The message content. For a plain text completion this is the assistant's reply string; it may be nil (e.g. for tool calls).

Returns:

  • (String, nil)


27
28
29
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 27

def content
  self["content"]
end

#roleString?

The role of the message author, e.g. "assistant".

Returns:

  • (String, nil)


18
19
20
# File 'lib/hermes_agent/client/entities/chat_completion.rb', line 18

def role
  self["role"]
end