Skip to content

Commit c16eb0b

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse e84ca45 (#1562)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com>
1 parent 83d95bd commit c16eb0b

File tree

11 files changed

+442
-3
lines changed

11 files changed

+442
-3
lines changed

langfuse/api/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
BlobStorageIntegrationDeletionResponse,
5656
BlobStorageIntegrationFileType,
5757
BlobStorageIntegrationResponse,
58+
BlobStorageIntegrationStatusResponse,
5859
BlobStorageIntegrationType,
5960
BlobStorageIntegrationsResponse,
61+
BlobStorageSyncStatus,
6062
CreateBlobStorageIntegrationRequest,
6163
)
6264
from .client import AsyncLangfuseAPI, LangfuseAPI
@@ -309,8 +311,10 @@
309311
"BlobStorageIntegrationDeletionResponse": ".blob_storage_integrations",
310312
"BlobStorageIntegrationFileType": ".blob_storage_integrations",
311313
"BlobStorageIntegrationResponse": ".blob_storage_integrations",
314+
"BlobStorageIntegrationStatusResponse": ".blob_storage_integrations",
312315
"BlobStorageIntegrationType": ".blob_storage_integrations",
313316
"BlobStorageIntegrationsResponse": ".blob_storage_integrations",
317+
"BlobStorageSyncStatus": ".blob_storage_integrations",
314318
"BooleanScore": ".commons",
315319
"BooleanScoreV1": ".commons",
316320
"BulkConfig": ".scim",
@@ -594,8 +598,10 @@ def __dir__():
594598
"BlobStorageIntegrationDeletionResponse",
595599
"BlobStorageIntegrationFileType",
596600
"BlobStorageIntegrationResponse",
601+
"BlobStorageIntegrationStatusResponse",
597602
"BlobStorageIntegrationType",
598603
"BlobStorageIntegrationsResponse",
604+
"BlobStorageSyncStatus",
599605
"BooleanScore",
600606
"BooleanScoreV1",
601607
"BulkConfig",

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:

langfuse/api/blob_storage_integrations/raw_client.py

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
)
2323
from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType
2424
from .types.blob_storage_integration_response import BlobStorageIntegrationResponse
25+
from .types.blob_storage_integration_status_response import (
26+
BlobStorageIntegrationStatusResponse,
27+
)
2528
from .types.blob_storage_integration_type import BlobStorageIntegrationType
2629
from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse
2730

@@ -300,6 +303,106 @@ def upsert_blob_storage_integration(
300303
body=_response_json,
301304
)
302305

306+
def get_blob_storage_integration_status(
307+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
308+
) -> HttpResponse[BlobStorageIntegrationStatusResponse]:
309+
"""
310+
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
311+
312+
Parameters
313+
----------
314+
id : str
315+
316+
request_options : typing.Optional[RequestOptions]
317+
Request-specific configuration.
318+
319+
Returns
320+
-------
321+
HttpResponse[BlobStorageIntegrationStatusResponse]
322+
"""
323+
_response = self._client_wrapper.httpx_client.request(
324+
f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
325+
method="GET",
326+
request_options=request_options,
327+
)
328+
try:
329+
if 200 <= _response.status_code < 300:
330+
_data = typing.cast(
331+
BlobStorageIntegrationStatusResponse,
332+
parse_obj_as(
333+
type_=BlobStorageIntegrationStatusResponse, # type: ignore
334+
object_=_response.json(),
335+
),
336+
)
337+
return HttpResponse(response=_response, data=_data)
338+
if _response.status_code == 400:
339+
raise Error(
340+
headers=dict(_response.headers),
341+
body=typing.cast(
342+
typing.Any,
343+
parse_obj_as(
344+
type_=typing.Any, # type: ignore
345+
object_=_response.json(),
346+
),
347+
),
348+
)
349+
if _response.status_code == 401:
350+
raise UnauthorizedError(
351+
headers=dict(_response.headers),
352+
body=typing.cast(
353+
typing.Any,
354+
parse_obj_as(
355+
type_=typing.Any, # type: ignore
356+
object_=_response.json(),
357+
),
358+
),
359+
)
360+
if _response.status_code == 403:
361+
raise AccessDeniedError(
362+
headers=dict(_response.headers),
363+
body=typing.cast(
364+
typing.Any,
365+
parse_obj_as(
366+
type_=typing.Any, # type: ignore
367+
object_=_response.json(),
368+
),
369+
),
370+
)
371+
if _response.status_code == 405:
372+
raise MethodNotAllowedError(
373+
headers=dict(_response.headers),
374+
body=typing.cast(
375+
typing.Any,
376+
parse_obj_as(
377+
type_=typing.Any, # type: ignore
378+
object_=_response.json(),
379+
),
380+
),
381+
)
382+
if _response.status_code == 404:
383+
raise NotFoundError(
384+
headers=dict(_response.headers),
385+
body=typing.cast(
386+
typing.Any,
387+
parse_obj_as(
388+
type_=typing.Any, # type: ignore
389+
object_=_response.json(),
390+
),
391+
),
392+
)
393+
_response_json = _response.json()
394+
except JSONDecodeError:
395+
raise ApiError(
396+
status_code=_response.status_code,
397+
headers=dict(_response.headers),
398+
body=_response.text,
399+
)
400+
raise ApiError(
401+
status_code=_response.status_code,
402+
headers=dict(_response.headers),
403+
body=_response_json,
404+
)
405+
303406
def delete_blob_storage_integration(
304407
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
305408
) -> HttpResponse[BlobStorageIntegrationDeletionResponse]:
@@ -672,6 +775,106 @@ async def upsert_blob_storage_integration(
672775
body=_response_json,
673776
)
674777

