Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Sep 18, 2025

Important

This PR adds new clients and models for managing blob storage integrations and organization memberships, along with marking the ingestion endpoint as legacy.

  • Blob Storage Integrations:
    • Added BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient in client.py to manage blob storage integrations.
    • Introduced models like BlobStorageIntegrationResponse, CreateBlobStorageIntegrationRequest, and others in types/.
    • Added methods for getting, upserting, and deleting blob storage integrations.
  • Organization Memberships:
    • Added methods in client.py for managing organization and project memberships, including delete_organization_membership and delete_project_membership.
    • Introduced DeleteMembershipRequest and MembershipDeletionResponse models in types/.
  • Miscellaneous:
    • Updated README.md to reflect changes in API usage.
    • Marked the ingestion endpoint as legacy and recommended using the OpenTelemetry endpoint.

This description was created by Ellipsis 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:

  • New API client classes (BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient) with full CRUD operations
  • Comprehensive type definitions for configuration (export frequencies, modes, file types)
  • Request/response models for creating, updating, and deleting integrations
  • Support for authentication credentials, bucket configuration, and scheduled exports

Enhanced Organization Management: The PR extends organization management capabilities by adding membership deletion functionality:

  • New DELETE endpoints for removing members from organizations and projects
  • Request/response models (DeleteMembershipRequest, MembershipDeletionResponse) following established patterns
  • Both synchronous and asynchronous client methods with proper error handling

Additional Improvements:

  • Score filtering enhancement: Added session_id parameter to score retrieval methods for better session-based querying
  • API migration guidance: Updated ingestion endpoint documentation to mark it as legacy and recommend OpenTelemetry
  • Documentation improvements: Enhanced trace list field parameter descriptions with clearer exclusion behavior explanations
  • URL updates: Modernized documentation links from 'tracing-data-model' to 'observability/data-model'

All 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

  • This PR introduces significant new functionality but appears to be well-structured and follows established patterns
  • Score reduced due to missing test coverage for critical enum visitor methods that could return None unexpectedly
  • Pay close attention to enum visitor method implementations in blob storage integration type files

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Bot Settings | Greptile

Comment on lines +14 to +25
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()
Copy link
Contributor

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.

Comment on lines +26 to +28
endpoint: typing.Optional[str] = pydantic_v1.Field(default=None)
"""
Custom endpoint URL (required for S3_COMPATIBLE type)
Copy link
Contributor

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.

Comment on lines +70 to +74
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)
Copy link
Contributor

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.

Comment on lines +19 to +25
) -> T_Result:
if self is BlobStorageIntegrationFileType.JSON:
return json()
if self is BlobStorageIntegrationFileType.CSV:
return csv()
if self is BlobStorageIntegrationFileType.JSONL:
return jsonl()
Copy link
Contributor

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.

Suggested change
) -> 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}")

@hassiebp hassiebp merged commit 37468a1 into main Sep 18, 2025
11 checks passed
@hassiebp hassiebp deleted the api-spec-bot-a7d59d7bb27fc4234c7a791c00d04fc214b763de branch September 18, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants