Repository navigation
feat(traceloop-sdk): Add guardrails - #3649
Conversation
Code reviewFound 2 issues:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
DX feedback: API patterns are not PythonicThe current guardrails API leans heavily on Java/C#-style static factory classes ( 1.
|
galkleinman
left a comment
There was a problem hiding this comment.
in general it looks good, i think in terms of the DX, we can do better imo and introduce a DSL which is more functional. Maybe it is worth that we'll merge, start experimenting with it and than improve if we'll find it necessary.
The only thing which is a must change here is those hardcoded string which is used to decide the action to be taken upon failure and so on (like the "raise") - it is really a bad practice.
|
|
||
| g = Guardrails( | ||
| custom_evaluator_guard(evaluator_slug="diagnosis-blocker", condition_field="pass"), | ||
| on_failure="raise", |
There was a problem hiding this comment.
shouldn't be something strong/structured than hardcoded string?
Fixes: TLP-1692
Fixes: TLP-1691
Fixes: TLP-1438
feat(instrumentation): ...orfix(instrumentation): ....Summary by CodeRabbit
New Features
Refactor / Deprecation
Tests
Chores