Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Adds filter parameter to GetScoresRequest and updates ScoreV2 class to handle it for score filtering.

  • Behavior:
    • Adds filter parameter to GetScoresRequest in GetScoresRequest.ts for filtering scores by metadata and other criteria.
    • Updates ScoreV2 class in Client.ts to handle filter parameter in query parameters.
  • Misc:
    • Updates comments and examples in GetScoresRequest.ts to reflect new filter parameter.

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

Disclaimer: Experimental PR review

Greptile Overview

Greptile Summary

This PR updates the generated ScoreV2 API client to accept a new filter query parameter on GetScoresRequest and forwards it through to GET /api/public/v2/scores.

The only issue spotted is in the new filter JSDoc: it claims the value is a JSON-stringified array, but the example is shown as an unquoted array literal. That mismatch can lead JS callers to pass an array/object, which would be serialized into bracketed query params rather than a single filter JSON string expected by the API.

Confidence Score: 4/5

  • Safe to merge after fixing the filter parameter documentation to avoid incorrect client usage.
  • Implementation change is straightforward (adds filter passthrough) and aligns with existing query parameter handling. The main risk is user-facing: the new JSDoc example can cause incorrect filter serialization in JS usage.
  • packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts

Important Files Changed

Filename Overview
packages/core/src/api/api/resources/scoreV2/client/Client.ts Adds support for forwarding filter from GetScoresRequest into GET /api/public/v2/scores query params.
packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts Adds filter?: string to GetScoresRequest; JSDoc example currently contradicts the "JSON string" requirement and can mislead JS callers.

Sequence Diagram

sequenceDiagram
  participant App as Caller
  participant Score as ScoreV2 client
  participant Fetch as core.fetcher
  participant API as Langfuse API

  App->>Score: get({ ..., filter })
  Score->>Score: build _queryParams incl. filter
  Score->>Fetch: fetcher({ url, method: GET, queryParameters })
  Fetch->>API: GET /api/public/v2/scores?filter=...
  API-->>Fetch: 2xx/4xx response
  Fetch-->>Score: parsed response or error
  Score-->>App: GetScoresResponse / throws
Loading

@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langfuse-js Ready Ready Preview Feb 11, 2026 10:45am

Request Review

@ellipsis-dev ellipsis-dev bot changed the title feat(api): update API spec from langfuse/langfuse 9b531c0 feat: add filter parameter to score API client Feb 11, 2026
@sumerman sumerman enabled auto-merge (squash) February 11, 2026 10:46
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.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +52 to +53
/** A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with. */
filter?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading filter example

This JSDoc says filter is a JSON-stringified array, but the example shows an unquoted array literal ([{"type":...}]). In JS usage this encourages passing an actual array/object, which would be serialized by the SDK into bracketed query params (e.g., filter[0][type]=...) instead of a single filter= JSON string, so the API won’t receive the expected payload. Consider updating the example to be an actual JSON string (and/or show it in a json block explicitly as the string content).

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