Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jul 3, 2025

Important

Fixes metadata serialization in Langchain by preventing unnecessary string conversion, ensuring accurate data handling.

  • Behavior:
    • Modified _flatten_and_serialize_metadata in attributes.py to preserve string and integer values without additional JSON serialization.
    • Prevents double-serialization of string values in Langchain user quotes, improving data accuracy.
  • Tests:
    • Updated test_core_sdk.py to verify metadata handling without unnecessary string conversion.
    • Updated test_otel.py to ensure metadata is not double-serialized and is correctly handled in various scenarios.

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


Greptile Summary

Disclaimer: Experimental PR review

Fixes metadata serialization in Langchain integration by preventing unnecessary string value conversion. This change addresses issues where string metadata values were being double-serialized in user quotes.

  • Modified _flatten_and_serialize_metadata in langfuse/_client/attributes.py to preserve string and integer values without additional JSON serialization
  • Prevents double-serialization of string values in Langchain user quotes, improving data accuracy

@hassiebp hassiebp enabled auto-merge (squash) July 3, 2025 16:54
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, 1 comment
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 5486330 into main Jul 4, 2025
10 checks passed
@hassiebp hassiebp deleted the fix-langchain-user-quotes branch July 4, 2025 09:01
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