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
3 changes: 3 additions & 0 deletions langfuse/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
BlobStorageExportSource,
BlobStorageIntegrationDeletionResponse,
BlobStorageIntegrationFileType,
BlobStorageIntegrationFileTypeResponse,
BlobStorageIntegrationResponse,
BlobStorageIntegrationStatusResponse,
BlobStorageIntegrationType,
Expand Down Expand Up @@ -352,6 +353,7 @@
"BlobStorageExportSource": ".blob_storage_integrations",
"BlobStorageIntegrationDeletionResponse": ".blob_storage_integrations",
"BlobStorageIntegrationFileType": ".blob_storage_integrations",
"BlobStorageIntegrationFileTypeResponse": ".blob_storage_integrations",
"BlobStorageIntegrationResponse": ".blob_storage_integrations",
"BlobStorageIntegrationStatusResponse": ".blob_storage_integrations",
"BlobStorageIntegrationType": ".blob_storage_integrations",
Expand Down Expand Up @@ -676,6 +678,7 @@ def __dir__():
"BlobStorageExportSource",
"BlobStorageIntegrationDeletionResponse",
"BlobStorageIntegrationFileType",
"BlobStorageIntegrationFileTypeResponse",
"BlobStorageIntegrationResponse",
"BlobStorageIntegrationStatusResponse",
"BlobStorageIntegrationType",
Expand Down
3 changes: 3 additions & 0 deletions langfuse/api/blob_storage_integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BlobStorageExportSource,
BlobStorageIntegrationDeletionResponse,
BlobStorageIntegrationFileType,
BlobStorageIntegrationFileTypeResponse,
BlobStorageIntegrationResponse,
BlobStorageIntegrationStatusResponse,
BlobStorageIntegrationType,
Expand All @@ -27,6 +28,7 @@
"BlobStorageExportSource": ".types",
"BlobStorageIntegrationDeletionResponse": ".types",
"BlobStorageIntegrationFileType": ".types",
"BlobStorageIntegrationFileTypeResponse": ".types",
"BlobStorageIntegrationResponse": ".types",
"BlobStorageIntegrationStatusResponse": ".types",
"BlobStorageIntegrationType": ".types",
Expand Down Expand Up @@ -70,6 +72,7 @@ def __dir__():
"BlobStorageExportSource",
"BlobStorageIntegrationDeletionResponse",
"BlobStorageIntegrationFileType",
"BlobStorageIntegrationFileTypeResponse",
"BlobStorageIntegrationResponse",
"BlobStorageIntegrationStatusResponse",
"BlobStorageIntegrationType",
Expand Down
4 changes: 2 additions & 2 deletions langfuse/api/blob_storage_integrations/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def upsert_blob_storage_integration(
Path prefix for exported files (must end with forward slash if provided)

export_start_date : typing.Optional[dt.datetime]
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).

compressed : typing.Optional[bool]
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
Expand Down Expand Up @@ -421,7 +421,7 @@ async def upsert_blob_storage_integration(
Path prefix for exported files (must end with forward slash if provided)

export_start_date : typing.Optional[dt.datetime]
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).

compressed : typing.Optional[bool]
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
Expand Down
4 changes: 2 additions & 2 deletions langfuse/api/blob_storage_integrations/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def upsert_blob_storage_integration(
Path prefix for exported files (must end with forward slash if provided)

export_start_date : typing.Optional[dt.datetime]
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).

compressed : typing.Optional[bool]
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
Expand Down Expand Up @@ -696,7 +696,7 @@ async def upsert_blob_storage_integration(
Path prefix for exported files (must end with forward slash if provided)

export_start_date : typing.Optional[dt.datetime]
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).

