Skip to content

Commit 9f5b8c8

Browse files
authored
Merge branch 'main' into hassieb/lfe-8749-bug-custom-httpx_client-is-not-applied-to-clientasync_api-in
2 parents f47f6fb + caddeff commit 9f5b8c8

64 files changed

Lines changed: 2612 additions & 2050 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ jobs:
126126
LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT=http://localhost:9090 \
127127
LANGFUSE_INGESTION_QUEUE_DELAY_MS=10 \
128128
LANGFUSE_INGESTION_CLICKHOUSE_WRITE_INTERVAL_MS=10 \
129+
LANGFUSE_EXPERIMENT_INSERT_INTO_EVENTS_TABLE=true \
130+
QUEUE_CONSUMER_EVENT_PROPAGATION_QUEUE_IS_ENABLED=true \
131+
LANGFUSE_ENABLE_EVENTS_TABLE_V2_APIS=true \
132+
LANGFUSE_ENABLE_EVENTS_TABLE_OBSERVATIONS=true \
129133
docker compose up -d
130134
131135
echo "::endgroup::"

langfuse/api/__init__.py

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@
1616
datasets,
1717
health,
1818
ingestion,
19+
legacy,
1920
llm_connections,
2021
media,
2122
metrics,
22-
metrics_v2,
2323
models,
2424
observations,
25-
observations_v2,
2625
opentelemetry,
2726
organizations,
2827
projects,
2928
prompt_version,
3029
prompts,
3130
scim,
32-
score,
3331
score_configs,
34-
score_v2,
32+
scores,
3533
sessions,
3634
trace,
3735
utils,
@@ -57,8 +55,10 @@
5755
BlobStorageIntegrationDeletionResponse,
5856
BlobStorageIntegrationFileType,
5957
BlobStorageIntegrationResponse,
58+
BlobStorageIntegrationStatusResponse,
6059
BlobStorageIntegrationType,
6160
BlobStorageIntegrationsResponse,
61+
BlobStorageSyncStatus,
6262
CreateBlobStorageIntegrationRequest,
6363
)
6464
from .client import AsyncLangfuseAPI, LangfuseAPI
@@ -194,11 +194,9 @@
194194
MediaContentType,
195195
PatchMediaBody,
196196
)
197-
from .metrics import MetricsResponse
198-
from .metrics_v2 import MetricsV2Response
197+
from .metrics import MetricsV2Response
199198
from .models import CreateModelRequest, PaginatedModels
200-
from .observations import Observations, ObservationsViews
201-
from .observations_v2 import ObservationsV2Meta, ObservationsV2Response
199+
from .observations import ObservationsV2Meta, ObservationsV2Response
202200
from .opentelemetry import (
203201
OtelAttribute,
204202
OtelAttributeValue,
@@ -271,13 +269,12 @@
271269
ServiceProviderConfig,
272270
UserMeta,
273271
)
274-
from .score import CreateScoreRequest, CreateScoreResponse
275272
from .score_configs import (
276273
CreateScoreConfigRequest,
277274
ScoreConfigs,
278275
UpdateScoreConfigRequest,
279276
)
280-
from .score_v2 import (
277+
from .scores import (
281278
GetScoresResponse,
282279
GetScoresResponseData,
283280
GetScoresResponseDataBoolean,
@@ -314,8 +311,10 @@
314311
"BlobStorageIntegrationDeletionResponse": ".blob_storage_integrations",
315312
"BlobStorageIntegrationFileType": ".blob_storage_integrations",
316313
"BlobStorageIntegrationResponse": ".blob_storage_integrations",
314+
"BlobStorageIntegrationStatusResponse": ".blob_storage_integrations",
317315
"BlobStorageIntegrationType": ".blob_storage_integrations",
318316
"BlobStorageIntegrationsResponse": ".blob_storage_integrations",
317+
"BlobStorageSyncStatus": ".blob_storage_integrations",
319318
"BooleanScore": ".commons",
320319
"BooleanScoreV1": ".commons",
321320
"BulkConfig": ".scim",
@@ -348,8 +347,6 @@
348347
"CreateObservationEvent": ".ingestion",
349348
"CreatePromptRequest": ".prompts",
350349
"CreateScoreConfigRequest": ".score_configs",
351-
"CreateScoreRequest": ".score",
352-
"CreateScoreResponse": ".score",
353350
"CreateScoreValue": ".commons",
354351
"CreateSpanBody": ".ingestion",
355352
"CreateSpanEvent": ".ingestion",
@@ -374,17 +371,17 @@
374371
"GetMediaResponse": ".media",
375372
"GetMediaUploadUrlRequest": ".media",
376373
"GetMediaUploadUrlResponse": ".media",
377-
"GetScoresResponse": ".score_v2",
378-
"GetScoresResponseData": ".score_v2",
379-
"GetScoresResponseDataBoolean": ".score_v2",
380-
"GetScoresResponseDataCategorical": ".score_v2",
381-
"GetScoresResponseDataCorrection": ".score_v2",
382-
"GetScoresResponseDataNumeric": ".score_v2",
383-
"GetScoresResponseData_Boolean": ".score_v2",
384-
"GetScoresResponseData_Categorical": ".score_v2",
385-
"GetScoresResponseData_Correction": ".score_v2",
386-
"GetScoresResponseData_Numeric": ".score_v2",
387-
"GetScoresResponseTraceData": ".score_v2",
374+
"GetScoresResponse": ".scores",
375+
"GetScoresResponseData": ".scores",
376+
"GetScoresResponseDataBoolean": ".scores",
377+
"GetScoresResponseDataCategorical": ".scores",
378+
"GetScoresResponseDataCorrection": ".scores",
379+
"GetScoresResponseDataNumeric": ".scores",
380+
"GetScoresResponseData_Boolean": ".scores",
381+
"GetScoresResponseData_Categorical": ".scores",
382+
"GetScoresResponseData_Correction": ".scores",
383+
"GetScoresResponseData_Numeric": ".scores",
384+
"GetScoresResponseTraceData": ".scores",
388385
"HealthResponse": ".health",
389386
"IngestionError": ".ingestion",
390387
"IngestionEvent": ".ingestion",
@@ -412,8 +409,7 @@
412409
"MembershipRole": ".organizations",
413410
"MembershipsResponse": ".organizations",
414411
"MethodNotAllowedError": ".commons",
415-
"MetricsResponse": ".metrics",
416-
"MetricsV2Response": ".metrics_v2",
412+
"MetricsV2Response": ".metrics",
417413
"Model": ".commons",
418414
"ModelPrice": ".commons",
419415
"ModelUsageUnit": ".commons",
@@ -425,11 +421,9 @@
425421
"ObservationLevel": ".commons",
426422
"ObservationType": ".ingestion",
427423
"ObservationV2": ".commons",
428-
"Observations": ".observations",
429-
"ObservationsV2Meta": ".observations_v2",
430-
"ObservationsV2Response": ".observations_v2",
424+
"ObservationsV2Meta": ".observations",
425+
"ObservationsV2Response": ".observations",
431426
"ObservationsView": ".commons",
432-
"ObservationsViews": ".observations",
433427
"OpenAiCompletionUsageSchema": ".ingestion",
434428
"OpenAiResponseUsageSchema": ".ingestion",
435429
"OpenAiUsage": ".ingestion",
@@ -535,22 +529,20 @@
535529
"datasets": ".datasets",
536530
"health": ".health",
537531
"ingestion": ".ingestion",
532+
"legacy": ".legacy",
538533
"llm_connections": ".llm_connections",
539534
"media": ".media",
540535
"metrics": ".metrics",
541-
"metrics_v2": ".metrics_v2",
542536
"models": ".models",
543537
"observations": ".observations",
544-
"observations_v2": ".observations_v2",
545538
"opentelemetry": ".opentelemetry",
546539
"organizations": ".organizations",
547540
"projects": ".projects",
548541
"prompt_version": ".prompt_version",
549542
"prompts": ".prompts",
550543
"scim": ".scim",
551-
"score": ".score",
552544
"score_configs": ".score_configs",
553-
"score_v2": ".score_v2",
545+
"scores": ".scores",
554546
"sessions": ".sessions",
555547
"trace": ".trace",
556548
"utils": ".utils",
@@ -606,8 +598,10 @@ def __dir__():
606598
"BlobStorageIntegrationDeletionResponse",
607599
"BlobStorageIntegrationFileType",
608600
"BlobStorageIntegrationResponse",
601+
"BlobStorageIntegrationStatusResponse",
609602
"BlobStorageIntegrationType",
610603
"BlobStorageIntegrationsResponse",
604+
"BlobStorageSyncStatus",
611605
"BooleanScore",
612606
"BooleanScoreV1",
613607
"BulkConfig",
@@ -640,8 +634,6 @@ def __dir__():
640634
"CreateObservationEvent",
641635
"CreatePromptRequest",
642636
"CreateScoreConfigRequest",
643-
"CreateScoreRequest",
644-
"CreateScoreResponse",
645637
"CreateScoreValue",
646638
"CreateSpanBody",
647639
"CreateSpanEvent",
@@ -704,7 +696,6 @@ def __dir__():
704696
"MembershipRole",
705697
"MembershipsResponse",
706698
"MethodNotAllowedError",
707-
"MetricsResponse",
708699
"MetricsV2Response",
709700
"Model",
710701
"ModelPrice",
@@ -717,11 +708,9 @@ def __dir__():
717708
"ObservationLevel",
718709
"ObservationType",
719710
"ObservationV2",
720-
"Observations",
721711
"ObservationsV2Meta",
722712
"ObservationsV2Response",
723713
"ObservationsView",
724-
"ObservationsViews",
725714
"OpenAiCompletionUsageSchema",
726715
"OpenAiResponseUsageSchema",
727716
"OpenAiUsage",
@@ -827,22 +816,20 @@ def __dir__():
827816
"datasets",
828817
"health",
829818
"ingestion",
819+
"legacy",
830820
"llm_connections",
831821
"media",
832822
"metrics",
833-
"metrics_v2",
834823
"models",
835824
"observations",
836-
"observations_v2",
837825
"opentelemetry",
838826
"organizations",
839827
"projects",
840828
"prompt_version",
841829
"prompts",
842830
"scim",
843-
"score",
844831
"score_configs",
845-
"score_v2",
832+
"scores",
846833
"sessions",
847834
"trace",
848835
"utils",

langfuse/api/blob_storage_integrations/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
BlobStorageIntegrationDeletionResponse,
1313
BlobStorageIntegrationFileType,
1414
BlobStorageIntegrationResponse,
15+
BlobStorageIntegrationStatusResponse,
1516
BlobStorageIntegrationType,
1617
BlobStorageIntegrationsResponse,
18+
BlobStorageSyncStatus,
1719
CreateBlobStorageIntegrationRequest,
1820
)
1921
_dynamic_imports: typing.Dict[str, str] = {
@@ -22,8 +24,10 @@
2224
"BlobStorageIntegrationDeletionResponse": ".types",
2325
"BlobStorageIntegrationFileType": ".types",
2426
"BlobStorageIntegrationResponse": ".types",
27+
"BlobStorageIntegrationStatusResponse": ".types",
2528
"BlobStorageIntegrationType": ".types",
2629
"BlobStorageIntegrationsResponse": ".types",
30+
"BlobStorageSyncStatus": ".types",
2731
"CreateBlobStorageIntegrationRequest": ".types",
2832
}
2933

@@ -61,7 +65,9 @@ def __dir__():
6165
"BlobStorageIntegrationDeletionResponse",
6266
"BlobStorageIntegrationFileType",
6367
"BlobStorageIntegrationResponse",
68+
"BlobStorageIntegrationStatusResponse",
6469
"BlobStorageIntegrationType",
6570
"BlobStorageIntegrationsResponse",
71+
"BlobStorageSyncStatus",
6672
"CreateBlobStorageIntegrationRequest",
6773
]

