Skip to content

feat(api): update API spec from langfuse/langfuse a93f65a#1545

Merged
hassiebp merged 1 commit intomainfrom
api-spec-bot-a93f65a
Feb 27, 2026
Merged

feat(api): update API spec from langfuse/langfuse a93f65a#1545
hassiebp merged 1 commit intomainfrom
api-spec-bot-a93f65a

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Feb 26, 2026

Important

Introduce ObservationV2 class and integrate it into the API structure, updating imports and response handling.

  • New Class:
    • Add ObservationV2 class in observation_v2.py with various fields like id, trace_id, start_time, etc.
  • API Integration:
    • Update __init__.py in api and commons to include ObservationV2 in imports and __all__.
    • Modify observations_v2response.py to use ObservationV2 in data field.
  • Misc:
    • Add ObservationV2 to _dynamic_imports in commons/types/__init__.py and commons/__init__.py.

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

Disclaimer: Experimental PR review

Greptile Summary

This PR introduces the ObservationV2 class for the v2 observations API and integrates it throughout the API module structure. The key change improves type safety by replacing typing.List[typing.Dict[str, typing.Any]] with typing.List[ObservationV2] in the ObservationsV2Response class.

  • New Model: Added comprehensive ObservationV2 Pydantic model with 30+ fields including core observation data, timestamps, usage/cost tracking, and model information
  • Import Updates: Properly integrated ObservationV2 into module exports across api, commons, and commons/types packages with correct alphabetical ordering
  • Type Safety: Response data is now strongly-typed instead of generic dictionaries, providing better IDE support and runtime validation
  • Configuration: Model uses extra="allow" for API flexibility and frozen=True for immutability

All imports follow the custom rule requirement of being placed at the top of modules. The auto-generated code is clean and follows Python/Pydantic best practices.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Auto-generated API spec update that adds a new well-structured Pydantic model and improves type safety. All imports follow conventions, code is clean, and no logical errors or security issues detected.
  • No files require special attention

Important Files Changed

Filename Overview
langfuse/api/commons/types/observation_v2.py New Pydantic model with comprehensive fields, proper type annotations, and field aliases for camelCase API compatibility
langfuse/api/observations_v2/types/observations_v2response.py Improved type safety by replacing generic dict with strongly-typed ObservationV2 model

Last reviewed commit: f2494f0

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.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@hassiebp hassiebp merged commit 72aa156 into main Feb 27, 2026
13 checks passed
@hassiebp hassiebp deleted the api-spec-bot-a93f65a branch February 27, 2026 14:32
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