Skip to content

Commit 121abc9

Browse files
docs(api): document metadata is set / is not set filter operators (#1946)
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) <noreply@anthropic.com>
1 parent f6b7040 commit 121abc9

14 files changed

Lines changed: 95 additions & 30 deletions

File tree

‎langfuse/api/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
EvaluationRuleReadFilterBase,
188188
EvaluationRuleReadFilterWithKey,
189189
EvaluationRuleStringFilterOperator,
190+
EvaluationRuleStringObjectFilterOperator,
190191
EvaluatorOutputDefinition,
191192
EvaluatorOutputDefinitionBase,
192193
EvaluatorOutputDefinition_Boolean,
@@ -607,6 +608,7 @@
607608
"EvaluationRuleReadFilterBase": ".evaluation_commons",
608609
"EvaluationRuleReadFilterWithKey": ".evaluation_commons",
609610
"EvaluationRuleStringFilterOperator": ".evaluation_commons",
611+
"EvaluationRuleStringObjectFilterOperator": ".evaluation_commons",
610612
"EvaluationRulesPage": ".evaluation_rules",
611613
"EvaluationUnauthorizedError": ".evaluation_errors",
612614
"Evaluator": ".evaluators",
@@ -1062,6 +1064,7 @@ def __dir__():
10621064
"EvaluationRuleReadFilterBase",
10631065
"EvaluationRuleReadFilterWithKey",
10641066
"EvaluationRuleStringFilterOperator",
1067+
"EvaluationRuleStringObjectFilterOperator",
10651068
"EvaluationRulesPage",
10661069
"EvaluationUnauthorizedError",
10671070
"Evaluator",

‎langfuse/api/evaluation_commons/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
EvaluationRuleReadFilterBase,
3333
EvaluationRuleReadFilterWithKey,
3434
EvaluationRuleStringFilterOperator,
35+
EvaluationRuleStringObjectFilterOperator,
3536
EvaluatorOutputDefinition,
3637
EvaluatorOutputDefinitionBase,
3738
EvaluatorOutputDefinition_Boolean,
@@ -85,6 +86,7 @@
8586
"EvaluationRuleReadFilterBase": ".types",
8687
"EvaluationRuleReadFilterWithKey": ".types",
8788
"EvaluationRuleStringFilterOperator": ".types",
89+
"EvaluationRuleStringObjectFilterOperator": ".types",
8890
"EvaluatorOutputDefinition": ".types",
8991
"EvaluatorOutputDefinitionBase": ".types",
9092
"EvaluatorOutputDefinition_Boolean": ".types",
@@ -167,6 +169,7 @@ def __dir__():
167169
"EvaluationRuleReadFilterBase",
168170
"EvaluationRuleReadFilterWithKey",
169171
"EvaluationRuleStringFilterOperator",
172+
"EvaluationRuleStringObjectFilterOperator",
170173
"EvaluatorOutputDefinition",
171174
"EvaluatorOutputDefinitionBase",
172175
"EvaluatorOutputDefinition_Boolean",

