mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
10 lines
288 B
Ruby
10 lines
288 B
Ruby
class Message < ApplicationRecord
|
|
belongs_to :chat
|
|
|
|
enum :role, { user: "user", assistant: "assistant", system: "system" }
|
|
|
|
validates :content, presence: true
|
|
validates :role, presence: true
|
|
|
|
scope :conversation, -> { where(debug_mode: false, role: [ :user, :assistant ]) }
|
|
end
|