Class: Envoy::Conversation
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Envoy::Conversation
- Defined in:
- app/models/envoy/conversation.rb
Instance Method Summary collapse
-
#effective_system_prompt ⇒ Object
Per-conversation ad-hoc instructions, appended last by Runner.
- #prompt_body ⇒ Object
-
#read_only? ⇒ Boolean
A surface may pin a chat read-only; so may the conversation's own status.
- #resolved_model_id ⇒ Object
-
#surface ⇒ Object
Embed conversations resolve everything through their surface, so editing a surface reaches chats that already exist.
- #toolset ⇒ Object
Instance Method Details
#effective_system_prompt ⇒ Object
Per-conversation ad-hoc instructions, appended last by Runner.
36 37 38 |
# File 'app/models/envoy/conversation.rb', line 36 def effective_system_prompt system_prompt.presence end |
#prompt_body ⇒ Object
25 26 27 28 |
# File 'app/models/envoy/conversation.rb', line 25 def prompt_body return surface.prompt_body if surface prompt_key.present? ? Envoy.prompt(prompt_key).full_body : nil end |
#read_only? ⇒ Boolean
A surface may pin a chat read-only; so may the conversation's own status.
31 32 33 |
# File 'app/models/envoy/conversation.rb', line 31 def read_only? status == "read_only" || !!surface&.read_only? end |
#resolved_model_id ⇒ Object
21 22 23 |
# File 'app/models/envoy/conversation.rb', line 21 def resolved_model_id surface&.model_id || model_id || Envoy.config.default_model end |
#surface ⇒ Object
Embed conversations resolve everything through their surface, so editing a surface reaches chats that already exist. Console conversations have no surface and fall back to their own columns.
13 14 15 |
# File 'app/models/envoy/conversation.rb', line 13 def surface surface_key.present? ? Envoy.surface(surface_key) : nil end |