Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Dec 23, 2025

Important

Add Organization model and update Project model to include it, while suggesting v2 endpoints for improved performance.

  • Models:
    • Add Organization model in organization.py.
    • Update Project model in project.py to include organization field.
  • Imports:
    • Add Organization to imports in __init__.py in langfuse/api, resources, and projects.
  • Documentation:
    • Suggest using v2 endpoints in reference.md for metrics and observations for better performance.

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

Disclaimer: Experimental PR review

Greptile Summary

This PR updates the API spec to add Organization context to project objects. The main changes are:

  • New Organization model introduced with id and name fields
  • Project model now includes required organization field linking projects to their parent organization
  • Documentation updates recommending v2 endpoints for metrics and observations APIs

Breaking Change Consideration: The new required organization field in the Project model could cause deserialization issues if the API server doesn't include this field in responses, or if client code constructs Project objects manually. However, since this is auto-generated code from the API spec and the API server should be updated accordingly, this should work correctly when both client and server are in sync.

Confidence Score: 4/5

  • This PR is safe to merge with low risk, assuming the API server has been updated to include organization data
  • Score reflects that this is auto-generated code from an API spec update with clean implementation. The minor concern is the required organization field addition to Project model, which is a schema change that requires the API server to provide this data. Since this appears to be coordinated with the backend API update (c04b990), the risk is minimal.
  • Pay attention to langfuse/api/resources/projects/types/project.py - ensure the backend API includes organization data

Important Files Changed

Filename Overview
langfuse/api/resources/projects/types/organization.py New Organization model added with id and name fields - auto-generated, clean implementation
langfuse/api/resources/projects/types/project.py Added required organization field to Project model - potential breaking change for existing consumers

Sequence Diagram

sequenceDiagram
    participant API as Langfuse API Server
    participant Client as Python SDK Client
    participant Project as Project Model
    participant Org as Organization Model
    
    Note over API,Org: API Spec Update: Add Organization to Project
    
    API->>Client: GET /api/public/projects
    activate Client
    Client->>Client: Parse JSON response
    Client->>Project: Deserialize Project data
    activate Project
    Project->>Org: Create Organization object
    activate Org
    Org-->>Project: Organization(id, name)
    deactivate Org
    Project-->>Client: Project(id, name, organization, metadata, retention_days)
    deactivate Project
    Client-->>API: Return Projects response
    deactivate Client
Loading

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