-
Notifications
You must be signed in to change notification settings - Fork 223
feat(api): update API spec from langfuse/langfuse 322c767a3347432404bd88b407eb5a0c0a9d9834 #1360
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 322c767a3347432404bd88b407eb5a0c0a9d9834 #1360
Conversation
…d88b407eb5a0c0a9d9834
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, 5 comments
| ) -> T_Result: | ||
| if self is BlobStorageIntegrationFileType.JSON: | ||
| return json() | ||
| if self is BlobStorageIntegrationFileType.CSV: | ||
| return csv() | ||
| if self is BlobStorageIntegrationFileType.JSONL: | ||
| return jsonl() |
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 - if self doesn't match any enum value, method returns None instead of T_Result, breaking type contract
| ) -> T_Result: | |
| if self is BlobStorageIntegrationFileType.JSON: | |
| return json() | |
| if self is BlobStorageIntegrationFileType.CSV: | |
| return csv() | |
| if self is BlobStorageIntegrationFileType.JSONL: | |
| return jsonl() | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationFileType.JSON: | |
| return json() | |
| if self is BlobStorageIntegrationFileType.CSV: | |
| return csv() | |
| if self is BlobStorageIntegrationFileType.JSONL: | |
| return jsonl() | |
| raise ValueError(f"Unknown BlobStorageIntegrationFileType: {self}") |
| ) -> 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 cases. If a new enum value is added later or an invalid state occurs, this method will return None instead of T_Result, breaking the type contract.
| ) -> 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() | |
| ) -> 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"Unhandled BlobStorageIntegrationType: {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: Missing return statement or exception handling for unexpected enum values. If an enum instance doesn't match any of the three conditions, the method will return None instead of T_Result, violating the return type annotation.
| 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 BlobStorageExportFrequency value: {self}") |
| def visit( | ||
| self, | ||
| full_history: typing.Callable[[], T_Result], | ||
| from_today: typing.Callable[[], T_Result], | ||
| from_custom_date: typing.Callable[[], T_Result], | ||
| ) -> T_Result: | ||
| 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 return statement or error handling for unrecognized enum values. If self doesn't match any of the three conditions, the method will return None instead of T_Result, violating the type contract.
| def visit( | |
| self, | |
| full_history: typing.Callable[[], T_Result], | |
| from_today: typing.Callable[[], T_Result], | |
| from_custom_date: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| 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() | |
| def visit( | |
| self, | |
| full_history: typing.Callable[[], T_Result], | |
| from_today: typing.Callable[[], T_Result], | |
| from_custom_date: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| 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"Unhandled BlobStorageExportMode: {self}") |
| # This file was auto-generated by Fern from our API Definition. | ||
|
|
||
| from langfuse.api.core.query_encoder import encode_query | ||
| from langfuse.core.query_encoder import encode_query |
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: Import path appears incorrect - 'langfuse.core.query_encoder' module doesn't exist in the repository structure. Should likely remain 'langfuse.api.core.query_encoder'.
Important
This pull request adds new functionalities for managing blob storage integrations and organization memberships, including new client methods and types, along with updates to API documentation and minor fixes.
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClientinclient.pyto manage blob storage integrations.get_blob_storage_integrations,upsert_blob_storage_integration, anddelete_blob_storage_integration.types/.delete_organization_membershipanddelete_project_membershipinorganizations/client.py.DeleteMembershipRequestandMembershipDeletionResponsetypes.client.pyfiles.README.mdto correct a typo.test_http_client.pyandtest_query_encoding.pyfor testing utilities.This description was created by
for 19f2104. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Updated On: 2025-09-18 08:19:40 UTC
This PR is an automated API specification update that adds comprehensive blob storage integration functionality to the Langfuse Python SDK while making several other improvements. The changes include:
New Blob Storage Integration Features:
Enhanced API Capabilities:
session_idparameter for filtering scores by sessionIdDocumentation and Migration Updates:
Infrastructure Changes:
langfuse.api.coretolangfuse.coreAll changes follow established patterns in the codebase with consistent Pydantic model structures, proper field aliasing, and datetime serialization. The blob storage integration represents a significant new feature enabling automated data export capabilities for enterprise use cases.
Confidence score: 2/5
langfuse/api/tests/utils/test_query_encoding.py,langfuse/api/tests/utils/test_http_client.py, and all blob storage enum files with visitor patterns