‎langfuse/api/evaluation_commons/types/__init__.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
from .evaluation_rule_string_filter_operator import (
4646
EvaluationRuleStringFilterOperator,
4747
)
48+
from .evaluation_rule_string_object_filter_operator import (
49+
EvaluationRuleStringObjectFilterOperator,
50+
)
4851
from .evaluator_output_definition import (
4952
EvaluatorOutputDefinition,
5053
EvaluatorOutputDefinition_Boolean,
@@ -101,6 +104,7 @@
101104
"EvaluationRuleReadFilterBase": ".evaluation_rule_read_filter_base",
102105
"EvaluationRuleReadFilterWithKey": ".evaluation_rule_read_filter_with_key",
103106
"EvaluationRuleStringFilterOperator": ".evaluation_rule_string_filter_operator",
107+
"EvaluationRuleStringObjectFilterOperator": ".evaluation_rule_string_object_filter_operator",
104108
"EvaluatorOutputDefinition": ".evaluator_output_definition",
105109
"EvaluatorOutputDefinitionBase": ".evaluator_output_definition_base",
106110
"EvaluatorOutputDefinition_Boolean": ".evaluator_output_definition",
@@ -183,6 +187,7 @@ def __dir__():
183187
"EvaluationRuleReadFilterBase",
184188
"EvaluationRuleReadFilterWithKey",
185189
"EvaluationRuleStringFilterOperator",
190+
"EvaluationRuleStringObjectFilterOperator",
186191
"EvaluatorOutputDefinition",
187192
"EvaluatorOutputDefinitionBase",
188193
"EvaluatorOutputDefinition_Boolean",

‎langfuse/api/evaluation_commons/types/evaluation_rule_filter.py‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from .evaluation_rule_number_filter_operator import EvaluationRuleNumberFilterOperator
1717
from .evaluation_rule_options_filter_operator import EvaluationRuleOptionsFilterOperator
1818
from .evaluation_rule_string_filter_operator import EvaluationRuleStringFilterOperator
19+
from .evaluation_rule_string_object_filter_operator import (
20+
EvaluationRuleStringObjectFilterOperator,
21+
)
1922

2023

2124
class EvaluationRuleFilter_Datetime(UniversalBaseModel):
@@ -34,7 +37,7 @@ class EvaluationRuleFilter_Datetime(UniversalBaseModel):
3437
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
3538
- `stringOptions`: `any of`, `none of`
3639
- `arrayOptions`: `any of`, `none of`, `all of`
37-
- `stringObject`: same operators as `string`
40+
- `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`)
3841
- `boolean`: `"="`, `"<>"`
3942
- `null`: `is null`, `is not null`
4043
@@ -97,7 +100,7 @@ class EvaluationRuleFilter_String(UniversalBaseModel):
97100
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
98101
- `stringOptions`: `any of`, `none of`
99102
- `arrayOptions`: `any of`, `none of`, `all of`
100-
- `stringObject`: same operators as `string`
103+
- `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`)
101104
- `boolean`: `"="`, `"<>"`
102105
- `null`: `is null`, `is not null`
103106
@@ -160,7 +163,7 @@ class EvaluationRuleFilter_Number(UniversalBaseModel):
160163
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
161164
- `stringOptions`: `any of`, `none of`
162165
- `arrayOptions`: `any of`, `none of`, `all of`
163-
- `stringObject`: same operators as `string`
166+
- `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`)
164167
- `boolean`: `"="`, `"<>"`
165168
- `null`: `is null`, `is not null`
166169
@@ -223,7 +226,7 @@ class EvaluationRuleFilter_StringOptions(UniversalBaseModel):
223226
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
224227
- `stringOptions`: `any of`, `none of`
225228
- `arrayOptions`: `any of`, `none of`, `all of`
226-
- `stringObject`: same operators as `string`
229+
- `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`)
227230
- `boolean`: `"="`, `"<>"`
228231
- `null`: `is null`, `is not null`
229232
@@ -286,7 +289,7 @@ class EvaluationRuleFilter_CategoryOptions(UniversalBaseModel):
286289
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
287290
- `stringOptions`: `any of`, `none of`
288291
- `arrayOptions`: `any of`, `none of`, `all of`
289-
- `stringObject`: same operators as `string`
292+
- `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`)
290293
- `boolean`: `"="`, `"<>"`
291294
- `null`: `is null`, `is not null`
292295
@@ -350,7 +353,7 @@ class EvaluationRuleFilter_ArrayOptions(UniversalBaseModel):
350353
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
351354
- `stringOptions`: `any of`, `none of`
352355
- `arrayOptions`: `any of`, `none of`, `all of`
353-
- `stringObject`: same operators as `string`
356+
- `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`)
354357
- `boolean`: `"="`, `"<>"`
355358
- `null`: `is null`, `is not null`
356359
@@ -413,7 +416,7 @@ class EvaluationRuleFilter_StringObject(UniversalBaseModel):
413416
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
414417
- `stringOptions`: `any of`, `none of`
415418
- `arrayOptions`: `any of`, `none of`, `all of`
416-
- `stringObject`: same operators as `string`
419+
- `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`)
417420
- `boolean`: `"="`, `"<>"`
418421
- `null`: `is null`, `is not null`
419422
@@ -453,7 +456,7 @@ class EvaluationRuleFilter_StringObject(UniversalBaseModel):
453456
type: typing.Literal["stringObject"] = "stringObject"
454457
column: str
455458
key: str
456-
operator: EvaluationRuleStringFilterOperator
459+
operator: EvaluationRuleStringObjectFilterOperator
457460
value: str
458461