langfuse/api/blob_storage_integrations/client.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
)
1717
from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType
1818
from .types.blob_storage_integration_response import BlobStorageIntegrationResponse
19+
from .types.blob_storage_integration_status_response import (
20+
BlobStorageIntegrationStatusResponse,
21+
)
1922
from .types.blob_storage_integration_type import BlobStorageIntegrationType
2023
from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse
2124

@@ -192,6 +195,44 @@ def upsert_blob_storage_integration(
192195
)
193196
return _response.data
194197

198+
def get_blob_storage_integration_status(
199+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
200+
) -> BlobStorageIntegrationStatusResponse:
201+
"""
202+
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
203+
204+
Parameters
205+
----------
206+
id : str
207+
208+
request_options : typing.Optional[RequestOptions]
209+
Request-specific configuration.
210+
211+
Returns
212+
-------
213+
BlobStorageIntegrationStatusResponse
214+
215+
Examples
216+
--------
217+
from langfuse import LangfuseAPI
218+
219+
client = LangfuseAPI(
220+
x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME",
221+
x_langfuse_sdk_version="YOUR_X_LANGFUSE_SDK_VERSION",
222+
x_langfuse_public_key="YOUR_X_LANGFUSE_PUBLIC_KEY",
223+
username="YOUR_USERNAME",
224+
password="YOUR_PASSWORD",
225+
base_url="https://yourhost.com/path/to/api",
226+
)
227+
client.blob_storage_integrations.get_blob_storage_integration_status(
228+
id="id",
229+
)
230+
"""
231+
_response = self._raw_client.get_blob_storage_integration_status(
232+
id, request_options=request_options
233+
)
234+
return _response.data
235+
195236
def delete_blob_storage_integration(
196237
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
197238
) -> BlobStorageIntegrationDeletionResponse:
@@ -416,6 +457,52 @@ async def main() -> None:
416457
)
417458
return _response.data
418459

