Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Add blob storage integration management and organization membership deletion functionalities to the API.

  • 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 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/.
  • API Documentation:
    • Updated reference.md with new endpoints and usage examples for blob storage integrations and memberships.
  • Miscellaneous:
    • Updated README.md to correct a typo.
    • Updated test utilities in test_http_client.py and test_query_encoding.py to reflect new changes.

This description was created by Ellipsis for 7cd74cd. You can customize this summary. It will automatically update as commits are pushed.

Disclaimer: Experimental PR review

Greptile Summary

Updated On: 2025-09-18 10:30:40 UTC

This PR is an automated API specification update from the main Langfuse repository (commit ac2936d316ccde414fe932edfedecf91c51fd594) that adds comprehensive blob storage integration functionality and enhances organization membership management capabilities.

Key additions include:

  1. Blob Storage Integrations: A complete new API resource (blob_storage_integrations) with support for S3, S3-compatible storage, and Azure Blob Storage. This includes:

    • Configuration models with authentication credentials, export settings (hourly/daily/weekly frequencies), file types (JSON/CSV/JSONL), and export modes (full history, from today, from custom date)
    • Client methods for listing, creating/updating (upsert), and deleting integrations
    • Comprehensive validation through test uploads during configuration
  2. Organization Management Enhancements: New DELETE endpoints for removing organization and project memberships with proper request/response models (DeleteMembershipRequest, MembershipDeletionResponse)

  3. API Evolution: The batch ingestion endpoint is now marked as legacy with guidance to migrate to the OpenTelemetry endpoint (/api/public/otel)

  4. Enhanced Filtering: The ScoreV2 API now supports session-level filtering via a new session_id parameter

  5. Documentation Improvements: Better field filtering explanations for trace endpoints, clarifying that excluded fields return empty arrays or sentinel values (-1)

All changes follow the established Fern-generated patterns in the codebase, maintaining consistency with existing API resources. The blob storage integration represents a significant new feature enabling automated data exports to cloud storage providers with flexible scheduling and format options.

Confidence score: 3/5

  • This PR has some concerning issues but should be mostly safe to merge with careful attention to specific files
  • Score reflects missing error handling in visitor pattern methods and potentially breaking import path changes in test files
  • Pay close attention to enum files with visitor patterns and test files with updated import paths

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 +19 to +25
) -> 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()
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 return statement or exception handling - if self doesn't match any of the defined enum values, the method will implicitly return None, violating the T_Result return type annotation

Suggested change
) -> 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"Unknown BlobStorageIntegrationType: {self}")

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 return statement or exception for unmatched cases. If an invalid enum value exists, this method will return None instead of T_Result, violating the 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"Unknown BlobStorageIntegrationFileType: {self}")

Comment on lines +19 to +25
) -> T_Result:
if self is BlobStorageExportFrequency.HOURLY:
return hourly()
if self is BlobStorageExportFrequency.DAILY:
return daily()
if self is BlobStorageExportFrequency.WEEKLY:
return weekly()
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 return statement or exception for unmatched enum values - the method could return None if a new enum value is added but not handled

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 return statement or raise exception for unhandled enum values - the visit method should handle the case where none of the conditions match

Suggested change
return 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Import path 'langfuse.core.query_encoder' does not exist in current repository structure. The 'langfuse/core/' directory is not present in the codebase, which will cause this import to fail at runtime.

Suggested change
from langfuse.core.query_encoder import encode_query
from langfuse.api.core.query_encoder import encode_query

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.

2 participants