Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Jan 6, 2026

Important

Add fields to CreateCommentRequest and Comment models for inline comments with data field, path, and character range information.

  • Models:
    • Add data_field, path, range_start, and range_end to CreateCommentRequest in create_comment_request.py for inline comments.
    • Add data_field, path, range_start, and range_end to Comment in comment.py for inline comments.

This description was created by Ellipsis 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 CreateCommentRequest and Comment models:

  • data_field - specifies which IO field the comment relates to
  • path - JSON Path expressions for the comment location within the field
  • range_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

  • Safe to merge - auto-generated API client update with well-documented optional fields
  • This is an auto-generated API client update from Fern that adds four optional fields to support inline comments. The changes are backwards-compatible (all new fields are optional), properly documented, follow the existing code patterns, and maintain consistent field naming conventions. No breaking changes or logic errors present.
  • No files require special attention

Important Files Changed

Filename Overview
langfuse/api/resources/comments/types/create_comment_request.py Added four optional fields (data_field, path, range_start, range_end) to support inline comments on IO data
langfuse/api/resources/commons/types/comment.py Added four optional fields (data_field, path, range_start, range_end) to Comment response model for inline comments

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
Loading

@langfuse-bot langfuse-bot requested a review from nimarb January 6, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants