diff --git a/langfuse/api/reference.md b/langfuse/api/reference.md index 6598e7cc4..759ddbdec 100644 --- a/langfuse/api/reference.md +++ b/langfuse/api/reference.md @@ -3635,7 +3635,7 @@ Use the `fields` parameter to control which observation fields are returned: - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId - `time` - completionStartTime, createdAt, updatedAt - `io` - input, output -- `metadata` - metadata +- `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values) - `model` - providedModelName, internalModelId, modelParameters - `usage` - usageDetails, costDetails, totalCost - `prompt` - promptId, promptName, promptVersion @@ -3699,6 +3699,19 @@ Example: "basic,usage,model"
+**expand_metadata:** `typing.Optional[str]` + +Comma-separated list of metadata keys to return non-truncated. +By default, metadata values over 200 characters are truncated. +Use this parameter to retrieve full values for specific keys. +Example: "key1,key2" + +
+
+ +
+
+ **limit:** `typing.Optional[int]` — Number of items to return per page. Maximum 1000, default 50.
diff --git a/langfuse/api/resources/commons/types/base_score.py b/langfuse/api/resources/commons/types/base_score.py index dd5449c83..c6a0d739a 100644 --- a/langfuse/api/resources/commons/types/base_score.py +++ b/langfuse/api/resources/commons/types/base_score.py @@ -11,15 +11,31 @@ class BaseScore(pydantic_v1.BaseModel): id: str trace_id: typing.Optional[str] = pydantic_v1.Field(alias="traceId", default=None) + """ + The trace ID associated with the score + """ + session_id: typing.Optional[str] = pydantic_v1.Field( alias="sessionId", default=None ) + """ + The session ID associated with the score + """ + observation_id: typing.Optional[str] = pydantic_v1.Field( alias="observationId", default=None ) + """ + The observation ID associated with the score + """ + dataset_run_id: typing.Optional[str] = pydantic_v1.Field( alias="datasetRunId", default=None ) + """ + The dataset run ID associated with the score + """ + name: str source: ScoreSource timestamp: dt.datetime @@ -28,8 +44,20 @@ class BaseScore(pydantic_v1.BaseModel): author_user_id: typing.Optional[str] = pydantic_v1.Field( alias="authorUserId", default=None ) - comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = None + """ + The user ID of the author + """ + + comment: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Comment on the score + """ + + metadata: typing.Any = pydantic_v1.Field() + """ + Metadata associated with the score + """ + config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None) """ Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range @@ -40,7 +68,7 @@ class BaseScore(pydantic_v1.BaseModel): The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. """ - environment: typing.Optional[str] = pydantic_v1.Field(default=None) + environment: str = pydantic_v1.Field() """ The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. """ diff --git a/langfuse/api/resources/commons/types/base_score_v_1.py b/langfuse/api/resources/commons/types/base_score_v_1.py index 478dcc6e6..0350864dc 100644 --- a/langfuse/api/resources/commons/types/base_score_v_1.py +++ b/langfuse/api/resources/commons/types/base_score_v_1.py @@ -16,14 +16,30 @@ class BaseScoreV1(pydantic_v1.BaseModel): observation_id: typing.Optional[str] = pydantic_v1.Field( alias="observationId", default=None ) + """ + The observation ID associated with the score + """ + 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.Optional[typing.Any] = None + """ + The user ID of the author + """ + + comment: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Comment on the score + """ + + metadata: typing.Any = pydantic_v1.Field() + """ + Metadata associated with the score + """ + config_id: typing.Optional[str] = pydantic_v1.Field(alias="configId", default=None) """ Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range @@ -34,7 +50,7 @@ class BaseScoreV1(pydantic_v1.BaseModel): The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. """ - environment: typing.Optional[str] = pydantic_v1.Field(default=None) + environment: str = pydantic_v1.Field() """ The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. """ diff --git a/langfuse/api/resources/commons/types/comment.py b/langfuse/api/resources/commons/types/comment.py index 4d8b1916a..bf8506797 100644 --- a/langfuse/api/resources/commons/types/comment.py +++ b/langfuse/api/resources/commons/types/comment.py @@ -19,6 +19,9 @@ class Comment(pydantic_v1.BaseModel): author_user_id: typing.Optional[str] = pydantic_v1.Field( alias="authorUserId", default=None ) + """ + The user ID of the comment author + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/langfuse/api/resources/commons/types/dataset.py b/langfuse/api/resources/commons/types/dataset.py index 116bff135..db54a8ee2 100644 --- a/langfuse/api/resources/commons/types/dataset.py +++ b/langfuse/api/resources/commons/types/dataset.py @@ -10,8 +10,16 @@ class Dataset(pydantic_v1.BaseModel): id: str name: str - description: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = None + description: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Description of the dataset + """ + + metadata: typing.Any = pydantic_v1.Field() + """ + Metadata associated with the dataset + """ + input_schema: typing.Optional[typing.Any] = pydantic_v1.Field( alias="inputSchema", default=None ) diff --git a/langfuse/api/resources/commons/types/dataset_item.py b/langfuse/api/resources/commons/types/dataset_item.py index dd5f85e78..eadd57f64 100644 --- a/langfuse/api/resources/commons/types/dataset_item.py +++ b/langfuse/api/resources/commons/types/dataset_item.py @@ -11,17 +11,35 @@ class DatasetItem(pydantic_v1.BaseModel): id: str status: DatasetStatus - input: typing.Optional[typing.Any] = None - expected_output: typing.Optional[typing.Any] = pydantic_v1.Field( - alias="expectedOutput", default=None - ) - metadata: typing.Optional[typing.Any] = None + input: typing.Any = pydantic_v1.Field() + """ + Input data for the dataset item + """ + + expected_output: typing.Any = pydantic_v1.Field(alias="expectedOutput") + """ + Expected output for the dataset item + """ + + metadata: typing.Any = pydantic_v1.Field() + """ + Metadata associated with the dataset item + """ + source_trace_id: typing.Optional[str] = pydantic_v1.Field( alias="sourceTraceId", default=None ) + """ + The trace ID that sourced this dataset item + """ + source_observation_id: typing.Optional[str] = pydantic_v1.Field( alias="sourceObservationId", default=None ) + """ + The observation ID that sourced this dataset item + """ + dataset_id: str = pydantic_v1.Field(alias="datasetId") dataset_name: str = pydantic_v1.Field(alias="datasetName") created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") diff --git a/langfuse/api/resources/commons/types/dataset_run.py b/langfuse/api/resources/commons/types/dataset_run.py index 74b1a2ac8..e130738de 100644 --- a/langfuse/api/resources/commons/types/dataset_run.py +++ b/langfuse/api/resources/commons/types/dataset_run.py @@ -23,7 +23,7 @@ class DatasetRun(pydantic_v1.BaseModel): Description of the run """ - metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None) + metadata: typing.Any = pydantic_v1.Field() """ Metadata of the dataset run """ diff --git a/langfuse/api/resources/commons/types/dataset_run_item.py b/langfuse/api/resources/commons/types/dataset_run_item.py index f1b3af163..ca41ae5c6 100644 --- a/langfuse/api/resources/commons/types/dataset_run_item.py +++ b/langfuse/api/resources/commons/types/dataset_run_item.py @@ -16,6 +16,10 @@ class DatasetRunItem(pydantic_v1.BaseModel): observation_id: typing.Optional[str] = pydantic_v1.Field( alias="observationId", default=None ) + """ + The observation ID associated with this run item + """ + created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") updated_at: dt.datetime = pydantic_v1.Field(alias="updatedAt") diff --git a/langfuse/api/resources/commons/types/model.py b/langfuse/api/resources/commons/types/model.py index 1b83c2696..86fce3c2d 100644 --- a/langfuse/api/resources/commons/types/model.py +++ b/langfuse/api/resources/commons/types/model.py @@ -74,9 +74,7 @@ class Model(pydantic_v1.BaseModel): Optional. Tokenizer to be applied to observations which match to this model. See docs for more details. """ - tokenizer_config: typing.Optional[typing.Any] = pydantic_v1.Field( - alias="tokenizerConfig", default=None - ) + tokenizer_config: typing.Any = pydantic_v1.Field(alias="tokenizerConfig") """ Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details. """ diff --git a/langfuse/api/resources/commons/types/observation.py b/langfuse/api/resources/commons/types/observation.py index b821476f9..1c343aa76 100644 --- a/langfuse/api/resources/commons/types/observation.py +++ b/langfuse/api/resources/commons/types/observation.py @@ -5,7 +5,6 @@ from ....core.datetime_utils import serialize_datetime from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .map_value import MapValue from .observation_level import ObservationLevel from .usage import Usage @@ -55,14 +54,12 @@ class Observation(pydantic_v1.BaseModel): The model used for the observation """ - model_parameters: typing.Optional[typing.Dict[str, MapValue]] = pydantic_v1.Field( - alias="modelParameters", default=None - ) + model_parameters: typing.Any = pydantic_v1.Field(alias="modelParameters") """ The parameters of the model used for the observation """ - input: typing.Optional[typing.Any] = pydantic_v1.Field(default=None) + input: typing.Any = pydantic_v1.Field() """ The input data of the observation """ @@ -72,17 +69,17 @@ class Observation(pydantic_v1.BaseModel): The version of the observation """ - metadata: typing.Optional[typing.Any] = pydantic_v1.Field(default=None) + metadata: typing.Any = pydantic_v1.Field() """ Additional metadata of the observation """ - output: typing.Optional[typing.Any] = pydantic_v1.Field(default=None) + output: typing.Any = pydantic_v1.Field() """ The output data of the observation """ - usage: typing.Optional[Usage] = pydantic_v1.Field(default=None) + usage: Usage = pydantic_v1.Field() """ (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation """ @@ -111,21 +108,17 @@ class Observation(pydantic_v1.BaseModel): The prompt ID associated with the observation """ - usage_details: typing.Optional[typing.Dict[str, int]] = pydantic_v1.Field( - alias="usageDetails", default=None - ) + usage_details: typing.Dict[str, int] = pydantic_v1.Field(alias="usageDetails") """ The usage details of the observation. Key is the name of the usage metric, value is the number of units consumed. The total key is the sum of all (non-total) usage metrics or the total value ingested. """ - cost_details: typing.Optional[typing.Dict[str, float]] = pydantic_v1.Field( - alias="costDetails", default=None - ) + cost_details: typing.Dict[str, float] = pydantic_v1.Field(alias="costDetails") """ The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested. """ - environment: typing.Optional[str] = pydantic_v1.Field(default=None) + environment: str = pydantic_v1.Field() """ The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. """ diff --git a/langfuse/api/resources/commons/types/score.py b/langfuse/api/resources/commons/types/score.py index f0b866067..8d54b6575 100644 --- a/langfuse/api/resources/commons/types/score.py +++ b/langfuse/api/resources/commons/types/score.py @@ -32,10 +32,10 @@ class Score_Numeric(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field( alias="dataType", default="NUMERIC" ) @@ -97,10 +97,10 @@ class Score_Categorical(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field( alias="dataType", default="CATEGORICAL" ) @@ -162,10 +162,10 @@ class Score_Boolean(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field( alias="dataType", default="BOOLEAN" ) diff --git a/langfuse/api/resources/commons/types/score_config.py b/langfuse/api/resources/commons/types/score_config.py index 2f7248143..1fda37a09 100644 --- a/langfuse/api/resources/commons/types/score_config.py +++ b/langfuse/api/resources/commons/types/score_config.py @@ -46,7 +46,10 @@ class ScoreConfig(pydantic_v1.BaseModel): Configures custom categories for categorical scores """ - description: typing.Optional[str] = None + description: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Description of the score config + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/langfuse/api/resources/commons/types/score_v_1.py b/langfuse/api/resources/commons/types/score_v_1.py index 191e0d96f..74c3f53f9 100644 --- a/langfuse/api/resources/commons/types/score_v_1.py +++ b/langfuse/api/resources/commons/types/score_v_1.py @@ -26,10 +26,10 @@ class ScoreV1_Numeric(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field( alias="dataType", default="NUMERIC" ) @@ -85,10 +85,10 @@ class ScoreV1_Categorical(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field( alias="dataType", default="CATEGORICAL" ) @@ -144,10 +144,10 @@ class ScoreV1_Boolean(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field( alias="dataType", default="BOOLEAN" ) diff --git a/langfuse/api/resources/commons/types/session.py b/langfuse/api/resources/commons/types/session.py index 46a0a6b96..ed1557460 100644 --- a/langfuse/api/resources/commons/types/session.py +++ b/langfuse/api/resources/commons/types/session.py @@ -11,7 +11,7 @@ class Session(pydantic_v1.BaseModel): id: str created_at: dt.datetime = pydantic_v1.Field(alias="createdAt") project_id: str = pydantic_v1.Field(alias="projectId") - environment: typing.Optional[str] = pydantic_v1.Field(default=None) + environment: str = pydantic_v1.Field() """ The environment from which this session originated. """ diff --git a/langfuse/api/resources/commons/types/trace.py b/langfuse/api/resources/commons/types/trace.py index d977ed3d7..725ad106d 100644 --- a/langfuse/api/resources/commons/types/trace.py +++ b/langfuse/api/resources/commons/types/trace.py @@ -60,17 +60,17 @@ class Trace(pydantic_v1.BaseModel): The metadata associated with the trace. Can be any JSON. """ - tags: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + tags: typing.List[str] = pydantic_v1.Field() """ - The tags associated with the trace. Can be an array of strings or null. + The tags associated with the trace. """ - public: typing.Optional[bool] = pydantic_v1.Field(default=None) + public: bool = pydantic_v1.Field() """ Public traces are accessible via url without login """ - environment: typing.Optional[str] = pydantic_v1.Field(default=None) + environment: str = pydantic_v1.Field() """ The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. """ diff --git a/langfuse/api/resources/commons/types/trace_with_details.py b/langfuse/api/resources/commons/types/trace_with_details.py index 5ffe6f218..795c43adc 100644 --- a/langfuse/api/resources/commons/types/trace_with_details.py +++ b/langfuse/api/resources/commons/types/trace_with_details.py @@ -14,22 +14,24 @@ class TraceWithDetails(Trace): Path of trace in Langfuse UI """ - latency: float = pydantic_v1.Field() + latency: typing.Optional[float] = pydantic_v1.Field(default=None) """ Latency of trace in seconds """ - total_cost: float = pydantic_v1.Field(alias="totalCost") + total_cost: typing.Optional[float] = pydantic_v1.Field( + alias="totalCost", default=None + ) """ Cost of trace in USD """ - observations: typing.List[str] = pydantic_v1.Field() + observations: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) """ List of observation ids """ - scores: typing.List[str] = pydantic_v1.Field() + scores: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) """ List of score ids """ diff --git a/langfuse/api/resources/commons/types/trace_with_full_details.py b/langfuse/api/resources/commons/types/trace_with_full_details.py index 2c6a99402..eb2848fa1 100644 --- a/langfuse/api/resources/commons/types/trace_with_full_details.py +++ b/langfuse/api/resources/commons/types/trace_with_full_details.py @@ -16,12 +16,14 @@ class TraceWithFullDetails(Trace): Path of trace in Langfuse UI """ - latency: float = pydantic_v1.Field() + latency: typing.Optional[float] = pydantic_v1.Field(default=None) """ Latency of trace in seconds """ - total_cost: float = pydantic_v1.Field(alias="totalCost") + total_cost: typing.Optional[float] = pydantic_v1.Field( + alias="totalCost", default=None + ) """ Cost of trace in USD """ diff --git a/langfuse/api/resources/commons/types/usage.py b/langfuse/api/resources/commons/types/usage.py index c38330494..c26620b5b 100644 --- a/langfuse/api/resources/commons/types/usage.py +++ b/langfuse/api/resources/commons/types/usage.py @@ -5,7 +5,6 @@ from ....core.datetime_utils import serialize_datetime from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .model_usage_unit import ModelUsageUnit class Usage(pydantic_v1.BaseModel): @@ -13,22 +12,26 @@ class Usage(pydantic_v1.BaseModel): (Deprecated. Use usageDetails and costDetails instead.) Standard interface for usage and cost """ - input: typing.Optional[int] = pydantic_v1.Field(default=None) + input: int = pydantic_v1.Field() """ Number of input units (e.g. tokens) """ - output: typing.Optional[int] = pydantic_v1.Field(default=None) + output: int = pydantic_v1.Field() """ Number of output units (e.g. tokens) """ - total: typing.Optional[int] = pydantic_v1.Field(default=None) + total: int = pydantic_v1.Field() """ Defaults to input+output if not set """ - unit: typing.Optional[ModelUsageUnit] = None + unit: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Unit of measurement + """ + input_cost: typing.Optional[float] = pydantic_v1.Field( alias="inputCost", default=None ) diff --git a/langfuse/api/resources/observations_v_2/client.py b/langfuse/api/resources/observations_v_2/client.py index e6796fd46..ea9599c69 100644 --- a/langfuse/api/resources/observations_v_2/client.py +++ b/langfuse/api/resources/observations_v_2/client.py @@ -26,6 +26,7 @@ def get_many( self, *, fields: typing.Optional[str] = None, + expand_metadata: typing.Optional[str] = None, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, parse_io_as_json: typing.Optional[bool] = None, @@ -56,7 +57,7 @@ def get_many( - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId - `time` - completionStartTime, createdAt, updatedAt - `io` - input, output - - `metadata` - metadata + - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values) - `model` - providedModelName, internalModelId, modelParameters - `usage` - usageDetails, costDetails, totalCost - `prompt` - promptId, promptName, promptVersion @@ -76,6 +77,12 @@ def get_many( If not specified, `core` and `basic` field groups are returned. Example: "basic,usage,model" + expand_metadata : typing.Optional[str] + Comma-separated list of metadata keys to return non-truncated. + By default, metadata values over 200 characters are truncated. + Use this parameter to retrieve full values for specific keys. + Example: "key1,key2" + limit : typing.Optional[int] Number of items to return per page. Maximum 1000, default 50. @@ -234,6 +241,7 @@ def get_many( method="GET", params={ "fields": fields, + "expandMetadata": expand_metadata, "limit": limit, "cursor": cursor, "parseIoAsJson": parse_io_as_json, @@ -292,6 +300,7 @@ async def get_many( self, *, fields: typing.Optional[str] = None, + expand_metadata: typing.Optional[str] = None, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, parse_io_as_json: typing.Optional[bool] = None, @@ -322,7 +331,7 @@ async def get_many( - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId - `time` - completionStartTime, createdAt, updatedAt - `io` - input, output - - `metadata` - metadata + - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values) - `model` - providedModelName, internalModelId, modelParameters - `usage` - usageDetails, costDetails, totalCost - `prompt` - promptId, promptName, promptVersion @@ -342,6 +351,12 @@ async def get_many( If not specified, `core` and `basic` field groups are returned. Example: "basic,usage,model" + expand_metadata : typing.Optional[str] + Comma-separated list of metadata keys to return non-truncated. + By default, metadata values over 200 characters are truncated. + Use this parameter to retrieve full values for specific keys. + Example: "key1,key2" + limit : typing.Optional[int] Number of items to return per page. Maximum 1000, default 50. @@ -508,6 +523,7 @@ async def main() -> None: method="GET", params={ "fields": fields, + "expandMetadata": expand_metadata, "limit": limit, "cursor": cursor, "parseIoAsJson": parse_io_as_json, diff --git a/langfuse/api/resources/score_v_2/types/get_scores_response_data.py b/langfuse/api/resources/score_v_2/types/get_scores_response_data.py index e09f31cb9..965a01c80 100644 --- a/langfuse/api/resources/score_v_2/types/get_scores_response_data.py +++ b/langfuse/api/resources/score_v_2/types/get_scores_response_data.py @@ -34,10 +34,10 @@ class GetScoresResponseData_Numeric(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["NUMERIC"] = pydantic_v1.Field( alias="dataType", default="NUMERIC" ) @@ -100,10 +100,10 @@ class GetScoresResponseData_Categorical(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["CATEGORICAL"] = pydantic_v1.Field( alias="dataType", default="CATEGORICAL" ) @@ -166,10 +166,10 @@ class GetScoresResponseData_Boolean(pydantic_v1.BaseModel): alias="authorUserId", default=None ) comment: typing.Optional[str] = None - metadata: typing.Optional[typing.Any] = 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: typing.Optional[str] = None + environment: str data_type: typing.Literal["BOOLEAN"] = pydantic_v1.Field( alias="dataType", default="BOOLEAN" )