459462
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
@@ -477,7 +480,7 @@ class EvaluationRuleFilter_NumberObject(UniversalBaseModel):
477480
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
478481
- `stringOptions`: `any of`, `none of`
479482
- `arrayOptions`: `any of`, `none of`, `all of`
480-
- `stringObject`: same operators as `string`
483+
- `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`)
481484
- `boolean`: `"="`, `"<>"`
482485
- `null`: `is null`, `is not null`
483486
@@ -541,7 +544,7 @@ class EvaluationRuleFilter_Boolean(UniversalBaseModel):
541544
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
542545
- `stringOptions`: `any of`, `none of`
543546
- `arrayOptions`: `any of`, `none of`, `all of`
544-
- `stringObject`: same operators as `string`
547+
- `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`)
545548
- `boolean`: `"="`, `"<>"`
546549
- `null`: `is null`, `is not null`
547550
@@ -604,7 +607,7 @@ class EvaluationRuleFilter_Null(UniversalBaseModel):
604607
- `datetime`: `"="`, `">"`, `"<"`, `">="`, `"<="`
605608
- `stringOptions`: `any of`, `none of`
606609
- `arrayOptions`: `any of`, `none of`, `all of`
607-
- `stringObject`: same operators as `string`
610+
- `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`)
608611
- `boolean`: `"="`, `"<>"`
609612
- `null`: `is null`, `is not null`
610613
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
from ...core import enum
6+
7+
T_Result = typing.TypeVar("T_Result")
8+
9+
10+
class EvaluationRuleStringObjectFilterOperator(enum.StrEnum):
11+
EQUALS = "="
12+
CONTAINS = "contains"
13+
DOES_NOT_CONTAIN = "does not contain"
14+
STARTS_WITH = "starts with"
15+
ENDS_WITH = "ends with"
16+
IS_SET = "is set"
17+
IS_NOT_SET = "is not set"
18+
19+
def visit(
20+
self,
21+
equals: typing.Callable[[], T_Result],
22+
contains: typing.Callable[[], T_Result],
23+
does_not_contain: typing.Callable[[], T_Result],
24+
starts_with: typing.Callable[[], T_Result],
25+
ends_with: typing.Callable[[], T_Result],
26+
is_set: typing.Callable[[], T_Result],
27+
is_not_set: typing.Callable[[], T_Result],
28+
) -> T_Result:
29+
if self is EvaluationRuleStringObjectFilterOperator.EQUALS:
30+
return equals()
31+
if self is EvaluationRuleStringObjectFilterOperator.CONTAINS:
32+
return contains()
33+
if self is EvaluationRuleStringObjectFilterOperator.DOES_NOT_CONTAIN:
34+
return does_not_contain()
35+
if self is EvaluationRuleStringObjectFilterOperator.STARTS_WITH:
36+
return starts_with()
37+
if self is EvaluationRuleStringObjectFilterOperator.ENDS_WITH:
38+
return ends_with()
39+
if self is EvaluationRuleStringObjectFilterOperator.IS_SET:
40+
return is_set()
41+
if self is EvaluationRuleStringObjectFilterOperator.IS_NOT_SET:
42+
return is_not_set()

‎langfuse/api/evaluation_commons/types/string_object_evaluation_rule_filter.py‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
import pydantic
66
from ...core.pydantic_utilities import UniversalBaseModel
7-
from .evaluation_rule_string_filter_operator import EvaluationRuleStringFilterOperator
7+
from .evaluation_rule_string_object_filter_operator import (
8+
EvaluationRuleStringObjectFilterOperator,
9+
)
810

911