778+
async def get_blob_storage_integration_status(
779+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
780+
) -> AsyncHttpResponse[BlobStorageIntegrationStatusResponse]:
781+
"""
782+
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
783+
784+
Parameters
785+
----------
786+
id : str
787+
788+
request_options : typing.Optional[RequestOptions]
789+
Request-specific configuration.
790+
791+
Returns
792+
-------
793+
AsyncHttpResponse[BlobStorageIntegrationStatusResponse]
794+
"""
795+
_response = await self._client_wrapper.httpx_client.request(
796+
f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
797+
method="GET",
798+
request_options=request_options,
799+
)
800+
try:
801+
if 200 <= _response.status_code < 300:
802+
_data = typing.cast(
803+
BlobStorageIntegrationStatusResponse,
804+
parse_obj_as(
805+
type_=BlobStorageIntegrationStatusResponse, # type: ignore
806+
object_=_response.json(),
807+
),
808+
)
809+
return AsyncHttpResponse(response=_response, data=_data)
810+
if _response.status_code == 400:
811+
raise Error(
812+
headers=dict(_response.headers),
813+
body=typing.cast(
814+
typing.Any,
815+
parse_obj_as(
816+
type_=typing.Any, # type: ignore
817+
object_=_response.json(),
818+
),
819+
),
820+
)
821+
if _response.status_code == 401:
822+
raise UnauthorizedError(
823+
headers=dict(_response.headers),
824+
body=typing.cast(
825+
typing.Any,
826+
parse_obj_as(
827+
type_=typing.Any, # type: ignore
828+
object_=_response.json(),
829+
),
830+
),
831+
)
832+
if _response.status_code == 403:
833+
raise AccessDeniedError(
834+
headers=dict(_response.headers),
835+
body=typing.cast(
836+
typing.Any,
837+
parse_obj_as(
838+
type_=typing.Any, # type: ignore
839+
object_=_response.json(),
840+
),
841+
),
842+
)
843+
if _response.status_code == 405:
844+
raise MethodNotAllowedError(
845+
headers=dict(_response.headers),
846+
body=typing.cast(
847+
typing.Any,
848+
parse_obj_as(
849+
type_=typing.Any, # type: ignore
850+
object_=_response.json(),
851+
),
852+
),
853+
)
854+
if _response.status_code == 404:
855+
raise NotFoundError(
856+
headers=dict(_response.headers),
857+
body=typing.cast(
858+
typing.Any,
859+
parse_obj_as(
860+
type_=typing.Any, # type: ignore
861+
object_=_response.json(),
862+
),
863+
),
864+
)
865+
_response_json = _response.json()
866+
except JSONDecodeError:
867+
raise ApiError(
868+
status_code=_response.status_code,
869+
headers=dict(_response.headers),
870+
body=_response.text,
871+
)
872+
raise ApiError(
873+
status_code=_response.status_code,
874+
headers=dict(_response.headers),
875+
body=_response_json,
876+
)
877+
675878
async def delete_blob_storage_integration(
676879
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
677880
) -> AsyncHttpResponse[BlobStorageIntegrationDeletionResponse]:

0 commit comments

Comments
 (0)