Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions langfuse/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
Comment,
CommentObjectType,
ConfigCategory,
CorrectionScore,
CreateAnnotationQueueAssignmentResponse,
CreateAnnotationQueueItemRequest,
CreateAnnotationQueueRequest,
Expand Down Expand Up @@ -85,9 +86,11 @@
GetScoresResponseData,
GetScoresResponseDataBoolean,
GetScoresResponseDataCategorical,
GetScoresResponseDataCorrection,
GetScoresResponseDataNumeric,
GetScoresResponseData_Boolean,
GetScoresResponseData_Categorical,
GetScoresResponseData_Correction,
GetScoresResponseData_Numeric,
GetScoresResponseTraceData,
HealthResponse,
Expand Down Expand Up @@ -199,6 +202,7 @@
ScoreV1_Numeric,
Score_Boolean,
Score_Categorical,
Score_Correction,
Score_Numeric,
SdkLogBody,
SdkLogEvent,
Expand Down Expand Up @@ -293,6 +297,7 @@
"Comment",
"CommentObjectType",
"ConfigCategory",
"CorrectionScore",
"CreateAnnotationQueueAssignmentResponse",
"CreateAnnotationQueueItemRequest",
"CreateAnnotationQueueRequest",
Expand Down Expand Up @@ -342,9 +347,11 @@
"GetScoresResponseData",
"GetScoresResponseDataBoolean",
"GetScoresResponseDataCategorical",
"GetScoresResponseDataCorrection",
"GetScoresResponseDataNumeric",
"GetScoresResponseData_Boolean",
"GetScoresResponseData_Categorical",
"GetScoresResponseData_Correction",
"GetScoresResponseData_Numeric",
"GetScoresResponseTraceData",
"HealthResponse",
Expand Down Expand Up @@ -456,6 +463,7 @@
"ScoreV1_Numeric",
"Score_Boolean",
"Score_Categorical",
"Score_Correction",
"Score_Numeric",
"SdkLogBody",
"SdkLogEvent",
Expand Down
8 changes: 8 additions & 0 deletions langfuse/api/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
Comment,
CommentObjectType,
ConfigCategory,
CorrectionScore,
CreateScoreValue,
Dataset,
DatasetItem,
Expand Down Expand Up @@ -101,6 +102,7 @@
ScoreV1_Numeric,
Score_Boolean,
Score_Categorical,
Score_Correction,
Score_Numeric,
Session,
SessionWithTraces,
Expand Down Expand Up @@ -268,9 +270,11 @@
GetScoresResponseData,
GetScoresResponseDataBoolean,
GetScoresResponseDataCategorical,
GetScoresResponseDataCorrection,
GetScoresResponseDataNumeric,
GetScoresResponseData_Boolean,
GetScoresResponseData_Categorical,
GetScoresResponseData_Correction,
GetScoresResponseData_Numeric,
GetScoresResponseTraceData,
)
Expand Down Expand Up @@ -313,6 +317,7 @@
"Comment",
"CommentObjectType",
"ConfigCategory",
"CorrectionScore",
"CreateAnnotationQueueAssignmentResponse",
"CreateAnnotationQueueItemRequest",
"CreateAnnotationQueueRequest",
Expand Down Expand Up @@ -362,9 +367,11 @@
"GetScoresResponseData",
"GetScoresResponseDataBoolean",
"GetScoresResponseDataCategorical",
"GetScoresResponseDataCorrection",
"GetScoresResponseDataNumeric",
"GetScoresResponseData_Boolean",
"GetScoresResponseData_Categorical",
"GetScoresResponseData_Correction",
"GetScoresResponseData_Numeric",
"GetScoresResponseTraceData",
"HealthResponse",
Expand Down Expand Up @@ -476,6 +483,7 @@
"ScoreV1_Numeric",
"Score_Boolean",
"Score_Categorical",
"Score_Correction",
"Score_Numeric",
"SdkLogBody",
"SdkLogEvent",
Expand Down
4 changes: 4 additions & 0 deletions langfuse/api/resources/commons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Comment,
CommentObjectType,
ConfigCategory,
CorrectionScore,
CreateScoreValue,
Dataset,
DatasetItem,
Expand Down Expand Up @@ -41,6 +42,7 @@
ScoreV1_Numeric,
Score_Boolean,
Score_Categorical,
Score_Correction,
Score_Numeric,
Session,
SessionWithTraces,
Expand Down Expand Up @@ -68,6 +70,7 @@
"Comment",
"CommentObjectType",
"ConfigCategory",
"CorrectionScore",
"CreateScoreValue",
"Dataset",
"DatasetItem",
Expand Down Expand Up @@ -102,6 +105,7 @@
"ScoreV1_Numeric",
"Score_Boolean",
"Score_Categorical",
"Score_Correction",
"Score_Numeric",
"Session",
"SessionWithTraces",
Expand Down
11 changes: 10 additions & 1 deletion langfuse/api/resources/commons/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .comment import Comment
from .comment_object_type import CommentObjectType
from .config_category import ConfigCategory
from .correction_score import CorrectionScore
from .create_score_value import CreateScoreValue
from .dataset import Dataset
from .dataset_item import DatasetItem
Expand All @@ -29,7 +30,13 @@
from .pricing_tier_condition import PricingTierCondition
from .pricing_tier_input import PricingTierInput
from .pricing_tier_operator import PricingTierOperator
from .score import Score, Score_Boolean, Score_Categorical, Score_Numeric
from .score import (
Score,
Score_Boolean,
Score_Categorical,
Score_Correction,
Score_Numeric,
)
from .score_config import ScoreConfig
from .score_config_data_type import ScoreConfigDataType
from .score_data_type import ScoreDataType
Expand All @@ -52,6 +59,7 @@
"Comment",
"CommentObjectType",
"ConfigCategory",
"CorrectionScore",
"CreateScoreValue",
"Dataset",
"DatasetItem",
Expand Down Expand Up @@ -83,6 +91,7 @@
"ScoreV1_Numeric",
"Score_Boolean",
"Score_Categorical",
"Score_Correction",
"Score_Numeric",
"Session",
"SessionWithTraces",
Expand Down
53 changes: 53 additions & 0 deletions langfuse/api/resources/commons/types/correction_score.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ....core.datetime_utils import serialize_datetime
from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .base_score import BaseScore


