Skip to content
Merged
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
6 changes: 6 additions & 0 deletions langfuse/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
BlobStorageIntegrationDeletionResponse,
BlobStorageIntegrationFileType,
BlobStorageIntegrationResponse,
BlobStorageIntegrationStatusResponse,
BlobStorageIntegrationType,
BlobStorageIntegrationsResponse,
BlobStorageSyncStatus,
CreateBlobStorageIntegrationRequest,
)
from .client import AsyncLangfuseAPI, LangfuseAPI
Expand Down Expand Up @@ -309,8 +311,10 @@
"BlobStorageIntegrationDeletionResponse": ".blob_storage_integrations",
"BlobStorageIntegrationFileType": ".blob_storage_integrations",
"BlobStorageIntegrationResponse": ".blob_storage_integrations",
"BlobStorageIntegrationStatusResponse": ".blob_storage_integrations",
"BlobStorageIntegrationType": ".blob_storage_integrations",
"BlobStorageIntegrationsResponse": ".blob_storage_integrations",
"BlobStorageSyncStatus": ".blob_storage_integrations",
"BooleanScore": ".commons",
"BooleanScoreV1": ".commons",
"BulkConfig": ".scim",
Expand Down Expand Up @@ -594,8 +598,10 @@ def __dir__():
"BlobStorageIntegrationDeletionResponse",
"BlobStorageIntegrationFileType",
"BlobStorageIntegrationResponse",
"BlobStorageIntegrationStatusResponse",
"BlobStorageIntegrationType",
"BlobStorageIntegrationsResponse",
"BlobStorageSyncStatus",
"BooleanScore",
"BooleanScoreV1",
"BulkConfig",
Expand Down
6 changes: 6 additions & 0 deletions langfuse/api/blob_storage_integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
BlobStorageIntegrationDeletionResponse,
BlobStorageIntegrationFileType,
BlobStorageIntegrationResponse,
BlobStorageIntegrationStatusResponse,
BlobStorageIntegrationType,
BlobStorageIntegrationsResponse,
BlobStorageSyncStatus,
CreateBlobStorageIntegrationRequest,
)
_dynamic_imports: typing.Dict[str, str] = {
Expand All @@ -22,8 +24,10 @@
"BlobStorageIntegrationDeletionResponse": ".types",
"BlobStorageIntegrationFileType": ".types",
"BlobStorageIntegrationResponse": ".types",
"BlobStorageIntegrationStatusResponse": ".types",
"BlobStorageIntegrationType": ".types",
"BlobStorageIntegrationsResponse": ".types",
"BlobStorageSyncStatus": ".types",
"CreateBlobStorageIntegrationRequest": ".types",
}

Expand Down Expand Up @@ -61,7 +65,9 @@ def __dir__():
"BlobStorageIntegrationDeletionResponse",
"BlobStorageIntegrationFileType",
"BlobStorageIntegrationResponse",
"BlobStorageIntegrationStatusResponse",
"BlobStorageIntegrationType",
"BlobStorageIntegrationsResponse",
"BlobStorageSyncStatus",
"CreateBlobStorageIntegrationRequest",
]
87 changes: 87 additions & 0 deletions langfuse/api/blob_storage_integrations/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
)
from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType
from .types.blob_storage_integration_response import BlobStorageIntegrationResponse
from .types.blob_storage_integration_status_response import (
BlobStorageIntegrationStatusResponse,
)
from .types.blob_storage_integration_type import BlobStorageIntegrationType
from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse

Expand Down Expand Up @@ -192,6 +195,44 @@ def upsert_blob_storage_integration(
)
return _response.data