1012
class StringObjectEvaluationRuleFilter(UniversalBaseModel):
@@ -18,8 +20,15 @@ class StringObjectEvaluationRuleFilter(UniversalBaseModel):
1820
Top-level key inside the object-valued column to filter on.
1921
"""
2022

21-
operator: EvaluationRuleStringFilterOperator
22-
value: str
23+
operator: EvaluationRuleStringObjectFilterOperator = pydantic.Field()
24+
"""
25+
Use `is set` / `is not set` to filter on key presence.
26+
"""
27+
28+
value: str = pydantic.Field()
29+
"""
30+
Value to compare against. Ignored for `is set` / `is not set`; send `""`.
31+
"""
2332

2433
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
2534
extra="allow", frozen=True

‎langfuse/api/legacy/observations_v1/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def get_many(
150150
// - categoryOptions: "any of", "none of"
151151
// - arrayOptions: "any of", "none of", "all of"
152152
// - number: "=", ">", "<", ">=", "<="
153-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with"
153+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set"
154154
// - numberObject: "=", ">", "<", ">=", "<="
155155
// - boolean: "=", "<>"
156156
// - null: "is null", "is not null"
@@ -414,7 +414,7 @@ async def get_many(
414414
// - categoryOptions: "any of", "none of"
415415
// - arrayOptions: "any of", "none of", "all of"
416416
// - number: "=", ">", "<", ">=", "<="
417-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with"
417+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set"
418418
// - numberObject: "=", ">", "<", ">=", "<="
419419
// - boolean: "=", "<>"
420420
// - null: "is null", "is not null"

‎langfuse/api/legacy/observations_v1/raw_client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def get_many(
211211
// - categoryOptions: "any of", "none of"
212212
// - arrayOptions: "any of", "none of", "all of"
213213
// - number: "=", ">", "<", ">=", "<="
214-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with"
214+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set"
215215
// - numberObject: "=", ">", "<", ">=", "<="
216216
// - boolean: "=", "<>"
217217
// - null: "is null", "is not null"
@@ -588,7 +588,7 @@ async def get_many(
588588
// - categoryOptions: "any of", "none of"
589589
// - arrayOptions: "any of", "none of", "all of"
590590
// - number: "=", ">", "<", ">=", "<="
591-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with"
591+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "is set", "is not set"
592592
// - numberObject: "=", ">", "<", ">=", "<="
593593
// - boolean: "=", "<>"
594594
// - null: "is null", "is not null"

‎langfuse/api/observations/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def get_many(
153153
// - categoryOptions: "any of", "none of"
154154
// - arrayOptions: "any of", "none of", "all of"
155155
// - number: "=", ">", "<", ">=", "<="
156-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches"
156+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set"
157157
// - numberObject: "=", ">", "<", ">=", "<="
158158
// - boolean: "=", "<>"
159159
// - null: "is null", "is not null"
@@ -437,7 +437,7 @@ async def get_many(
437437
// - categoryOptions: "any of", "none of"
438438
// - arrayOptions: "any of", "none of", "all of"
439439
// - number: "=", ">", "<", ">=", "<="
440-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches"
440+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set"
441441
// - numberObject: "=", ">", "<", ">=", "<="
442442
// - boolean: "=", "<>"
443443
// - null: "is null", "is not null"

‎langfuse/api/observations/raw_client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def get_many(
151151
// - categoryOptions: "any of", "none of"
152152
// - arrayOptions: "any of", "none of", "all of"
153153
// - number: "=", ">", "<", ">=", "<="
154-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches"
154+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set"
155155
// - numberObject: "=", ">", "<", ">=", "<="
156156
// - boolean: "=", "<>"
157157
// - null: "is null", "is not null"
@@ -494,7 +494,7 @@ async def get_many(
494494
// - categoryOptions: "any of", "none of"
495495
// - arrayOptions: "any of", "none of", "all of"
496496
// - number: "=", ">", "<", ">=", "<="
497-
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches"
497+
// - stringObject: "=", "contains", "does not contain", "starts with", "ends with", "matches", "is set", "is not set"
498498
// - numberObject: "=", ">", "<", ">=", "<="
499499
// - boolean: "=", "<>"
500500
// - null: "is null", "is not null"

0 commit comments

Comments
 (0)