Skip to content

Conversation

@nimarb
Copy link
Contributor

@nimarb nimarb commented Aug 11, 2025

Important

Enhanced Langfuse SDK with new observation types, deprecated old methods, and added comprehensive tests for validation.

  • Observation Types:
    • Introduced new observation types: agent, tool, chain, retriever, evaluator, embedding, guardrail in span.py.
    • Updated @observe decorator to support new type parameter in observe.py.
    • Deprecated start_generation and start_as_current_generation in favor of start_observation.
  • Testing:
    • Added test_deprecation.py to ensure deprecation warnings are emitted for deprecated methods.
    • Updated tests in test_langchain.py and test_otel.py to cover new observation types and ensure correct behavior.
  • API Updates:
    • Added support for new observation types in API client and updated observation_type.py.
    • Introduced new API methods for managing annotation queues in annotation_queues/client.py.

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


Disclaimer: Experimental PR review

Greptile Summary

This review covers only the changes made since the last review (commit 89b1b3e), not the entire PR.

The recent changes primarily focus on addressing feedback from previous reviews and adding enhanced developer tooling. The key updates include:

New type Parameter in @observe Decorator: Introduces a dedicated type parameter alongside the existing as_type parameter in the @observe decorator. This provides improved developer experience by allowing @observe(type="agent") syntax. The implementation includes validation logic to prevent conflicting usage of both parameters and consolidation logic that merges the parameters appropriately.

Type System Refinements: Updates type annotations throughout the codebase to be more consistent and comprehensive. The as_type parameter in various methods has been expanded from restrictive literals to broader observation type unions, improving type safety and IDE support.

Enhanced Testing Infrastructure: Adds a comprehensive test file (test_deprecation.py) that validates deprecation warnings for methods being phased out in favor of the new unified observation API. This ensures proper backward compatibility during the transition period.

Developer Tooling: Adds type checking instructions to the contributing documentation (CONTRIBUTING.md), providing clear guidance for contributors on running mypy type checking with the --no-error-summary flag.

API Client Updates: Updates the observations API client to support a new level parameter for filtering observations by severity levels (DEBUG, DEFAULT, WARNING, ERROR), expanding query capabilities.

These changes build upon the core generalized graph visualization functionality introduced earlier in the PR, focusing on polishing the developer experience and ensuring robust testing coverage for the new observation type system.

Confidence score: 4/5

  • The changes are well-focused improvements that address specific feedback points without introducing major new complexity
  • Score reflects that these are primarily refinements and testing additions with low risk of breaking existing functionality
  • Pay close attention to the parameter consolidation logic in observe.py to ensure the new type parameter works correctly with existing as_type usage

@nimarb nimarb marked this pull request as ready for review August 12, 2025 13:26
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.

6 files reviewed, 3 comments

Edit Code Review Bot Settings | Greptile

@nimarb nimarb marked this pull request as draft August 15, 2025 11:13
@nimarb nimarb changed the title feat(graph-view): generalized graphs feat(traces): add more observation types Aug 15, 2025
@nimarb nimarb marked this pull request as ready for review August 20, 2025 16:44
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.

15 files reviewed, 4 comments

Edit Code Review Bot Settings | Greptile

@nimarb nimarb requested a review from hassiebp August 20, 2025 17:09
@nimarb nimarb merged commit 1596ddd into main Aug 22, 2025
10 checks passed
@nimarb nimarb deleted the nimar/lfe-6153-generalized-graphs-python branch August 22, 2025 12:19
@OliverYGM
Copy link

#1271 this merge request “Add float to MapValue in map_value.py to support optional float values.”, why rm float support in map_value.py now?

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.

4 participants