-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python[patch]: accept simple evaluators #1200
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice i like the start will re-review this morning
if not ( | ||
num_positional in (2, 3) or (num_positional <= 3 and has_positional_var) | ||
): | ||
msg = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
Co-authored-by: William FH <[email protected]>
…i/langsmith-sdk into bagatur/rfc_simple_evaluator
@@ -632,3 +636,70 @@ def comparison_evaluator( | |||
) -> DynamicComparisonRunEvaluator: | |||
"""Create a comaprison evaluator from a function.""" | |||
return DynamicComparisonRunEvaluator(func) | |||
|
|||
|
|||
def _normalize_evaluator_func( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be nice to add like a couple unit tests on this to make it obvious it's working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, but would add some extra tests in to confirm it works properly
]: | ||
# for backwards compatibility, if args are untyped we assume they correspond to | ||
# Run and Example: | ||
if not (type_hints := get_type_hints(func)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add debug logs letting you know what function type is being used? Might be helpful since we tell people to enable debug logs for debugging issues in the SDK?
Do we want it to be like pytest where it's all by name? |
yea i like that. for backwards compat can't enforce run/example but can enforce the others |
can write evaluators like this:
example experiment: left-tray-86 https://dev.smith.langchain.com/public/e7782ea0-3de5-4352-8cd4-7b2cdbb03e4c/d