Module: Leva::Recordable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/leva/recordable.rb

Instance Method Summary collapse

Instance Method Details

#extract_regex_patternRegexp

Returns A regex pattern to extract the contents of a LLM response.

Returns:

  • (Regexp)

    A regex pattern to extract the contents of a LLM response



33
34
35
# File 'app/models/concerns/leva/recordable.rb', line 33

def extract_regex_pattern
  false
end

#ground_truthString

Returns The ground truth label for the record.

Returns:

  • (String)

    The ground truth label for the record

Raises:

  • (NotImplementedError)


13
14
15
# File 'app/models/concerns/leva/recordable.rb', line 13

def ground_truth
  raise NotImplementedError, "#{self.class} must implement #ground_truth"
end

#index_attributesHash

Returns A hash of attributes to be displayed in the dataset records index.

Returns:

  • (Hash)

    A hash of attributes to be displayed in the dataset records index

Raises:

  • (NotImplementedError)


18
19
20
# File 'app/models/concerns/leva/recordable.rb', line 18

def index_attributes
  raise NotImplementedError, "#{self.class} must implement #index_attributes"
end

#show_attributesHash

Returns A hash of attributes to be displayed in the dataset record show view.

Returns:

  • (Hash)

    A hash of attributes to be displayed in the dataset record show view

Raises:

  • (NotImplementedError)


23
24
25
# File 'app/models/concerns/leva/recordable.rb', line 23

def show_attributes
  raise NotImplementedError, "#{self.class} must implement #show_attributes"
end

#to_llm_contextHash

Returns A hash of attributes to be liquified for LLM context.

Returns:

  • (Hash)

    A hash of attributes to be liquified for LLM context

Raises:

  • (NotImplementedError)


28
29
30
# File 'app/models/concerns/leva/recordable.rb', line 28

def to_llm_context
  raise NotImplementedError, "#{self.class} must implement #to_llm_context"
end