Class: OpenAI::BotMessage
Instance Attribute Summary
Attributes inherited from Message
#body, #chat_id, #from, #id, #replies_to, #role, #timestamp, #tokens
Instance Method Summary collapse
-
#initialize ⇒ BotMessage
constructor
A new instance of BotMessage.
- #valid? ⇒ Boolean
Methods inherited from Message
Constructor Details
#initialize ⇒ BotMessage
Returns a new instance of BotMessage.
65 66 67 68 |
# File 'lib/open_ai/message.rb', line 65 def initialize(...) super(...) @role = :assistant end |
Instance Method Details
#valid? ⇒ Boolean
70 71 72 |
# File 'lib/open_ai/message.rb', line 70 def valid? [body, id, chat_id, tokens].all?(&:present?) end |