def get_blob_storage_integration_status(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BlobStorageIntegrationStatusResponse:
"""
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)

Parameters
----------
id : str

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
BlobStorageIntegrationStatusResponse

Examples
--------
from langfuse import LangfuseAPI

client = LangfuseAPI(
x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME",
x_langfuse_sdk_version="YOUR_X_LANGFUSE_SDK_VERSION",
x_langfuse_public_key="YOUR_X_LANGFUSE_PUBLIC_KEY",
username="YOUR_USERNAME",
password="YOUR_PASSWORD",
base_url="https://yourhost.com/path/to/api",
)
client.blob_storage_integrations.get_blob_storage_integration_status(
id="id",
)
"""
_response = self._raw_client.get_blob_storage_integration_status(
id, request_options=request_options
)
return _response.data

def delete_blob_storage_integration(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BlobStorageIntegrationDeletionResponse:
Expand Down Expand Up @@ -416,6 +457,52 @@ async def main() -> None:
)
return _response.data

async def get_blob_storage_integration_status(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BlobStorageIntegrationStatusResponse:
"""
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)

Parameters
----------
id : str

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
BlobStorageIntegrationStatusResponse

Examples
--------
import asyncio

from langfuse import AsyncLangfuseAPI

client = AsyncLangfuseAPI(
x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME",
x_langfuse_sdk_version="YOUR_X_LANGFUSE_SDK_VERSION",
x_langfuse_public_key="YOUR_X_LANGFUSE_PUBLIC_KEY",
username="YOUR_USERNAME",
password="YOUR_PASSWORD",
base_url="https://yourhost.com/path/to/api",
)


async def main() -> None:
await client.blob_storage_integrations.get_blob_storage_integration_status(
id="id",
)


asyncio.run(main())
"""
_response = await self._raw_client.get_blob_storage_integration_status(
id, request_options=request_options
)
return _response.data

async def delete_blob_storage_integration(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BlobStorageIntegrationDeletionResponse:
Expand Down
203 changes: 203 additions & 0 deletions langfuse/api/blob_storage_integrations/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
)
from .types.blob_storage_integration_file_type import BlobStorageIntegrationFileType
from .types.blob_storage_integration_response import BlobStorageIntegrationResponse
from .types.blob_storage_integration_status_response import (
BlobStorageIntegrationStatusResponse,
)
from .types.blob_storage_integration_type import BlobStorageIntegrationType
from .types.blob_storage_integrations_response import BlobStorageIntegrationsResponse

Expand Down Expand Up @@ -300,6 +303,106 @@ def upsert_blob_storage_integration(
body=_response_json,
)

def get_blob_storage_integration_status(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[BlobStorageIntegrationStatusResponse]:
"""
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)

Parameters
----------
id : str

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
HttpResponse[BlobStorageIntegrationStatusResponse]
"""
_response = self._client_wrapper.httpx_client.request(
f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BlobStorageIntegrationStatusResponse,
parse_obj_as(
type_=BlobStorageIntegrationStatusResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise Error(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 403:
raise AccessDeniedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 405:
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(
status_code=_response.status_code,
headers=dict(_response.headers),
body=_response.text,
)
raise ApiError(
status_code=_response.status_code,
headers=dict(_response.headers),
body=_response_json,
)

def delete_blob_storage_integration(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[BlobStorageIntegrationDeletionResponse]:
Expand Down Expand Up @@ -672,6 +775,106 @@ async def upsert_blob_storage_integration(
body=_response_json,
)

async def get_blob_storage_integration_status(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[BlobStorageIntegrationStatusResponse]:
"""
Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)

Parameters
----------
id : str

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
AsyncHttpResponse[BlobStorageIntegrationStatusResponse]
"""
_response = await self._client_wrapper.httpx_client.request(
f"api/public/integrations/blob-storage/{jsonable_encoder(id)}",
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BlobStorageIntegrationStatusResponse,
parse_obj_as(
type_=BlobStorageIntegrationStatusResponse, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise Error(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 403:
raise AccessDeniedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 405:
raise MethodNotAllowedError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Any,
parse_obj_as(
type_=typing.Any, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(
status_code=_response.status_code,
headers=dict(_response.headers),
body=_response.text,
)
raise ApiError(
status_code=_response.status_code,
headers=dict(_response.headers),
body=_response_json,
)

async def delete_blob_storage_integration(
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[BlobStorageIntegrationDeletionResponse]:
Expand Down
Loading
Loading