Skip to content

Commit 4bb119a

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse 9a83721 (#1821)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com>
1 parent f9b875f commit 4bb119a

26 files changed

Lines changed: 244 additions & 109 deletions

‎langfuse/api/__init__.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,12 @@
112112
ObservationsView,
113113
ObservationsViewSingle,
114114
PricingTier,
115+
PricingTierAttributeCondition,
116+
PricingTierAttributeSource,
115117
PricingTierCondition,
116118
PricingTierInput,
117119
PricingTierOperator,
120+
PricingTierUsageCondition,
118121
Score,
119122
ScoreConfig,
120123
ScoreConfigDataType,
@@ -542,9 +545,12 @@
542545
"PlaceholderMessage": ".prompts",
543546
"PlaceholderMessageType": ".prompts",
544547
"PricingTier": ".commons",
548+
"PricingTierAttributeCondition": ".commons",
549+
"PricingTierAttributeSource": ".commons",
545550
"PricingTierCondition": ".commons",
546551
"PricingTierInput": ".commons",
547552
"PricingTierOperator": ".commons",
553+
"PricingTierUsageCondition": ".commons",
548554
"Project": ".projects",
549555
"ProjectDeletionResponse": ".projects",
550556
"Projects": ".projects",
@@ -883,9 +889,12 @@ def __dir__():
883889
"PlaceholderMessage",
884890
"PlaceholderMessageType",
885891
"PricingTier",
892+
"PricingTierAttributeCondition",
893+
"PricingTierAttributeSource",
886894
"PricingTierCondition",
887895
"PricingTierInput",
888896
"PricingTierOperator",
897+
"PricingTierUsageCondition",
889898
"Project",
890899
"ProjectDeletionResponse",
891900
"Projects",

‎langfuse/api/blob_storage_integrations/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def upsert_blob_storage_integration(
150150
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
151151
152152
export_source : typing.Optional[BlobStorageExportSource]
153-
Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
153+
Data to export. When omitted on update, the existing value is preserved. When omitted on create, the default is `OBSERVATIONS_V2` on Langfuse Cloud, and on self-hosted deployments `LEGACY_TRACES_OBSERVATIONS` — or `OBSERVATIONS_V2` where the deployment no longer populates the legacy tables. The default is never a source the deployment cannot serve. Required when `exportFieldGroups` is provided.
154154
155155
**Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
156156
@@ -427,7 +427,7 @@ async def upsert_blob_storage_integration(
427427
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
428428
429429
export_source : typing.Optional[BlobStorageExportSource]
430-
Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
430+
Data to export. When omitted on update, the existing value is preserved. When omitted on create, the default is `OBSERVATIONS_V2` on Langfuse Cloud, and on self-hosted deployments `LEGACY_TRACES_OBSERVATIONS` — or `OBSERVATIONS_V2` where the deployment no longer populates the legacy tables. The default is never a source the deployment cannot serve. Required when `exportFieldGroups` is provided.
431431
432432
**Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
433433

‎langfuse/api/blob_storage_integrations/raw_client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def upsert_blob_storage_integration(
207207
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
208208
209209
export_source : typing.Optional[BlobStorageExportSource]
210-
Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
210+
Data to export. When omitted on update, the existing value is preserved. When omitted on create, the default is `OBSERVATIONS_V2` on Langfuse Cloud, and on self-hosted deployments `LEGACY_TRACES_OBSERVATIONS` — or `OBSERVATIONS_V2` where the deployment no longer populates the legacy tables. The default is never a source the deployment cannot serve. Required when `exportFieldGroups` is provided.
211211
212212
**Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
213213
@@ -702,7 +702,7 @@ async def upsert_blob_storage_integration(
702702
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
703703
704704
export_source : typing.Optional[BlobStorageExportSource]
705-
Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
705+
Data to export. When omitted on update, the existing value is preserved. When omitted on create, the default is `OBSERVATIONS_V2` on Langfuse Cloud, and on self-hosted deployments `LEGACY_TRACES_OBSERVATIONS` — or `OBSERVATIONS_V2` where the deployment no longer populates the legacy tables. The default is never a source the deployment cannot serve. Required when `exportFieldGroups` is provided.
706706
707707
**Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
708708

‎langfuse/api/blob_storage_integrations/types/blob_storage_export_source.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BlobStorageExportSource(enum.StrEnum):
1414
- `OBSERVATIONS_V2`: same data model as the `/api/public/v2/observations` endpoint, plus scores. Columns are controlled by `exportFieldGroups`.
1515
- `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: both sets. Observation columns of both portions are controlled by `exportFieldGroups`.
1616
17-
**Note:** `OBSERVATIONS_V2` and the enriched-observations portion of `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` rely on the enriched observations table (Langfuse Fast Preview / v4), which is currently available on Langfuse Cloud only. See https://langfuse.com/docs/v4.
17+
**Note:** which sources a deployment accepts depends on how far it has moved to the v4 data model. `OBSERVATIONS_V2` and the enriched-observations portion of `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` read the enriched observations table, so they require a deployment that already populates it. `LEGACY_TRACES_OBSERVATIONS` and the legacy portion of `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` read the legacy traces and observations tables, so they require a deployment that still populates those. A deployment part-way through the migration populates both and accepts every source. Selecting a source the deployment cannot serve is rejected with `400`, rather than exporting an empty result. See https://langfuse.com/docs/v4.
1818
"""
1919

2020
LEGACY_TRACES_OBSERVATIONS = "LEGACY_TRACES_OBSERVATIONS"

‎langfuse/api/blob_storage_integrations/types/create_blob_storage_integration_request.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class CreateBlobStorageIntegrationRequest(UniversalBaseModel):
9797
typing.Optional[BlobStorageExportSource], FieldMetadata(alias="exportSource")
9898
] = pydantic.Field(default=None)
9999
"""
100-
Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
100+
Data to export. When omitted on update, the existing value is preserved. When omitted on create, the default is `OBSERVATIONS_V2` on Langfuse Cloud, and on self-hosted deployments `LEGACY_TRACES_OBSERVATIONS` — or `OBSERVATIONS_V2` where the deployment no longer populates the legacy tables. The default is never a source the deployment cannot serve. Required when `exportFieldGroups` is provided.
101101
102102
**Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
103103

‎langfuse/api/comments/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create(
5656
The content of the comment. May include markdown. Currently limited to 5000 characters.
5757
5858
author_user_id : typing.Optional[str]
59-
The id of the user who created the comment.
59+
The id of the user who created the comment. Must be a member of the organization that owns the project, otherwise an error will be thrown.
6060
6161
request_options : typing.Optional[RequestOptions]
6262
Request-specific configuration.
@@ -241,7 +241,7 @@ async def create(
241241
The content of the comment. May include markdown. Currently limited to 5000 characters.
242242
243243
author_user_id : typing.Optional[str]
244-
The id of the user who created the comment.
244+
The id of the user who created the comment. Must be a member of the organization that owns the project, otherwise an error will be thrown.
245245
246246
request_options : typing.Optional[RequestOptions]
247247
Request-specific configuration.

‎langfuse/api/comments/raw_client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def create(
5454
The content of the comment. May include markdown. Currently limited to 5000 characters.
5555
5656
author_user_id : typing.Optional[str]
57-
The id of the user who created the comment.
57+
The id of the user who created the comment. Must be a member of the organization that owns the project, otherwise an error will be thrown.
5858
5959
request_options : typing.Optional[RequestOptions]
6060
Request-specific configuration.
@@ -418,7 +418,7 @@ async def create(
418418
The content of the comment. May include markdown. Currently limited to 5000 characters.
419419
420420
author_user_id : typing.Optional[str]
421-
The id of the user who created the comment.
421+
The id of the user who created the comment. Must be a member of the organization that owns the project, otherwise an error will be thrown.
422422
423423
request_options : typing.Optional[RequestOptions]
424424
Request-specific configuration.

‎langfuse/api/comments/types/create_comment_request.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CreateCommentRequest(UniversalBaseModel):
3939
typing.Optional[str], FieldMetadata(alias="authorUserId")
4040
] = pydantic.Field(default=None)
4141
"""
42-
The id of the user who created the comment.
42+
The id of the user who created the comment. Must be a member of the organization that owns the project, otherwise an error will be thrown.
4343
"""
4444

4545
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(

‎langfuse/api/commons/__init__.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@
4040
ObservationsView,
4141
ObservationsViewSingle,
4242
PricingTier,
43+
PricingTierAttributeCondition,
44+
PricingTierAttributeSource,
4345
PricingTierCondition,
4446
PricingTierInput,
4547
PricingTierOperator,
48+
PricingTierUsageCondition,
4649
Score,
4750
ScoreConfig,
4851
ScoreConfigDataType,
@@ -112,9 +115,12 @@
112115
"ObservationsView": ".types",
113116
"ObservationsViewSingle": ".types",
114117
"PricingTier": ".types",
118+
"PricingTierAttributeCondition": ".types",
119+
"PricingTierAttributeSource": ".types",
115120
"PricingTierCondition": ".types",
116121
"PricingTierInput": ".types",
117122
"PricingTierOperator": ".types",
123+
"PricingTierUsageCondition": ".types",
118124
"Score": ".types",
119125
"ScoreConfig": ".types",
120126
"ScoreConfigDataType": ".types",
@@ -207,9 +213,12 @@ def __dir__():
207213
"ObservationsView",
208214
"ObservationsViewSingle",
209215
"PricingTier",
216+
"PricingTierAttributeCondition",
217+
"PricingTierAttributeSource",
210218
"PricingTierCondition",
211219
"PricingTierInput",
212220
"PricingTierOperator",
221+
"PricingTierUsageCondition",
213222
"Score",
214223
"ScoreConfig",
215224
"ScoreConfigDataType",

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@
3939
from .observations_view import ObservationsView
4040
from .observations_view_single import ObservationsViewSingle
4141
from .pricing_tier import PricingTier
42+
from .pricing_tier_attribute_condition import PricingTierAttributeCondition
43+
from .pricing_tier_attribute_source import PricingTierAttributeSource
4244
from .pricing_tier_condition import PricingTierCondition
4345
from .pricing_tier_input import PricingTierInput
4446
from .pricing_tier_operator import PricingTierOperator
47+
from .pricing_tier_usage_condition import PricingTierUsageCondition
4548
from .score import (
4649
Score,
4750
Score_Boolean,
@@ -103,9 +106,12 @@
103106
"ObservationsView": ".observations_view",
104107
"ObservationsViewSingle": ".observations_view_single",
105108
"PricingTier": ".pricing_tier",
109+
"PricingTierAttributeCondition": ".pricing_tier_attribute_condition",
110+
"PricingTierAttributeSource": ".pricing_tier_attribute_source",
106111
"PricingTierCondition": ".pricing_tier_condition",
107112
"PricingTierInput": ".pricing_tier_input",
108113
"PricingTierOperator": ".pricing_tier_operator",
114+
"PricingTierUsageCondition": ".pricing_tier_usage_condition",
109115
"Score": ".score",
110116
"ScoreConfig": ".score_config",
111117
"ScoreConfigDataType": ".score_config_data_type",
@@ -193,9 +199,12 @@ def __dir__():
193199
"ObservationsView",
194200
"ObservationsViewSingle",
195201
"PricingTier",
202+
"PricingTierAttributeCondition",
203+
"PricingTierAttributeSource",
196204
"PricingTierCondition",
197205
"PricingTierInput",
198206
"PricingTierOperator",
207+
"PricingTierUsageCondition",
199208
"Score",
200209
"ScoreConfig",
201210
"ScoreConfigDataType",

0 commit comments

Comments
 (0)