@@ -201,7 +201,7 @@ class Langfuse:
201201 cost_details={"total_cost": 0.0023}
202202 )
203203
204- # Score the generation (supports NUMERIC, BOOLEAN, CATEGORICAL)
204+ # Score the generation (supports NUMERIC, BOOLEAN, CATEGORICAL, TEXT )
205205 generation.score(name="relevance", value=0.95, data_type="NUMERIC")
206206 ```
207207 """
@@ -1992,7 +1992,7 @@ def create_score(
19921992 trace_id : Optional [str ] = None ,
19931993 score_id : Optional [str ] = None ,
19941994 observation_id : Optional [str ] = None ,
1995- data_type : Optional [Literal ["CATEGORICAL" ]] = "CATEGORICAL" ,
1995+ data_type : Optional [Literal ["CATEGORICAL" , "TEXT" ]] = "CATEGORICAL" ,
19961996 comment : Optional [str ] = None ,
19971997 config_id : Optional [str ] = None ,
19981998 metadata : Optional [Any ] = None ,
@@ -2022,13 +2022,13 @@ def create_score(
20222022
20232023 Args:
20242024 name: Name of the score (e.g., "relevance", "accuracy")
2025- value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL)
2025+ value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL/TEXT )
20262026 session_id: ID of the Langfuse session to associate the score with
20272027 dataset_run_id: ID of the Langfuse dataset run to associate the score with
20282028 trace_id: ID of the Langfuse trace to associate the score with
20292029 observation_id: Optional ID of the specific observation to score. Trace ID must be provided too.
20302030 score_id: Optional custom ID for the score (auto-generated if not provided)
2031- data_type: Type of score (NUMERIC, BOOLEAN, or CATEGORICAL )
2031+ data_type: Type of score (NUMERIC, BOOLEAN, CATEGORICAL, or TEXT )
20322032 comment: Optional comment or explanation for the score
20332033 config_id: Optional ID of a score config defined in Langfuse
20342034 metadata: Optional metadata to be attached to the score
@@ -2152,7 +2152,7 @@ def score_current_span(
21522152 name : str ,
21532153 value : str ,
21542154 score_id : Optional [str ] = None ,
2155- data_type : Optional [Literal ["CATEGORICAL" ]] = "CATEGORICAL" ,
2155+ data_type : Optional [Literal ["CATEGORICAL" , "TEXT" ]] = "CATEGORICAL" ,
21562156 comment : Optional [str ] = None ,
21572157 config_id : Optional [str ] = None ,
21582158 metadata : Optional [Any ] = None ,
@@ -2176,9 +2176,9 @@ def score_current_span(
21762176
21772177 Args:
21782178 name: Name of the score (e.g., "relevance", "accuracy")
2179- value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL)
2179+ value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL/TEXT )
21802180 score_id: Optional custom ID for the score (auto-generated if not provided)
2181- data_type: Type of score (NUMERIC, BOOLEAN, or CATEGORICAL )
2181+ data_type: Type of score (NUMERIC, BOOLEAN, CATEGORICAL, or TEXT )
21822182 comment: Optional comment or explanation for the score
21832183 config_id: Optional ID of a score config defined in Langfuse
21842184 metadata: Optional metadata to be attached to the score
@@ -2216,7 +2216,7 @@ def score_current_span(
22162216 name = name ,
22172217 value = cast (str , value ),
22182218 score_id = score_id ,
2219- data_type = cast (Literal ["CATEGORICAL" ], data_type ),
2219+ data_type = cast (Literal ["CATEGORICAL" , "TEXT" ], data_type ),
22202220 comment = comment ,
22212221 config_id = config_id ,
22222222 metadata = metadata ,
@@ -2242,7 +2242,7 @@ def score_current_trace(
22422242 name : str ,
22432243 value : str ,
22442244 score_id : Optional [str ] = None ,
2245- data_type : Optional [Literal ["CATEGORICAL" ]] = "CATEGORICAL" ,
2245+ data_type : Optional [Literal ["CATEGORICAL" , "TEXT" ]] = "CATEGORICAL" ,
22462246 comment : Optional [str ] = None ,
22472247 config_id : Optional [str ] = None ,
22482248 metadata : Optional [Any ] = None ,
@@ -2267,9 +2267,9 @@ def score_current_trace(
22672267
22682268 Args:
22692269 name: Name of the score (e.g., "user_satisfaction", "overall_quality")
2270- value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL)
2270+ value: Score value (can be numeric for NUMERIC/BOOLEAN types or string for CATEGORICAL/TEXT )
22712271 score_id: Optional custom ID for the score (auto-generated if not provided)
2272- data_type: Type of score (NUMERIC, BOOLEAN, or CATEGORICAL )
2272+ data_type: Type of score (NUMERIC, BOOLEAN, CATEGORICAL, or TEXT )
22732273 comment: Optional comment or explanation for the score
22742274 config_id: Optional ID of a score config defined in Langfuse
22752275 metadata: Optional metadata to be attached to the score
@@ -2305,7 +2305,7 @@ def score_current_trace(
23052305 name = name ,
23062306 value = cast (str , value ),
23072307 score_id = score_id ,
2308- data_type = cast (Literal ["CATEGORICAL" ], data_type ),
2308+ data_type = cast (Literal ["CATEGORICAL" , "TEXT" ], data_type ),
23092309 comment = comment ,
23102310 config_id = config_id ,
23112311 metadata = metadata ,
0 commit comments