feat(api): update API spec from langfuse/langfuse e10102e #1483
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 integrate it into the API, updatingProjectto include anorganizationfield.Organizationclass inorganization.pywith fieldsidandname, supporting JSON serialization and immutability.Projectclass inproject.pyto includeorganizationfield, linking projects to organizations.Organizationto import lists in__init__.pyfiles inapi,resources,projects, andprojects/typesdirectories.This description was created by
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
Organizationmodel and embedded it as a required field in theProjectmodel. All exports properly updated across the module hierarchy.Key Changes:
Organizationmodel withidandnamefieldsorganizationfield toProjectmodel (potentially breaking)__init__.pyfiles to export the newOrganizationtypeConsiderations:
organizationfield inProjectis required and non-optional, which is a breaking change if existing code attempts to deserialize API responses that don't include this fieldConfidence Score: 4/5
organizationfield inProject, 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.langfuse/api/resources/projects/types/project.py- verify backend always includes organization in responsesImportant Files Changed
Organizationmodel with id and name fields - clean auto-generated codeorganizationfield toProjectmodel - breaking change for existing consumersSequence 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