feat(api): update API spec from langfuse/langfuse 9b8868a #1384
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
Adds support for updating score configurations via new
update()methods inScoreConfigsClientandAsyncScoreConfigsClient, withUpdateScoreConfigRequestdefining the request structure.update()method toScoreConfigsClientandAsyncScoreConfigsClientinclient.pyto update score configurations.is_archived,name,categories,min_value,max_value, anddescription.UpdateScoreConfigRequestinupdate_score_config_request.pyto define the structure of update requests.UpdateScoreConfigRequestto imports in__init__.pyfiles inapi,resources, andscore_configsdirectories.This description was created by
for 895b882. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-09-29 11:30:24 UTC
Summary
This PR adds update functionality for score configurations in the Langfuse Python SDK. The changes were auto-generated from the Langfuse OpenAPI specification and introduce a new
update()method for both synchronous and asynchronous score config clients.Key Changes:
UpdateScoreConfigRequesttype with optional fields:is_archived,name,categories,min_value,max_value, anddescriptionupdate()method in bothScoreConfigsClientandAsyncScoreConfigsClientclasses__init__.pyfilesThe implementation follows established patterns in the codebase and maintains consistency with existing create/get operations. All fields in the update request are optional, allowing for partial updates of score configurations via PATCH requests to
/api/public/score-configs/{config_id}.Confidence Score: 5/5
Sequence Diagram
sequenceDiagram participant Client as Python SDK Client participant API as Langfuse API participant DB as Database Note over Client,DB: Score Configuration Update Flow Client->>+Client: Create UpdateScoreConfigRequest Note right of Client: Optional fields: is_archived, name,<br/>categories, min_value, max_value, description Client->>+API: PATCH /api/public/score-configs/{config_id} Note right of Client: HTTP request with JSON body API->>+DB: Validate config_id exists DB-->>-API: Config validation result alt Config not found API-->>Client: 404 NotFoundError else Config exists API->>+DB: Update score configuration Note right of API: Partial update with provided fields DB-->>-API: Updated ScoreConfig API-->>-Client: 200 OK + ScoreConfig end alt Error cases API-->>Client: 400 BadRequest (invalid data) API-->>Client: 401 Unauthorized API-->>Client: 403 AccessDenied API-->>Client: 405 MethodNotAllowed end