Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 24, 2025

Important

observe() in observe.py now defaults IO capture to an environment variable when not explicitly set.

  • Behavior:
    • observe() function in observe.py now defaults capture_input and capture_output to None instead of True.
    • If capture_input or capture_output is None, defaults to the value of LANGFUSE_OBSERVE_DECORATOR_IO_CAPTURE_ENABLED environment variable.
  • Implementation:
    • Introduces should_capture_input and should_capture_output to determine final capture behavior.
    • Updates _async_observe and _sync_observe to use should_capture_input and should_capture_output instead of direct parameters.

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

Greptile Summary

Disclaimer: Experimental PR review

Modifies the default IO capture behavior in the @observe decorator to be controlled by environment variables instead of hardcoded defaults, improving configuration flexibility.

  • Changed capture_input and capture_output defaults in langfuse/_client/observe.py from True to None, deferring to LANGFUSE_OBSERVE_DECORATOR_IO_CAPTURE_ENABLED environment variable
  • Enhanced configurability by allowing global IO capture settings through environment variables
  • Test coverage confirms functionality with mock traces and observation validation

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.

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit a720608 into main Jun 24, 2025
7 checks passed
@hassiebp hassiebp deleted the fix-observe-default-io-capture branch June 24, 2025 14:46
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