feat(api): update API spec from langfuse/langfuse 57537ad #1490
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 fields to
CreateCommentRequestandCommentmodels for inline comments with data field, path, and character range information.data_field,path,range_start, andrange_endtoCreateCommentRequestincreate_comment_request.pyfor inline comments.data_field,path,range_start, andrange_endtoCommentincomment.pyfor inline comments.This description was created by
for 7494990. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Added support for inline comments on IO fields (input, output, metadata) by introducing four new optional fields to both
CreateCommentRequestandCommentmodels:data_field- specifies which IO field the comment relates topath- JSON Path expressions for the comment location within the fieldrange_start- start character offsets (inclusive, UTF-16 code units)range_end- end character offsets (exclusive, UTF-16 code units)These fields work together to enable precise inline commenting on specific portions of trace/observation IO data. The documentation indicates these fields must be set together when creating inline comments, with validation expected to occur server-side.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant Client participant CreateCommentRequest participant CommentsClient participant API participant Comment Client->>CreateCommentRequest: Instantiate with fields Note over CreateCommentRequest: Required: project_id, object_type,<br/>object_id, content<br/>Optional: author_user_id,<br/>data_field, path,<br/>range_start, range_end Client->>CommentsClient: create(request) CommentsClient->>API: POST /api/public/comments Note over API: Validates inline comment fields<br/>(data_field, path, range_start,<br/>range_end must be set together) alt Success API-->>CommentsClient: 200 OK CommentsClient-->>Client: CreateCommentResponse else Error API-->>CommentsClient: 400/401/403/404/405 CommentsClient-->>Client: Raise Error end Client->>CommentsClient: get_by_id(comment_id) CommentsClient->>API: GET /api/public/comments/{id} API-->>CommentsClient: Comment object Note over Comment: Contains all fields including<br/>inline comment data CommentsClient-->>Client: Comment