class CorrectionScore(BaseScore):
value: float = pydantic_v1.Field()
"""
The numeric value of the score. Always 0 for correction scores.
"""

string_value: str = pydantic_v1.Field(alias="stringValue")
"""
The string representation of the correction content
"""

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults_exclude_unset: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
kwargs_with_defaults_exclude_none: typing.Any = {
"by_alias": True,
"exclude_none": True,
**kwargs,
}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset),
super().dict(**kwargs_with_defaults_exclude_none),
)

class Config:
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = pydantic_v1.Extra.allow
json_encoders = {dt.datetime: serialize_datetime}
67 changes: 66 additions & 1 deletion langfuse/api/resources/commons/types/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,69 @@ class Config:
json_encoders = {dt.datetime: serialize_datetime}


Score = typing.Union[Score_Numeric, Score_Categorical, Score_Boolean]
class Score_Correction(pydantic_v1.BaseModel):
value: float
string_value: str = pydantic_v1.Field(alias="stringValue")
id: str
trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None)
session_id: typing.Optional[str] = pydantic_v1.Field(
alias="sessionId", default=None
)
observation_id: typing.Optional[str] = pydantic_v1.Field(
alias="observationId", default=None
)
dataset_run_id: typing.Optional[str] = pydantic_v1.Field(
alias="datasetRunId", default=None
)
name: str
source: ScoreSource
timestamp: dt.datetime
created_at: dt.datetime = pydantic_v1.Field(alias="createdAt")
updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt")
author_user_id: typing.Optional[str] = pydantic_v1.Field(
alias="authorUserId", default=None
)
comment: typing.Optional[str] = None
metadata: typing.Any
config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None)
queue_id: typing.Optional[str] = pydantic_v1.Field(alias="queueId", default=None)
environment: str
data_type: typing.Literal["CORRECTION"] = pydantic_v1.Field(
alias="dataType", default="CORRECTION"
)

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults_exclude_unset: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
kwargs_with_defaults_exclude_none: typing.Any = {
"by_alias": True,
"exclude_none": True,
**kwargs,
}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset),
super().dict(**kwargs_with_defaults_exclude_none),
)

class Config:
frozen = True
smart_union = True
allow_population_by_field_name = True
populate_by_name = True
extra = pydantic_v1.Extra.allow
json_encoders = {dt.datetime: serialize_datetime}


Score = typing.Union[Score_Numeric, Score_Categorical, Score_Boolean, Score_Correction]
4 changes: 4 additions & 0 deletions langfuse/api/resources/score_v_2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
GetScoresResponseData,
GetScoresResponseDataBoolean,
GetScoresResponseDataCategorical,
GetScoresResponseDataCorrection,
GetScoresResponseDataNumeric,
GetScoresResponseData_Boolean,
GetScoresResponseData_Categorical,
GetScoresResponseData_Correction,
GetScoresResponseData_Numeric,
GetScoresResponseTraceData,
)
Expand All @@ -17,9 +19,11 @@
"GetScoresResponseData",
"GetScoresResponseDataBoolean",
"GetScoresResponseDataCategorical",
"GetScoresResponseDataCorrection",
"GetScoresResponseDataNumeric",
"GetScoresResponseData_Boolean",
"GetScoresResponseData_Categorical",
"GetScoresResponseData_Correction",
"GetScoresResponseData_Numeric",
"GetScoresResponseTraceData",
]
4 changes: 4 additions & 0 deletions langfuse/api/resources/score_v_2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
GetScoresResponseData,
GetScoresResponseData_Boolean,
GetScoresResponseData_Categorical,
GetScoresResponseData_Correction,
GetScoresResponseData_Numeric,
)
from .get_scores_response_data_boolean import GetScoresResponseDataBoolean
from .get_scores_response_data_categorical import GetScoresResponseDataCategorical
from .get_scores_response_data_correction import GetScoresResponseDataCorrection
from .get_scores_response_data_numeric import GetScoresResponseDataNumeric
from .get_scores_response_trace_data import GetScoresResponseTraceData

Expand All @@ -17,9 +19,11 @@
"GetScoresResponseData",
"GetScoresResponseDataBoolean",
"GetScoresResponseDataCategorical",
"GetScoresResponseDataCorrection",
"GetScoresResponseDataNumeric",
"GetScoresResponseData_Boolean",
"GetScoresResponseData_Categorical",
"GetScoresResponseData_Correction",
"GetScoresResponseData_Numeric",
"GetScoresResponseTraceData",
]
Loading
Loading