feat(api): update API spec from langfuse/langfuse 62d2959 #1416
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
SESSIONtype toAnnotationQueueObjectTypeand updatevisit()method to handle it inannotation_queue_object_type.py.SESSIONtoAnnotationQueueObjectTypeinannotation_queue_object_type.py.visit()method inAnnotationQueueObjectTypeto handleSESSIONtype by adding asessioncallable parameter and corresponding logic.This description was created by
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:
SESSION = "SESSION"enum value toAnnotationQueueObjectTypevisit()method to accept asessioncallback parameterAnalysis:
CommentObjectTypewhich already supports SESSIONConfidence Score: 5/5
Important Files Changed
File Analysis
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