Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Add Organization model and integrate it into the API, updating Project to include an organization field.

  • Models:
    • Add Organization class in organization.py with fields id and name, supporting JSON serialization and immutability.
    • Update Project class in project.py to include organization field, linking projects to organizations.
  • Imports:
    • Add Organization to import lists in __init__.py files in api, resources, projects, and projects/types directories.

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

Disclaimer: Experimental PR review

Greptile Summary

Updated API client types to match upstream Langfuse API specification. Added new Organization model and embedded it as a required field in the Project model. All exports properly updated across the module hierarchy.

Key Changes:

  • Created Organization model with id and name fields
  • Added organization field to Project model (potentially breaking)
  • Updated all __init__.py files to export the new Organization type

Considerations:

  • The organization field in Project is required and non-optional, which is a breaking change if existing code attempts to deserialize API responses that don't include this field
  • Since this is auto-generated from the API spec, the change should be safe if the backend API already returns organization data in project responses

Confidence Score: 4/5

  • This PR is mostly safe to merge with low risk, assuming the backend API now includes organization data
  • Auto-generated code from API spec is clean and properly structured. The main concern is the new required organization field in Project, which could break deserialization if the backend doesn't consistently provide this data. However, since this is an API spec update, the backend should already be returning this field.
  • Pay attention to langfuse/api/resources/projects/types/project.py - verify backend always includes organization in responses

Important Files Changed

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

Sequence Diagram

sequenceDiagram
    participant API as Langfuse API
    participant Client as API Client
    participant Project as Project Model
    participant Org as Organization Model

    Note over API,Org: API Spec Update (e10102e)
    
    API->>Client: GET /api/public/projects
    Client->>Project: Parse response with organization field
    Project->>Org: Create Organization instance
    Org-->>Project: Return Organization (id, name)
    Project-->>Client: Return Project with nested Organization
    Client-->>API: Project object ready for use
    
    Note over Project,Org: New Required Field
    Note over Project: organization: Organization
    Note over Org: id: str, name: str
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