Class: Langfuse::PromptVariables Private
- Inherits:
-
Object
- Object
- Langfuse::PromptVariables
- Defined in:
- lib/langfuse/prompt_variables.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Extracts referenced variables from parsed Mustache templates.
Constant Summary collapse
- TAG_TYPES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%i[etag utag].freeze
- SECTION_TYPES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%i[section inverted_section].freeze
Class Method Summary collapse
- .extract(template) ⇒ Object private
Class Method Details
.extract(template) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 18 |
# File 'lib/langfuse/prompt_variables.rb', line 15 def extract(template) tokens = Mustache::Template.new(template).tokens collect(tokens, []).reject(&:empty?).uniq end |