Skip to content
Merged
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
10 changes: 10 additions & 0 deletions langfuse/_client/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def score(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None: ...

@overload
Expand All @@ -290,6 +291,7 @@ def score(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None: ...

def score(
Expand All @@ -302,6 +304,7 @@ def score(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None:
"""Create a score for this specific span.

Expand All @@ -316,6 +319,7 @@ def score(
comment: Optional comment or explanation for the score
config_id: Optional ID of a score config defined in Langfuse
timestamp: Optional timestamp for the score (defaults to current UTC time)
metadata: Optional metadata to be attached to the score

Example:
```python
Expand All @@ -342,6 +346,7 @@ def score(
comment=comment,
config_id=config_id,
timestamp=timestamp,
metadata=metadata,
)

@overload
Expand All @@ -355,6 +360,7 @@ def score_trace(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None: ...

@overload
Expand All @@ -368,6 +374,7 @@ def score_trace(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None: ...

def score_trace(
Expand All @@ -380,6 +387,7 @@ def score_trace(
comment: Optional[str] = None,
config_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
metadata: Optional[Any] = None,
) -> None:
"""Create a score for the entire trace that this span belongs to.

Expand All @@ -395,6 +403,7 @@ def score_trace(
comment: Optional comment or explanation for the score
config_id: Optional ID of a score config defined in Langfuse
timestamp: Optional timestamp for the score (defaults to current UTC time)
metadata: Optional metadata to be attached to the score

Example:
```python
Expand All @@ -420,6 +429,7 @@ def score_trace(
comment=comment,
config_id=config_id,
timestamp=timestamp,
metadata=metadata,
)

def _set_processed_span_attributes(
Expand Down
Loading