Class: Xeno::Chat
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Xeno::Chat
- Defined in:
- app/models/xeno/chat.rb
Overview
The persisted RubyLLM chat backing one session's transcript. Owned by xeno — host apps with their own acts_as chat classes are unaffected; the message class below pins the transcript inside the engine namespace. Models, tool calls, usage, and batches are RubyLLM library records (ruby_llm_* tables), polymorphic toward this class.
Instance Method Summary collapse
-
#apply_runtime_options!(model_options) ⇒ Object
assume_model_exists and protocol are runtime attributes, not columns — a freshly loaded record loses them, and the first to_llm build (which with_instructions triggers) then resolves the model strictly and with the provider's default protocol: ModelNotFoundError on the SECOND message of any session using a custom/OpenAI-compatible model (finding K).
Instance Method Details
#apply_runtime_options!(model_options) ⇒ Object
assume_model_exists and protocol are runtime attributes, not columns — a freshly loaded record loses them, and the first to_llm build (which with_instructions triggers) then resolves the model strictly and with the provider's default protocol: ModelNotFoundError on the SECOND message of any session using a custom/OpenAI-compatible model (finding K). Every entry point re-applies them from the definition.
16 17 18 19 20 |
# File 'app/models/xeno/chat.rb', line 16 def () self.assume_model_exists = [:assume_model_exists] if .key?(:assume_model_exists) self.protocol = [:protocol] if .key?(:protocol) self end |