Module: Raif::Concerns::HasPromptTemplates
- Extended by:
- ActiveSupport::Concern
- Included in:
- Agent, Raif::Conversation, Task
- Defined in:
- app/models/raif/concerns/has_prompt_templates.rb
Defined Under Namespace
Classes: TemplateContext
Instance Method Summary collapse
Instance Method Details
#build_prompt ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/models/raif/concerns/has_prompt_templates.rb', line 40 def build_prompt if prompt_template_exists?(:prompt) render_prompt_template(:prompt) elsif defined?(super) super else raise NotImplementedError, "#{self.class.name} has no #build_prompt and no prompt template" end end |
#build_system_prompt ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'app/models/raif/concerns/has_prompt_templates.rb', line 50 def build_system_prompt if prompt_template_exists?(:system_prompt) render_prompt_template(:system_prompt) elsif defined?(super) super else raise NotImplementedError, "#{self.class.name} has no #build_system_prompt and no system prompt template" end end |