Skip to content

feat(api): update API spec from langfuse/langfuse efe3532#1425

Merged
hassiebp merged 1 commit intomainfrom
api-spec-bot-efe3532
Nov 3, 2025
Merged

feat(api): update API spec from langfuse/langfuse efe3532#1425
hassiebp merged 1 commit intomainfrom
api-spec-bot-efe3532

Conversation

@langfuse-bot
Copy link
Copy Markdown
Collaborator

@langfuse-bot langfuse-bot commented Nov 3, 2025

Important

Add organization API key retrieval functionality and update filter documentation for observations and traces.

  • API Functionality:
    • Add get_organization_api_keys() method to OrganizationsClient and AsyncOrganizationsClient in client.py to fetch all API keys for an organization.
    • Introduce OrganizationApiKey and OrganizationApiKeysResponse models in types/organization_api_key.py and types/organization_api_keys_response.py.
  • Documentation:
    • Update filter structure and examples in reference.md and client.py files for observations and traces.
    • Add detailed available columns and filter examples for observations and traces in client.py files.
  • Miscellaneous:
    • Update __init__.py files to include new models OrganizationApiKey and OrganizationApiKeysResponse.

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

Disclaimer: Experimental PR review

Greptile Overview

Updated On: 2025-11-03 10:13:01 UTC

Greptile Summary

This PR updates the Python API client to sync with the latest Langfuse API specification. The changes add support for retrieving organization API keys and significantly enhance the documentation for filter parameters.

Key Changes

  • New Organization API Key Management: Added get_organization_api_keys() method to both sync and async OrganizationsClient classes, allowing retrieval of all API keys for an organization (requires organization-scoped authentication)

    • New types: OrganizationApiKey and OrganizationApiKeysResponse with proper Pydantic models
    • Proper error handling for 400, 401, 403, 404, 405 status codes
    • Exports added throughout the module hierarchy
  • Enhanced Filter Documentation: Updated docstrings for observations.get_many() and trace.list() methods with comprehensive filter documentation

    • Added detailed descriptions of available filter columns (core fields, metrics, costs, metadata)
    • Included filter structure and operator documentation
    • Added practical filter examples for common use cases
    • Clarified that new filter parameter takes precedence over legacy query parameters

Generated Code Quality

All changes appear to be auto-generated by the Fern code generator from the OpenAPI spec. The code follows established patterns in the codebase with consistent error handling, proper type annotations, and appropriate Pydantic model configurations.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects that this is an auto-generated API client update from a trusted code generator (Fern). All changes follow consistent patterns: new endpoint follows existing conventions, error handling is comprehensive, type definitions are properly structured with Pydantic, and documentation enhancements are thorough and accurate. No logic issues, syntax errors, or security concerns identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
langfuse/api/resources/organizations/types/organization_api_key.py 5/5 New Pydantic model for organization API key with proper datetime handling and field aliases
langfuse/api/resources/organizations/types/organization_api_keys_response.py 5/5 New response model containing list of organization API keys
langfuse/api/resources/organizations/client.py 5/5 Added get_organization_api_keys method for both sync and async clients with proper error handling
langfuse/api/resources/observations/client.py 5/5 Enhanced filter documentation with comprehensive column descriptions and examples
langfuse/api/resources/trace/client.py 5/5 Enhanced filter documentation with comprehensive column descriptions and examples

Sequence Diagram

sequenceDiagram
    participant Client
    participant OrganizationsClient
    participant LangfuseAPI
    
    Note over Client,LangfuseAPI: Get Organization API Information
    
    Client->>OrganizationsClient: get_organization_api_keys()
    OrganizationsClient->>LangfuseAPI: GET /api/public/organizations/apiKeys
    
    alt Success (200)
        LangfuseAPI-->>OrganizationsClient: OrganizationApiKeysResponse
        OrganizationsClient-->>Client: List of API key metadata
    else Access Denied (403)
        LangfuseAPI-->>OrganizationsClient: AccessDeniedError
        OrganizationsClient-->>Client: Raise exception
    else Unauthorized (401)
        LangfuseAPI-->>OrganizationsClient: UnauthorizedError
        OrganizationsClient-->>Client: Raise exception
    end
    
    Note over Client,LangfuseAPI: Enhanced Filtering (Observations & Traces)
    
    Client->>OrganizationsClient: observations.get_many(filter=json_string)
    OrganizationsClient->>LangfuseAPI: GET with filter parameter
    LangfuseAPI->>LangfuseAPI: Parse and apply filter conditions
    LangfuseAPI-->>OrganizationsClient: Filtered results
    OrganizationsClient-->>Client: ObservationsViews
Loading

@langfuse-bot langfuse-bot requested a review from sumerman November 3, 2025 10:10
Copy link
Copy Markdown
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.

10 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@hassiebp hassiebp merged commit 99e081d into main Nov 3, 2025
12 checks passed
@hassiebp hassiebp deleted the api-spec-bot-efe3532 branch November 3, 2025 10:27
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