-
Notifications
You must be signed in to change notification settings - Fork 223
feat(api): update API spec from langfuse/langfuse a7d59d7b #1371
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 a7d59d7b #1371
Conversation
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
| 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 default case - if an invalid enum value exists, this method will return None instead of T_Result, violating the return type annotation.
| endpoint: typing.Optional[str] = pydantic_v1.Field(default=None) | ||
| """ | ||
| Custom endpoint URL (required for S3_COMPATIBLE type) |
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: Document states endpoint is 'required for S3_COMPATIBLE type' but field is Optional. Consider validation logic to ensure endpoint is provided when type is S3_COMPATIBLE.
| export_start_date: typing.Optional[dt.datetime] = pydantic_v1.Field( | ||
| alias="exportStartDate", default=None | ||
| ) | ||
| """ | ||
| Custom start date for exports (required when exportMode is 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: Document states export_start_date is 'required when exportMode is FROM_CUSTOM_DATE' but field is Optional. Consider validation logic to ensure this field is provided when export mode requires it.
| ) -> 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 in visit method. If an unexpected enum value exists, this method will return None instead of T_Result, violating 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"Unexpected BlobStorageIntegrationFileType: {self}") |
Important
This PR adds new clients and models for managing blob storage integrations and organization memberships, along with marking the ingestion endpoint as legacy.
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClientinclient.pyto manage blob storage integrations.BlobStorageIntegrationResponse,CreateBlobStorageIntegrationRequest, and others intypes/.client.pyfor managing organization and project memberships, includingdelete_organization_membershipanddelete_project_membership.DeleteMembershipRequestandMembershipDeletionResponsemodels intypes/.README.mdto reflect changes in API usage.This description was created by
for 5a792d4. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Updated On: 2025-09-18 13:01:58 UTC
This PR represents a comprehensive API specification update that synchronizes the Python SDK with the main Langfuse repository (commit a7d59d7b). The changes introduce two major new feature areas while maintaining full backward compatibility.
New Blob Storage Integrations: The update adds complete support for managing blob storage integrations, enabling users to export Langfuse data to external storage providers like S3, S3-compatible services, and Azure Blob Storage. This includes:
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClient) with full CRUD operationsEnhanced Organization Management: The PR extends organization management capabilities by adding membership deletion functionality:
DeleteMembershipRequest,MembershipDeletionResponse) following established patternsAdditional Improvements:
session_idparameter to score retrieval methods for better session-based queryingAll changes follow the established codebase patterns with proper Pydantic models, field aliasing, error handling, and comprehensive type safety. The auto-generated nature via Fern ensures consistency with the backend API specification.
Confidence score: 3/5