feat(api): update API spec from langfuse/langfuse 99ffc45 #1495
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
Make
retentionparameter optional inupdate()method ofProjectsClientandAsyncProjectsClient, retaining existing setting if omitted.retentionparameter optional inupdate()method ofProjectsClientandAsyncProjectsClient.retentionis omitted, existing retention setting is retained.langfuse/api/reference.mdto reflect optionalretentionparameter inclient.projects.update()examples.update()method inclient.pyto setretentionastyping.Optional[int]in bothProjectsClientandAsyncProjectsClient.This description was created by
for 4006fc5. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Overview
Greptile Summary
This PR updates the auto-generated API client to make the
retentionparameter optional in theProjectsClient.update()andAsyncProjectsClient.update()methods.Key Changes
API Signature Update:
retention: inttoretention: typing.Optional[int] = OMITin both sync and async update methods(name, retention, metadata)to(name, metadata, retention)to follow Python conventions (required before optional)retentionis omitted, the existing project retention setting is preserved on the backendImplementation Details:
remove_omit_from_dict()function in the HTTP client filters out OMIT values before sending requestsDocumentation Updates:
retention=1from the usage example to demonstrate the new optional behaviorBackward Compatibility
This change is fully backward compatible:
project_iduse keyword-only syntax (after*), so parameter reordering does not break existing coderetentionwill continue to work unchangedretentionto preserve existing project settingsConsistency
Both
ProjectsClientandAsyncProjectsClientreceived identical updates, maintaining API consistency across sync and async interfaces.Confidence Score: 5/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant Client as User Code participant PC as ProjectsClient participant HC as HttpClient participant API as Langfuse API Note over Client,API: Update with retention (existing behavior) Client->>PC: update(project_id, name, retention=30) PC->>PC: Build JSON body with retention PC->>HC: request(json={name, metadata, retention}) HC->>HC: remove_omit_from_dict() HC->>API: PUT /api/public/projects/{id} API-->>HC: 200 OK with Project HC-->>PC: Project response PC-->>Client: Project object Note over Client,API: Update without retention (new behavior) Client->>PC: update(project_id, name) Note over PC: retention defaults to OMIT PC->>PC: Build JSON body with retention=OMIT PC->>HC: request(json={name, metadata, retention=OMIT}) HC->>HC: remove_omit_from_dict() filters out OMIT HC->>API: PUT /api/public/projects/{id}<br/>(retention not in payload) Note over API: Retains existing<br/>retention value API-->>HC: 200 OK with Project HC-->>PC: Project response PC-->>Client: Project objectImportant Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant Client as User Code participant PC as ProjectsClient participant HC as HttpClient participant API as Langfuse API Note over Client,API: Update with retention (existing behavior) Client->>PC: update(project_id, name, retention=30) PC->>PC: Build JSON body with retention PC->>HC: request(json={name, metadata, retention}) HC->>HC: remove_omit_from_dict() HC->>API: PUT /api/public/projects/{id} API-->>HC: 200 OK with Project HC-->>PC: Project response PC-->>Client: Project object Note over Client,API: Update without retention (new behavior) Client->>PC: update(project_id, name) Note over PC: retention defaults to OMIT PC->>PC: Build JSON body with retention=OMIT PC->>HC: request(json={name, metadata, retention=OMIT}) HC->>HC: remove_omit_from_dict() filters out OMIT HC->>API: PUT /api/public/projects/{id}<br/>(retention not in payload) Note over API: Retains existing<br/>retention value API-->>HC: 200 OK with Project HC-->>PC: Project response PC-->>Client: Project object