Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Jan 7, 2026

Important

Adds expand_metadata parameter to get_many() in client.py for non-truncated metadata retrieval, updating documentation and function handling.

  • Behavior:
    • Adds expand_metadata parameter to get_many() in client.py for non-truncated metadata retrieval.
    • Metadata values over 200 characters are truncated by default; expand_metadata allows full retrieval for specified keys.
  • Documentation:
    • Updates reference.md to document expand_metadata usage and behavior.
  • Functions:
    • Updates get_many() in ObservationsV2Client and AsyncObservationsV2Client to include expand_metadata parameter handling.

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

Disclaimer: Experimental PR review

Greptile Summary

Added new expand_metadata parameter to the observations v2 API endpoint to allow retrieving non-truncated metadata values for specified keys.

  • Added expand_metadata optional parameter to both sync (ObservationsV2Client) and async (AsyncObservationsV2Client) get_many() methods
  • Updated docstrings to explain that metadata values are truncated to 200 characters by default and can be expanded using this parameter
  • Correctly mapped Python parameter expand_metadata to API parameter expandMetadata (camelCase) in request params
  • Updated API reference documentation to reflect the new parameter

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Auto-generated API spec update that adds a new optional parameter following established patterns, with proper documentation and consistent implementation across sync/async clients
  • No files require special attention

Important Files Changed

Filename Overview
langfuse/api/resources/observations_v_2/client.py Added expand_metadata parameter to both sync and async get_many() methods with proper documentation and API integration
langfuse/api/reference.md Updated API reference documentation to include expand_metadata parameter description

Sequence Diagram

sequenceDiagram
    participant Client as Client Code
    participant SyncClient as ObservationsV2Client
    participant AsyncClient as AsyncObservationsV2Client
    participant API as Langfuse API

    Note over Client,API: Sync Flow
    Client->>SyncClient: get_many(expand_metadata="key1,key2")
    SyncClient->>API: GET /api/public/v2/observations?expandMetadata=key1,key2
    API-->>SyncClient: ObservationsV2Response (full metadata for key1,key2)
    SyncClient-->>Client: ObservationsV2Response

    Note over Client,API: Async Flow
    Client->>AsyncClient: await get_many(expand_metadata="key1,key2")
    AsyncClient->>API: GET /api/public/v2/observations?expandMetadata=key1,key2
    API-->>AsyncClient: ObservationsV2Response (full metadata for key1,key2)
    AsyncClient-->>Client: ObservationsV2Response
Loading

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