460+
async def get_blob_storage_integration_status(
461+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
462+
) -> BlobStorageIntegrationStatusResponse:
463+
"""
464+
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
465+
466+
Parameters
467+
----------
468+
id : str
469+
470+
request_options : typing.Optional[RequestOptions]
471+
Request-specific configuration.
472+
473+
Returns
474+
-------
475+
BlobStorageIntegrationStatusResponse
476+
477+
Examples
478+
--------
479+
import asyncio
480+
481+
from langfuse import AsyncLangfuseAPI
482+
483+
client = AsyncLangfuseAPI(
484+
x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME",
485+
x_langfuse_sdk_version="YOUR_X_LANGFUSE_SDK_VERSION",
486+
x_langfuse_public_key="YOUR_X_LANGFUSE_PUBLIC_KEY",
487+
username="YOUR_USERNAME",
488+
password="YOUR_PASSWORD",
489+
base_url="https://yourhost.com/path/to/api",
490+
)
491+
492+
493+
async def main() -> None:
494+
await client.blob_storage_integrations.get_blob_storage_integration_status(
495+
id="id",
496+
)
497+
498+
499+
asyncio.run(main())
500+
"""
501+
_response = await self._raw_client.get_blob_storage_integration_status(
502+
id, request_options=request_options
503+
)
504+
return _response.data
505+
419506
async def delete_blob_storage_integration(
420507
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
421508
) -> BlobStorageIntegrationDeletionResponse:

0 commit comments

Comments
 (0)