Skip to content

Commit ed29f65

Browse files
Update langfuse/_client/client.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 1fb2d50 commit ed29f65

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

langfuse/_client/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ def __init__(
165165
self._mask = mask
166166
self._project_id = None
167167
sample_rate = sample_rate or float(os.environ.get(LANGFUSE_SAMPLE_RATE, 1.0))
168+
if not 0.0 <= sample_rate <= 1.0:
169+
raise ValueError(f"Sample rate must be between 0.0 and 1.0, got {sample_rate}")
168170

169171
self._tracing_enabled = (
170172
tracing_enabled

0 commit comments

Comments
 (0)