compressed : typing.Optional[bool]
Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true.
Expand Down
5 changes: 5 additions & 0 deletions langfuse/api/blob_storage_integrations/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
BlobStorageIntegrationDeletionResponse,
)
from .blob_storage_integration_file_type import BlobStorageIntegrationFileType
from .blob_storage_integration_file_type_response import (
BlobStorageIntegrationFileTypeResponse,
)
from .blob_storage_integration_response import BlobStorageIntegrationResponse
from .blob_storage_integration_status_response import (
BlobStorageIntegrationStatusResponse,
Expand All @@ -31,6 +34,7 @@
"BlobStorageExportSource": ".blob_storage_export_source",
"BlobStorageIntegrationDeletionResponse": ".blob_storage_integration_deletion_response",
"BlobStorageIntegrationFileType": ".blob_storage_integration_file_type",
"BlobStorageIntegrationFileTypeResponse": ".blob_storage_integration_file_type_response",
"BlobStorageIntegrationResponse": ".blob_storage_integration_response",
"BlobStorageIntegrationStatusResponse": ".blob_storage_integration_status_response",
"BlobStorageIntegrationType": ".blob_storage_integration_type",
Expand Down Expand Up @@ -74,6 +78,7 @@ def __dir__():
"BlobStorageExportSource",
"BlobStorageIntegrationDeletionResponse",
"BlobStorageIntegrationFileType",
"BlobStorageIntegrationFileTypeResponse",
"BlobStorageIntegrationResponse",
"BlobStorageIntegrationStatusResponse",
"BlobStorageIntegrationType",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ...core import enum

T_Result = typing.TypeVar("T_Result")


class BlobStorageIntegrationFileTypeResponse(enum.StrEnum):
"""
File type reported for an existing integration. Includes `PARQUET`, which a project may enable through the Langfuse UI but cannot yet be set via this API (the request `fileType` omits it).
"""

JSON = "JSON"
CSV = "CSV"
JSONL = "JSONL"
PARQUET = "PARQUET"

def visit(
self,
json: typing.Callable[[], T_Result],
csv: typing.Callable[[], T_Result],
jsonl: typing.Callable[[], T_Result],
parquet: typing.Callable[[], T_Result],
) -> T_Result:
if self is BlobStorageIntegrationFileTypeResponse.JSON:
return json()
if self is BlobStorageIntegrationFileTypeResponse.CSV:
return csv()
if self is BlobStorageIntegrationFileTypeResponse.JSONL:
return jsonl()
if self is BlobStorageIntegrationFileTypeResponse.PARQUET:
return parquet()
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from .blob_storage_export_frequency import BlobStorageExportFrequency
from .blob_storage_export_mode import BlobStorageExportMode
from .blob_storage_export_source import BlobStorageExportSource
from .blob_storage_integration_file_type import BlobStorageIntegrationFileType
from .blob_storage_integration_file_type_response import (
BlobStorageIntegrationFileTypeResponse,
)
from .blob_storage_integration_type import BlobStorageIntegrationType


Expand All @@ -34,7 +36,7 @@ class BlobStorageIntegrationResponse(UniversalBaseModel):
bool, FieldMetadata(alias="forcePathStyle")
]
file_type: typing_extensions.Annotated[
BlobStorageIntegrationFileType, FieldMetadata(alias="fileType")
BlobStorageIntegrationFileTypeResponse, FieldMetadata(alias="fileType")
]
export_mode: typing_extensions.Annotated[
BlobStorageExportMode, FieldMetadata(alias="exportMode")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ class BlobStorageSyncStatus(enum.StrEnum):
Sync status of the blob storage integration:
- `disabled` — integration is not enabled
- `error` — last export failed (see `lastError` for details)
- `idle` — enabled but has never exported yet
- `running` — an export job is currently being processed
- `queued` — next export is overdue (`nextSyncAt` is in the past) and waiting to be picked up by the worker
- `idle` — enabled but has never exported yet and no export is queued
- `up_to_date` — all available data has been exported; next export is scheduled for the future

**ETL usage**: poll this endpoint and check for `up_to_date` status. Compare `lastSyncAt` against your
Expand All @@ -22,6 +23,7 @@ class BlobStorageSyncStatus(enum.StrEnum):
"""

IDLE = "idle"
RUNNING = "running"
QUEUED = "queued"
UP_TO_DATE = "up_to_date"
DISABLED = "disabled"
Expand All @@ -30,13 +32,16 @@ class BlobStorageSyncStatus(enum.StrEnum):
def visit(
self,
idle: typing.Callable[[], T_Result],
running: typing.Callable[[], T_Result],
queued: typing.Callable[[], T_Result],
up_to_date: typing.Callable[[], T_Result],
disabled: typing.Callable[[], T_Result],
error: typing.Callable[[], T_Result],
) -> T_Result:
if self is BlobStorageSyncStatus.IDLE:
return idle()
if self is BlobStorageSyncStatus.RUNNING:
return running()
if self is BlobStorageSyncStatus.QUEUED:
return queued()
if self is BlobStorageSyncStatus.UP_TO_DATE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class CreateBlobStorageIntegrationRequest(UniversalBaseModel):
typing.Optional[dt.datetime], FieldMetadata(alias="exportStartDate")
] = pydantic.Field(default=None)
"""
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE). Must not be in the future (27 h tolerance for timezone differences).
"""

compressed: typing.Optional[bool] = pydantic.Field(default=None)
Expand Down
39 changes: 38 additions & 1 deletion langfuse/api/unstable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
UnauthorizedError,
UnprocessableContentError,
)
from . import commons, errors, evaluation_rules, evaluators
from . import commons, dashboard_widgets, errors, evaluation_rules, evaluators
from .commons import (
ArrayOptionsEvaluationRuleFilter,
BooleanEvaluationRuleFilter,
Expand Down Expand Up @@ -73,6 +73,19 @@
StringObjectEvaluationRuleFilter,
StringOptionsEvaluationRuleFilter,
)
from .dashboard_widgets import (
CreateDashboardWidgetRequest,
DashboardWidget,
DashboardWidgetChartConfig,
DashboardWidgetChartType,
DashboardWidgetDefaultSort,
DashboardWidgetDimension,
DashboardWidgetFilter,
DashboardWidgetMetric,
DashboardWidgetMetricAggregation,
DashboardWidgetSortOrder,
DashboardWidgetView,
)
from .evaluation_rules import (
CodeEvaluationRuleEvaluatorReference,
CreateCodeEvaluationRuleRequest,
Expand Down Expand Up @@ -114,12 +127,23 @@
"ConflictError": ".errors",
"CreateCodeEvaluationRuleRequest": ".evaluation_rules",
"CreateCodeEvaluatorRequest": ".evaluators",
"CreateDashboardWidgetRequest": ".dashboard_widgets",
"CreateEvaluationRuleRequest": ".evaluation_rules",
"CreateEvaluatorRequest": ".evaluators",
"CreateEvaluatorRequest_Code": ".evaluators",
"CreateEvaluatorRequest_LlmAsJudge": ".evaluators",
"CreateLlmAsJudgeEvaluationRuleRequest": ".evaluation_rules",
"CreateLlmAsJudgeEvaluatorRequest": ".evaluators",
"DashboardWidget": ".dashboard_widgets",
"DashboardWidgetChartConfig": ".dashboard_widgets",
"DashboardWidgetChartType": ".dashboard_widgets",
"DashboardWidgetDefaultSort": ".dashboard_widgets",
"DashboardWidgetDimension": ".dashboard_widgets",
"DashboardWidgetFilter": ".dashboard_widgets",
"DashboardWidgetMetric": ".dashboard_widgets",
"DashboardWidgetMetricAggregation": ".dashboard_widgets",
"DashboardWidgetSortOrder": ".dashboard_widgets",
"DashboardWidgetView": ".dashboard_widgets",
"DateTimeEvaluationRuleFilter": ".commons",
"DeleteEvaluationRuleResponse": ".evaluation_rules",
"DeleteEvaluatorResponse": ".evaluators",
Expand Down Expand Up @@ -191,6 +215,7 @@
"UnprocessableContentError": ".errors",
"UpdateEvaluationRuleRequest": ".evaluation_rules",
"commons": ".commons",
"dashboard_widgets": ".dashboard_widgets",
"errors": ".errors",
"evaluation_rules": ".evaluation_rules",
"evaluators": ".evaluators",
Expand Down Expand Up @@ -236,12 +261,23 @@ def __dir__():
"ConflictError",
"CreateCodeEvaluationRuleRequest",
"CreateCodeEvaluatorRequest",
"CreateDashboardWidgetRequest",
"CreateEvaluationRuleRequest",
"CreateEvaluatorRequest",
"CreateEvaluatorRequest_Code",
"CreateEvaluatorRequest_LlmAsJudge",
"CreateLlmAsJudgeEvaluationRuleRequest",
"CreateLlmAsJudgeEvaluatorRequest",
"DashboardWidget",
"DashboardWidgetChartConfig",
"DashboardWidgetChartType",
"DashboardWidgetDefaultSort",
"DashboardWidgetDimension",
"DashboardWidgetFilter",
"DashboardWidgetMetric",
"DashboardWidgetMetricAggregation",
"DashboardWidgetSortOrder",
"DashboardWidgetView",
"DateTimeEvaluationRuleFilter",
"DeleteEvaluationRuleResponse",
"DeleteEvaluatorResponse",
Expand Down Expand Up @@ -313,6 +349,7 @@ def __dir__():
"UnprocessableContentError",
"UpdateEvaluationRuleRequest",
"commons",
"dashboard_widgets",
"errors",
"evaluation_rules",
"evaluators",
Expand Down
26 changes: 26 additions & 0 deletions langfuse/api/unstable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from .raw_client import AsyncRawUnstableClient, RawUnstableClient

if typing.TYPE_CHECKING:
from .dashboard_widgets.client import (
AsyncDashboardWidgetsClient,
DashboardWidgetsClient,
)
from .evaluation_rules.client import (
AsyncEvaluationRulesClient,
EvaluationRulesClient,
Expand All @@ -19,6 +23,7 @@ class UnstableClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._raw_client = RawUnstableClient(client_wrapper=client_wrapper)
self._client_wrapper = client_wrapper
self._dashboard_widgets: typing.Optional[DashboardWidgetsClient] = None
self._evaluation_rules: typing.Optional[EvaluationRulesClient] = None
self._evaluators: typing.Optional[EvaluatorsClient] = None

Expand All @@ -33,6 +38,16 @@ def with_raw_response(self) -> RawUnstableClient:
"""
return self._raw_client

