-
Notifications
You must be signed in to change notification settings - Fork 80
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
Enhance Python SDK: Implement Robust Error Handling for add_output Function #687
Conversation
add_ouput
add_ouput
add_ouput
add_ouput
in Python SDK
add_ouput
in Python SDKadd_ouput
in Python SDK
# Case 1: No output, no overwrite | ||
with pytest.raises( | ||
Exception, | ||
match=r"Cannot add output to prompt 'GreetingPrompt'. Output is empty.", |
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: to make things easier, would make "GreetingPrompt" it's own var like prompt_name
and just re-use it here. Not a big deal though
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 would stick to keeping it as it is now. Since isn't being used anymore in the test.
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.
Thanks for doing this, this is great!
Left a bunch of small nit (nit-picking), which aren't blocking, just nice to address, thanks!
Approaching this with curiosity. What's the best approach to managing PR comments? Should the author address the comment and mark it as resolved, or is it the responsibility of the reviewer to close out the comments after an update or commit? |
Personally I would say the PR author addresses comments and resolves as they're fixed. Some people prefer that reviewer be more strict and review everything, but I feel that reviewer should just give another final look to confirm everything is cool anyways |
This looks great! Thanks for being so diligent with testing and fixes from comments! Looking forward to continue working with you :) |
add_ouput
in Python SDK
Summary:
This pull request addresses a critical flaw in the add_output method within the Python SDK. Currently, the method incorrectly adds None to the output list when the Output parameter is None, which contradicts the intended behavior. The expected functionality is for the method to reject None as an invalid output or, alternatively, raise an exception.
Changes Made:
Context:
This change ensures that the add_output method behaves as expected, providing more robust and predictable behavior when handling output parameters.
Related Issues:
Closes #529
Test Plan:
New test similar to
test_add_output_existing_prompt_no_overwrite
but with overwrite needs to be added.Things left to complete:
add_output
with overwrite enabled