Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion langfuse/_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ def create_score(
try:
new_body = ScoreBody(
id=score_id,
session_id=session_id,
sessionId=session_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Fix looks correct — alias required without populate_by_name

ScoreBody.session_id is declared with FieldMetadata(alias="sessionId"), and ScoreBody.model_config does not include populate_by_name=True. In Pydantic v2, without that flag, the constructor only accepts the alias form. Passing session_id=session_id (the Python field name) was silently stored as an extra field (because extra="allow" is set on ScoreBody) instead of populating the intended session_id / sessionId field — meaning sessionId was always sent as null to the API.

The change to sessionId=session_id is consistent with every other aliased field in the same constructor call (traceId, observationId, datasetRunId, dataType, configId) and is the correct fix.

datasetRunId=dataset_run_id,
traceId=trace_id,
observationId=observation_id,
Expand Down
Loading