Method: ActiveIntelligence::LLM::Prompt#render
- Defined in:
- lib/active_intelligence/llm/prompt.rb
#render ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/active_intelligence/llm/prompt.rb', line 11 def render lookup_context = ActionView::LookupContext.new([Rails.root.join('app/prompts')]) context = ActionView::Base.with_empty_template_cache.new(lookup_context, @assigns, nil) renderer = ActionView::Renderer.new(lookup_context) return renderer.render(context, { template: @template, formats: [:text], handlers: [:erb] }) end |