feat(api): update API spec from langfuse/langfuse c04b990 #1484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Add
Organizationmodel and updateProjectmodel to include it, while suggesting v2 endpoints for improved performance.Organizationmodel inorganization.py.Projectmodel inproject.pyto includeorganizationfield.Organizationto imports in__init__.pyinlangfuse/api,resources, andprojects.reference.mdfor metrics and observations for better performance.This description was created by
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
Organizationcontext to project objects. The main changes are:Organizationmodel introduced withidandnamefieldsProjectmodel now includes requiredorganizationfield linking projects to their parent organizationBreaking Change Consideration: The new required
organizationfield in theProjectmodel could cause deserialization issues if the API server doesn't include this field in responses, or if client code constructsProjectobjects 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
organizationfield addition toProjectmodel, 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.langfuse/api/resources/projects/types/project.py- ensure the backend API includes organization dataImportant Files Changed
Organizationmodel added withidandnamefields - auto-generated, clean implementationorganizationfield toProjectmodel - potential breaking change for existing consumersSequence 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