@property
def dashboard_widgets(self):
if self._dashboard_widgets is None:
from .dashboard_widgets.client import DashboardWidgetsClient # noqa: E402

self._dashboard_widgets = DashboardWidgetsClient(
client_wrapper=self._client_wrapper
)
return self._dashboard_widgets

@property
def evaluation_rules(self):
if self._evaluation_rules is None:
Expand All @@ -56,6 +71,7 @@ class AsyncUnstableClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._raw_client = AsyncRawUnstableClient(client_wrapper=client_wrapper)
self._client_wrapper = client_wrapper
self._dashboard_widgets: typing.Optional[AsyncDashboardWidgetsClient] = None
self._evaluation_rules: typing.Optional[AsyncEvaluationRulesClient] = None
self._evaluators: typing.Optional[AsyncEvaluatorsClient] = None

Expand All @@ -70,6 +86,16 @@ def with_raw_response(self) -> AsyncRawUnstableClient:
"""
return self._raw_client

@property
def dashboard_widgets(self):
if self._dashboard_widgets is None:
from .dashboard_widgets.client import AsyncDashboardWidgetsClient # noqa: E402

self._dashboard_widgets = AsyncDashboardWidgetsClient(
client_wrapper=self._client_wrapper
)
return self._dashboard_widgets

@property
def evaluation_rules(self):
if self._evaluation_rules is None:
Expand Down
Loading
Loading