Module: Langfuse::ScoreValue Private
- Defined in:
- lib/langfuse/score_value.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Normalizes score values to the wire representation expected by Langfuse.
Class Method Summary collapse
-
.normalize(value, data_type) ⇒ Numeric, String
private
Normalized score value.
Class Method Details
.normalize(value, data_type) ⇒ Numeric, String
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.
Returns normalized score value.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/langfuse/score_value.rb', line 14 def self.normalize(value, data_type) case data_type when :numeric then numeric(value) when :boolean then boolean(value) when :categorical then string(value, "Categorical") when :text then text(value) when :correction then string(value, "Correction") else raise ArgumentError, "Invalid data_type: #{data_type}" end end |