Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented May 28, 2025

Important

This PR adds support for session and dataset run scores in the Langfuse Python SDK, updates sampling logic, and introduces new organization and SCIM-related endpoints.

  • Behavior:
    • Add support for session and dataset run scores in BaseScore and related classes by making trace_id optional and adding session_id, dataset_run_id, and metadata.
    • Introduce ScoreV2Client with updated methods for handling different score types.
    • Update sampling logic in LangfuseResourceManager._add_score_task to ensure session/dataset run scores are not sampled out.
  • Endpoints:
    • Add new organization and SCIM-related endpoints for user/project management.
    • Replace metrics.daily() with metrics.metrics() endpoint supporting custom queries.

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


Greptile Summary

Disclaimer: Experimental PR review

This PR adds support for session and dataset run scores in the Langfuse Python SDK, allowing scores to be associated with sessions and dataset runs in addition to traces.

  • Modified BaseScore and related classes to make trace_id optional and add new fields session_id, dataset_run_id, and metadata in /langfuse/api/resources/commons/types/base_score.py
  • Added new ScoreV2Client in /langfuse/api/resources/score_v_2/client.py with updated methods for handling different score types
  • Updated sampling logic in LangfuseResourceManager._add_score_task to ensure session/dataset run scores are not sampled out
  • Added new organization and SCIM-related endpoints for user/project management
  • Replaced metrics.daily() with more flexible metrics.metrics() endpoint supporting custom queries

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.

78 file(s) reviewed, 14 comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 0701a86 into main Jun 2, 2025
14 of 15 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-4865-add-score-metadata branch June 2, 2025 12:35
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.

bug: definition for score() method is missing metadata property

2 participants