From 2a455f3ce6fc3e8c32b7c6e0aac1e374461322bd Mon Sep 17 00:00:00 2001 From: Niklas Semmler Date: Wed, 7 Oct 2026 17:24:57 +0200 Subject: [PATCH] docs(api): document metadata is set / is not set filter operators Regenerated langfuse/api from the upstream Fern definition: baseline langfuse/langfuse 619dbe3 (last sync, #1866) plus langfuse/langfuse#17357 and #18404. Split out of the bundled API-spec bot PR #1943. Co-Authored-By: Claude Opus 5.5 (1M context) --- langfuse/api/__init__.py | 3 ++ langfuse/api/evaluation_commons/__init__.py | 3 ++ .../api/evaluation_commons/types/__init__.py | 5 +++ .../types/evaluation_rule_filter.py | 25 ++++++----- ...tion_rule_string_object_filter_operator.py | 42 +++++++++++++++++++ .../string_object_evaluation_rule_filter.py | 15 +++++-- langfuse/api/legacy/observations_v1/client.py | 4 +- .../api/legacy/observations_v1/raw_client.py | 4 +- langfuse/api/observations/client.py | 4 +- langfuse/api/observations/raw_client.py | 4 +- langfuse/api/scores/client.py | 4 +- langfuse/api/scores/raw_client.py | 4 +- langfuse/api/trace/client.py | 4 +- langfuse/api/trace/raw_client.py | 4 +- 14 files changed, 95 insertions(+), 30 deletions(-) create mode 100644 langfuse/api/evaluation_commons/types/evaluation_rule_string_object_filter_operator.py diff --git a/langfuse/api/__init__.py b/langfuse/api/__init__.py index ec4d25b20..275fdff7c 100644 --- a/langfuse/api/__init__.py +++ b/langfuse/api/__init__.py @@ -187,6 +187,7 @@ EvaluationRuleReadFilterBase, EvaluationRuleReadFilterWithKey, EvaluationRuleStringFilterOperator, + EvaluationRuleStringObjectFilterOperator, EvaluatorOutputDefinition, EvaluatorOutputDefinitionBase, EvaluatorOutputDefinition_Boolean, @@ -607,6 +608,7 @@ "EvaluationRuleReadFilterBase": ".evaluation_commons", "EvaluationRuleReadFilterWithKey": ".evaluation_commons", "EvaluationRuleStringFilterOperator": ".evaluation_commons", + "EvaluationRuleStringObjectFilterOperator": ".evaluation_commons", "EvaluationRulesPage": ".evaluation_rules", "EvaluationUnauthorizedError": ".evaluation_errors", "Evaluator": ".evaluators", @@ -1062,6 +1064,7 @@ def __dir__(): "EvaluationRuleReadFilterBase", "EvaluationRuleReadFilterWithKey", "EvaluationRuleStringFilterOperator", + "EvaluationRuleStringObjectFilterOperator", "EvaluationRulesPage", "EvaluationUnauthorizedError", "Evaluator", diff --git a/langfuse/api/evaluation_commons/__init__.py b/langfuse/api/evaluation_commons/__init__.py index 00912e7ce..e16b31a7c 100644 --- a/langfuse/api/evaluation_commons/__init__.py +++ b/langfuse/api/evaluation_commons/__init__.py @@ -32,6 +32,7 @@ EvaluationRuleReadFilterBase, EvaluationRuleReadFilterWithKey, EvaluationRuleStringFilterOperator, + EvaluationRuleStringObjectFilterOperator, EvaluatorOutputDefinition, EvaluatorOutputDefinitionBase, EvaluatorOutputDefinition_Boolean, @@ -85,6 +86,7 @@ "EvaluationRuleReadFilterBase": ".types", "EvaluationRuleReadFilterWithKey": ".types", "EvaluationRuleStringFilterOperator": ".types", + "EvaluationRuleStringObjectFilterOperator": ".types", "EvaluatorOutputDefinition": ".types", "EvaluatorOutputDefinitionBase": ".types", "EvaluatorOutputDefinition_Boolean": ".types", @@ -167,6 +169,7 @@ def __dir__(): "EvaluationRuleReadFilterBase", "EvaluationRuleReadFilterWithKey", "EvaluationRuleStringFilterOperator", + "EvaluationRuleStringObjectFilterOperator", "EvaluatorOutputDefinition", "EvaluatorOutputDefinitionBase", "EvaluatorOutputDefinition_Boolean", diff --git a/langfuse/api/evaluation_commons/types/__init__.py b/langfuse/api/evaluation_commons/types/__init__.py index d04011e88..7c5018f54 100644 --- a/langfuse/api/evaluation_commons/types/__init__.py +++ b/langfuse/api/evaluation_commons/types/__init__.py @@ -45,6 +45,9 @@ from .evaluation_rule_string_filter_operator import ( EvaluationRuleStringFilterOperator, ) + from .evaluation_rule_string_object_filter_operator import ( + EvaluationRuleStringObjectFilterOperator, + ) from .evaluator_output_definition import ( EvaluatorOutputDefinition, EvaluatorOutputDefinition_Boolean, @@ -101,6 +104,7 @@ "EvaluationRuleReadFilterBase": ".evaluation_rule_read_filter_base", "EvaluationRuleReadFilterWithKey": ".evaluation_rule_read_filter_with_key", "EvaluationRuleStringFilterOperator": ".evaluation_rule_string_filter_operator", + "EvaluationRuleStringObjectFilterOperator": ".evaluation_rule_string_object_filter_operator", "EvaluatorOutputDefinition": ".evaluator_output_definition", "EvaluatorOutputDefinitionBase": ".evaluator_output_definition_base", "EvaluatorOutputDefinition_Boolean": ".evaluator_output_definition", @@ -183,6 +187,7 @@ def __dir__(): "EvaluationRuleReadFilterBase", "EvaluationRuleReadFilterWithKey", "EvaluationRuleStringFilterOperator", + "EvaluationRuleStringObjectFilterOperator", "EvaluatorOutputDefinition", "EvaluatorOutputDefinitionBase", "EvaluatorOutputDefinition_Boolean", diff --git a/langfuse/api/evaluation_commons/types/evaluation_rule_filter.py b/langfuse/api/evaluation_commons/types/evaluation_rule_filter.py index f281dbb17..160026a20 100644 --- a/langfuse/api/evaluation_commons/types/evaluation_rule_filter.py +++ b/langfuse/api/evaluation_commons/types/evaluation_rule_filter.py @@ -16,6 +16,9 @@ from .evaluation_rule_number_filter_operator import EvaluationRuleNumberFilterOperator from .evaluation_rule_options_filter_operator import EvaluationRuleOptionsFilterOperator from .evaluation_rule_string_filter_operator import EvaluationRuleStringFilterOperator +from .evaluation_rule_string_object_filter_operator import ( + EvaluationRuleStringObjectFilterOperator, +) class EvaluationRuleFilter_Datetime(UniversalBaseModel): @@ -34,7 +37,7 @@ class EvaluationRuleFilter_Datetime(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -97,7 +100,7 @@ class EvaluationRuleFilter_String(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -160,7 +163,7 @@ class EvaluationRuleFilter_Number(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -223,7 +226,7 @@ class EvaluationRuleFilter_StringOptions(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -286,7 +289,7 @@ class EvaluationRuleFilter_CategoryOptions(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -350,7 +353,7 @@ class EvaluationRuleFilter_ArrayOptions(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -413,7 +416,7 @@ class EvaluationRuleFilter_StringObject(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -453,7 +456,7 @@ class EvaluationRuleFilter_StringObject(UniversalBaseModel): type: typing.Literal["stringObject"] = "stringObject" column: str key: str - operator: EvaluationRuleStringFilterOperator + operator: EvaluationRuleStringObjectFilterOperator value: str model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( @@ -477,7 +480,7 @@ class EvaluationRuleFilter_NumberObject(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -541,7 +544,7 @@ class EvaluationRuleFilter_Boolean(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` @@ -604,7 +607,7 @@ class EvaluationRuleFilter_Null(UniversalBaseModel): - `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="` - `stringOptions`: `any of`, `none of` - `arrayOptions`: `any of`, `none of`, `all of` - - `stringObject`: same operators as `string` + - `stringObject`: `"="`, `contains`, `does not contain`, `starts with`, `ends with`, `is set`, `is not set` (use `is set` / `is not set` for key presence; an empty value for `contains`, `starts with`, or `ends with` is treated as `is set`) - `boolean`: `"="`, `"<>"` - `null`: `is null`, `is not null` diff --git a/langfuse/api/evaluation_commons/types/evaluation_rule_string_object_filter_operator.py b/langfuse/api/evaluation_commons/types/evaluation_rule_string_object_filter_operator.py new file mode 100644 index 000000000..edf675442 --- /dev/null +++ b/langfuse/api/evaluation_commons/types/evaluation_rule_string_object_filter_operator.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ...core import enum + +T_Result = typing.TypeVar("T_Result") + + +class EvaluationRuleStringObjectFilterOperator(enum.StrEnum): + EQUALS = "=" + CONTAINS = "contains" + DOES_NOT_CONTAIN = "does not contain" + STARTS_WITH = "starts with" + ENDS_WITH = "ends with" + IS_SET = "is set" + IS_NOT_SET = "is not set" + + def visit( + self, + equals: typing.Callable[[], T_Result], + contains: typing.Callable[[], T_Result], + does_not_contain: typing.Callable[[], T_Result], + starts_with: typing.Callable[[], T_Result], + ends_with: typing.Callable[[], T_Result], + is_set: typing.Callable[[], T_Result], + is_not_set: typing.Callable[[], T_Result], + ) -> T_Result: + if self is EvaluationRuleStringObjectFilterOperator.EQUALS: + return equals() + if self is EvaluationRuleStringObjectFilterOperator.CONTAINS: + return contains() + if self is EvaluationRuleStringObjectFilterOperator.DOES_NOT_CONTAIN: + return does_not_contain() + if self is EvaluationRuleStringObjectFilterOperator.STARTS_WITH: + return starts_with() + if self is EvaluationRuleStringObjectFilterOperator.ENDS_WITH: + return ends_with() + if self is EvaluationRuleStringObjectFilterOperator.IS_SET: + return is_set() + if self is EvaluationRuleStringObjectFilterOperator.IS_NOT_SET: + return is_not_set() diff --git a/langfuse/api/evaluation_commons/types/string_object_evaluation_rule_filter.py b/langfuse/api/evaluation_commons/types/string_object_evaluation_rule_filter.py index d291153f0..c0aed0846 100644 --- a/langfuse/api/evaluation_commons/types/string_object_evaluation_rule_filter.py +++ b/langfuse/api/evaluation_commons/types/string_object_evaluation_rule_filter.py @@ -4,7 +4,9 @@ import pydantic from ...core.pydantic_utilities import UniversalBaseModel -from .evaluation_rule_string_filter_operator import EvaluationRuleStringFilterOperator +from .evaluation_rule_string_object_filter_operator import ( + EvaluationRuleStringObjectFilterOperator, +) class StringObjectEvaluationRuleFilter(UniversalBaseModel): @@ -18,8 +20,15 @@ class StringObjectEvaluationRuleFilter(UniversalBaseModel): Top-level key inside the object-valued column to filter on. """ - operator: EvaluationRuleStringFilterOperator - value: str + operator: EvaluationRuleStringObjectFilterOperator = pydantic.Field() + """ + Use `is set` / `is not set` to filter on key presence. + """ + + value: str = pydantic.Field() + """ + Value to compare against. Ignored for `is set` / `is not set`; send `""`. + """ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( extra="allow", frozen=True diff --git a/langfuse/api/legacy/observations_v1/client.py b/langfuse/api/legacy/observations_v1/client.py index 871191ee5..46ee7772a 100644 --- a/langfuse/api/legacy/observations_v1/client.py +++ b/langfuse/api/legacy/observations_v1/client.py @@ -150,7 +150,7 @@ def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" @@ -414,7 +414,7 @@ async def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" diff --git a/langfuse/api/legacy/observations_v1/raw_client.py b/langfuse/api/legacy/observations_v1/raw_client.py index 73343c130..ee1792052 100644 --- a/langfuse/api/legacy/observations_v1/raw_client.py +++ b/langfuse/api/legacy/observations_v1/raw_client.py @@ -211,7 +211,7 @@ def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" @@ -588,7 +588,7 @@ async def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" diff --git a/langfuse/api/observations/client.py b/langfuse/api/observations/client.py index 0bab55257..a44bd0707 100644 --- a/langfuse/api/observations/client.py +++ b/langfuse/api/observations/client.py @@ -153,7 +153,7 @@ def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" @@ -437,7 +437,7 @@ async def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" diff --git a/langfuse/api/observations/raw_client.py b/langfuse/api/observations/raw_client.py index a4d6b82e7..24a78cc02 100644 --- a/langfuse/api/observations/raw_client.py +++ b/langfuse/api/observations/raw_client.py @@ -151,7 +151,7 @@ def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" @@ -494,7 +494,7 @@ async def get_many( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - boolean: "=", "<>" // - null: "is null", "is not null" diff --git a/langfuse/api/scores/client.py b/langfuse/api/scores/client.py index d035dc0bd..95f94389a 100644 --- a/langfuse/api/scores/client.py +++ b/langfuse/api/scores/client.py @@ -231,7 +231,7 @@ def get_many( Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. filter : typing.Optional[str] - A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with. + A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with, is set, is not set. Use is set / is not set to filter on metadata key presence. An empty value for contains, starts with, or ends with is treated as is set (key presence). request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -544,7 +544,7 @@ async def get_many( Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. filter : typing.Optional[str] - A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with. + A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with, is set, is not set. Use is set / is not set to filter on metadata key presence. An empty value for contains, starts with, or ends with is treated as is set (key presence). request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/langfuse/api/scores/raw_client.py b/langfuse/api/scores/raw_client.py index b87521d7a..e4295f233 100644 --- a/langfuse/api/scores/raw_client.py +++ b/langfuse/api/scores/raw_client.py @@ -297,7 +297,7 @@ def get_many( Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. filter : typing.Optional[str] - A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with. + A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with, is set, is not set. Use is set / is not set to filter on metadata key presence. An empty value for contains, starts with, or ends with is treated as is set (key presence). request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -789,7 +789,7 @@ async def get_many( Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. filter : typing.Optional[str] - A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with. + A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with, is set, is not set. Use is set / is not set to filter on metadata key presence. An empty value for contains, starts with, or ends with is treated as is set (key presence). request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/langfuse/api/trace/client.py b/langfuse/api/trace/client.py index 2cf76a4a0..5674177c1 100644 --- a/langfuse/api/trace/client.py +++ b/langfuse/api/trace/client.py @@ -198,7 +198,7 @@ def list( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - booleanObject: "=", "<>" // - boolean: "=", "<>" @@ -574,7 +574,7 @@ async def list( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - booleanObject: "=", "<>" // - boolean: "=", "<>" diff --git a/langfuse/api/trace/raw_client.py b/langfuse/api/trace/raw_client.py index 7cb22a519..0797b9919 100644 --- a/langfuse/api/trace/raw_client.py +++ b/langfuse/api/trace/raw_client.py @@ -326,7 +326,7 @@ def list( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - booleanObject: "=", "<>" // - boolean: "=", "<>" @@ -938,7 +938,7 @@ async def list( // - categoryOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" - // - stringObject: "=", "contains", "does not contain", "starts with", "ends with" + // - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set" // - numberObject: "=", ">", "<", ">=", "<=" // - booleanObject: "=", "<>" // - boolean: "=", "<>"