-
Notifications
You must be signed in to change notification settings - Fork 223
feat(api): update API spec from langfuse/langfuse 291abf3205462f270d182d068b756bd1add1cd06 #1368
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 291abf3205462f270d182d068b756bd1add1cd06 #1368
Conversation
…82d068b756bd1add1cd06
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
| ) -> 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 fallthrough case in visit method - if an unexpected enum value exists, this will return None instead of raising an error, breaking the return 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 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 - if self doesn't match any of the defined enum values, this method will implicitly return None, violating the return type annotation 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() | |
| ) -> 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: {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 exception for unhandled 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.
| # 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 to be incorrect - langfuse.core.query_encoder does not exist in the repository structure. The original path langfuse.api.core.query_encoder should be used instead.
| from langfuse.core.query_encoder import encode_query | |
| from langfuse.api.core.query_encoder import encode_query |
Important
Add blob storage integration management and organization membership deletion functionalities, update API documentation, and fix minor issues.
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClientinclient.pyto manage blob storage integrations.BlobStorageIntegrationResponse,CreateBlobStorageIntegrationRequest, and others intypes/.__init__.pyto include new imports for blob storage integrations.delete_organization_membershipanddelete_project_membershipinclient.pyfor managing memberships.DeleteMembershipRequestandMembershipDeletionResponsemodels intypes/.__init__.pyto include new imports for organization memberships.ingestion/client.pyto mark the batch ingestion endpoint as legacy.session_idparameter toget()inscore_v_2/client.py.trace/client.pyto clarify field inclusion behavior inlist()method.test_http_client.pyandtest_query_encoding.py.This description was created by
for 6e70176. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Updated On: 2025-09-18 11:26:03 UTC
This PR updates the Langfuse Python API client to match API specification changes from the main langfuse repository (commit 291abf3205462f270d182d068b756bd1add1cd06). The changes introduce significant new functionality for blob storage integrations and expand organization membership management capabilities.
The blob storage integration feature adds a complete CRUD API for managing external storage connections (S3, S3-compatible, Azure Blob Storage) with configurable export frequencies (hourly, daily, weekly), modes (full history, from today, from custom date), and file types (JSON, CSV, JSONL). This includes 8 new API types, a dedicated client with both sync/async implementations, and comprehensive request/response models.
Membership management is enhanced with new DELETE endpoints for removing organization and project memberships, completing the CRUD operations for user access management. The ScoreV2 API gains a new
session_idfiltering parameter, and the trace list endpoint receives improved documentation for thefieldsparameter behavior.Additionally, the ingestion endpoint is marked as legacy with users directed toward the OpenTelemetry endpoint (
/api/public/otel), reflecting the platform's migration to industry-standard observability protocols. Documentation URLs are updated from 'tracing-data-model' to 'observability/data-model' to align with this broader repositioning.All changes follow the established codebase patterns with proper error handling, field aliasing, and Pydantic model configurations. The majority of files are auto-generated by Fern from the API specification, ensuring consistency with the server-side implementation.
Confidence score: 2/5