Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit ba22ec3

Browse files
authored
feat: expose label to create scores API (#133)
* feat: expose label to create scores API * fix: add label to ScoreDict
1 parent 9305ff8 commit ba22ec3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

literalai/api/score_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def create_scores_fields_builder(scores: List[ScoreDict]):
7171
generated += f"""$name_{id}: String!
7272
$type_{id}: ScoreType!
7373
$value_{id}: Float!
74+
$label_{id}: String
7475
$stepId_{id}: String
7576
$datasetExperimentItemId_{id}: String
7677
$scorer_{id}: String
@@ -88,6 +89,7 @@ def create_scores_args_builder(scores: List[ScoreDict]):
8889
name: $name_{id}
8990
type: $type_{id}
9091
value: $value_{id}
92+
label: $label_{id}
9193
stepId: $stepId_{id}
9294
datasetExperimentItemId: $datasetExperimentItemId_{id}
9395
scorer: $scorer_{id}
@@ -98,6 +100,7 @@ def create_scores_args_builder(scores: List[ScoreDict]):
98100
name
99101
type
100102
value
103+
label
101104
comment
102105
scorer
103106
}}

literalai/observability/step.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ScoreDict(TypedDict, total=False):
4848
name: str
4949
type: ScoreType
5050
value: float
51+
label: Optional[str]
5152
stepId: Optional[str]
5253
datasetExperimentItemId: Optional[str]
5354
comment: Optional[str]

0 commit comments

Comments
 (0)