-
Notifications
You must be signed in to change notification settings - Fork 223
feat(api): update API spec from langfuse/langfuse d7069df433ba218bff7cea0739edbfa01ffe3413 #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): update API spec from langfuse/langfuse d7069df433ba218bff7cea0739edbfa01ffe3413 #1353
Conversation
…cea0739edbfa01ffe3413
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
26 files reviewed, 4 comments
| if self is BlobStorageExportMode.FULL_HISTORY: | ||
| return full_history() | ||
| if self is BlobStorageExportMode.FROM_TODAY: | ||
| return from_today() | ||
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | ||
| return from_custom_date() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing fallback case in visit method - if a new enum value is added, this method will implicitly return None instead of raising an error
| if self is BlobStorageExportMode.FULL_HISTORY: | |
| return full_history() | |
| if self is BlobStorageExportMode.FROM_TODAY: | |
| return from_today() | |
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | |
| return from_custom_date() | |
| if self is BlobStorageExportMode.FULL_HISTORY: | |
| return full_history() | |
| if self is BlobStorageExportMode.FROM_TODAY: | |
| return from_today() | |
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | |
| return from_custom_date() | |
| raise ValueError(f"Unknown BlobStorageExportMode: {self}") |
| def visit( | ||
| self, | ||
| hourly: typing.Callable[[], T_Result], | ||
| daily: typing.Callable[[], T_Result], | ||
| weekly: typing.Callable[[], T_Result], | ||
| ) -> T_Result: | ||
| if self is BlobStorageExportFrequency.HOURLY: | ||
| return hourly() | ||
| if self is BlobStorageExportFrequency.DAILY: | ||
| return daily() | ||
| if self is BlobStorageExportFrequency.WEEKLY: | ||
| return weekly() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The visit method doesn't handle the case where self doesn't match any of the defined enum values. This could return None implicitly, violating the T_Result return type annotation. Consider adding a final else clause that raises an exception.
| def visit( | |
| self, | |
| hourly: typing.Callable[[], T_Result], | |
| daily: typing.Callable[[], T_Result], | |
| weekly: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageExportFrequency.HOURLY: | |
| return hourly() | |
| if self is BlobStorageExportFrequency.DAILY: | |
| return daily() | |
| if self is BlobStorageExportFrequency.WEEKLY: | |
| return weekly() | |
| def visit( | |
| self, | |
| hourly: typing.Callable[[], T_Result], | |
| daily: typing.Callable[[], T_Result], | |
| weekly: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageExportFrequency.HOURLY: | |
| return hourly() | |
| if self is BlobStorageExportFrequency.DAILY: | |
| return daily() | |
| if self is BlobStorageExportFrequency.WEEKLY: | |
| return weekly() | |
| raise ValueError(f"Unknown enum value: {self}") |
| def visit( | ||
| self, | ||
| s_3: typing.Callable[[], T_Result], | ||
| s_3_compatible: typing.Callable[[], T_Result], | ||
| azure_blob_storage: typing.Callable[[], T_Result], | ||
| ) -> T_Result: | ||
| if self is BlobStorageIntegrationType.S_3: | ||
| return s_3() | ||
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | ||
| return s_3_compatible() | ||
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | ||
| return azure_blob_storage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing return statement or exception handling for unmatched enum values. If an invalid enum value exists, this method will implicitly return None instead of T_Result, violating the type contract.
| def visit( | |
| self, | |
| s_3: typing.Callable[[], T_Result], | |
| s_3_compatible: typing.Callable[[], T_Result], | |
| azure_blob_storage: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationType.S_3: | |
| return s_3() | |
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | |
| return s_3_compatible() | |
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | |
| return azure_blob_storage() | |
| def visit( | |
| self, | |
| s_3: typing.Callable[[], T_Result], | |
| s_3_compatible: typing.Callable[[], T_Result], | |
| azure_blob_storage: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationType.S_3: | |
| return s_3() | |
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | |
| return s_3_compatible() | |
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | |
| return azure_blob_storage() | |
| raise ValueError(f"Unknown BlobStorageIntegrationType: {self}") |
| from langfuse.core.http_client import get_request_body | ||
| from langfuse.core.request_options import RequestOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: These import paths appear to reference non-existent modules. The repository structure shows 'langfuse/api/core/' but not 'langfuse/core/'. This will cause ImportError at runtime.
| from langfuse.core.http_client import get_request_body | |
| from langfuse.core.request_options import RequestOptions | |
| from langfuse.api.core.http_client import get_request_body | |
| from langfuse.api.core.request_options import RequestOptions |
Important
Add blob storage integration management and membership management functionalities to the API client.
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClientinclient.pyto manage blob storage integrations.get_blob_storage_integrations,upsert_blob_storage_integration, anddelete_blob_storage_integration.types/.OrganizationsClientandAsyncOrganizationsClientinclient.pyfor managing memberships.delete_organization_membershipanddelete_project_membershipmethods.types/.reference.md.test_http_client.pyandtest_query_encoding.py.This description was created by
for 2da60ed. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Updated On: 2025-09-17 16:22:30 UTC
This PR is an auto-generated API specification update that adds comprehensive blob storage integrations functionality and organization membership management features to the Langfuse Python client. The changes synchronize the Python SDK with API updates from the main Langfuse repository (commit d7069df433ba218bff7cea0739edbfa01ffe3413).
Key Additions:
Blob Storage Integrations: Complete CRUD API for managing blob storage integrations (S3, S3-compatible, Azure Blob Storage) with configurable export frequencies (hourly/daily/weekly), export modes (full history, from today, from custom date), and file formats (JSON/CSV/JSONL). This enables automated data exports to external storage.
Organization Membership Deletion: New API endpoints for deleting organization and project memberships, completing the CRUD interface that previously only supported creation and updates.
Enhanced Score Filtering: Added
session_idparameter to the scores v2 API, allowing users to filter scores by specific sessions.API Migration Guidance: Updated ingestion endpoint documentation to mark it as legacy and direct users to the preferred OpenTelemetry endpoint.
Improved Documentation: Enhanced trace listing API documentation with clearer field parameter descriptions and behavior explanations.
The changes follow established patterns in the codebase with proper Pydantic models, comprehensive error handling, type annotations, and consistent serialization methods. All new functionality includes both synchronous and asynchronous client implementations.
Confidence score: 2/5
BlobStorageExportFrequency,BlobStorageExportMode,BlobStorageIntegrationFileType, andBlobStorageIntegrationTypeenum files