Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Oct 21, 2025

Important

Add SESSION type to AnnotationQueueObjectType and update visit() method to handle it in annotation_queue_object_type.py.

  • Enum Update:
    • Add SESSION to AnnotationQueueObjectType in annotation_queue_object_type.py.
  • Method Update:
    • Update visit() method in AnnotationQueueObjectType to handle SESSION type by adding a session callable parameter and corresponding logic.

This description was created by Ellipsis for 5f8b9fc. You can customize this summary. It will automatically update as commits are pushed.

Disclaimer: Experimental PR review

Greptile Overview

Updated On: 2025-10-21 17:32:45 UTC

Summary

Added SESSION as a new annotation queue object type to align with the upstream API specification. This extends the enum to support session-level annotations alongside existing trace and observation annotations.

Key Changes:

  • Added SESSION = "SESSION" enum value to AnnotationQueueObjectType
  • Extended the visit() method to accept a session callback parameter
  • Implemented SESSION case handler in the visitor pattern

Analysis:

  • Auto-generated code from Fern API spec - properly formatted and consistent
  • Pattern matches existing implementation in CommentObjectType which already supports SESSION
  • No breaking changes - only additive enum expansion
  • No call sites found in codebase using the visitor pattern, so backward compatibility is maintained through required parameter addition
  • Change is purely declarative with no complex logic

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Auto-generated code from API spec that adds a new enum value with proper visitor pattern implementation. The change is additive-only, follows established patterns in the codebase (CommentObjectType already has SESSION support), and contains no complex logic or breaking changes
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
langfuse/api/resources/annotation_queues/types/annotation_queue_object_type.py 5/5 Added SESSION enum value and corresponding visit method handler - auto-generated change, properly implemented

Sequence Diagram

sequenceDiagram
    participant API as Langfuse API
    participant Enum as AnnotationQueueObjectType
    participant Client as Python SDK Client
    
    API->>Enum: Update API spec (add SESSION type)
    Note over Enum: Add SESSION = "SESSION"
    Note over Enum: Add session parameter to visit()
    Note over Enum: Add SESSION handler in visit()
    
    Client->>Enum: Create annotation queue item
    Enum->>Enum: Validate object_type (TRACE/OBSERVATION/SESSION)
    
    alt Using visitor pattern
        Client->>Enum: call visit(trace=fn1, observation=fn2, session=fn3)
        Enum->>Enum: Check self value
        alt is SESSION
            Enum->>Client: return session()
        else is TRACE
            Enum->>Client: return trace()
        else is OBSERVATION
            Enum->>Client: return observation()
        end
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@hassiebp hassiebp merged commit f0619ca into main Oct 22, 2025
12 checks passed
@hassiebp hassiebp deleted the api-spec-bot-62d2959 branch October 22, 2025 09:51
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.

3 participants