Class: SpreeMenuChat::Message

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree_menu_chat/message.rb

Overview

One turn of a SpreeMenuChat::Conversation — the customer's real question, or the full assembled answer once streaming completes. Written by SpreeMenuChat::ChatController; nothing else should create these directly.

Constant Summary collapse

ROLES =
%w[user assistant].freeze

Instance Method Summary collapse

Instance Method Details

#rendered_contentObject

Assistant answers regularly come back from Gemini with real markdown (bold ingredient names, bullet lists of menu items — see real examples in CHANGELOG.md) — rendered here for the admin conversation view. Sanitized after conversion, not just parsed: content ultimately derives from the customer's own question and retrieved catalog/policy text, neither of which this extension trusts blindly elsewhere (see AnswerGenerator's read-only guardrail comment) — Kramdown itself doesn't execute anything, but rendering its raw HTML output unsanitized would still let a crafted message smuggle a