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
Adding re-raise flag at OpenAI Agent level #12674
Closed
LMartinezEXEX
wants to merge
1
commit into
run-llama:main
from
LMartinezEXEX:lmartinez/raise_error_OpenAI_Agent
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
My general feedback is this arg is pretty generic, but its actual use only covers one very specific use-case, which is kind of misleading
Is there any way we can think of to improve this? A better name? Handle more scenarios where errors are caught?
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.
Also, please double check the unit tests
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.
Hi Logan! Thank you for the comments! :)
So regarding this feature, absolutely! I understand there are multiple places where exceptions are raised which are captured by llama-index code.
This was motivated by Azure filtering error exception while streaming, I needed to capture in my side the exception.
I noticed the functionality (i.e. the flag to re-reaise the exception) was there, although not end-to-end implemented.
My main objective was to introduce the parameter at an Agent level, as this was recommended in a thread in Discord.
I'm no expert of the whole llama-index codebase, but I am sure that with this small step, any other in need of this kind of feature will be able to adjust, in future PRs, the code to get exception in particular scenarios if they need!
Regarding the naming of the variable at an Agent level, wdyt of
capture_exception
orrethrow_exception
, to be more explicit of not an error, but an exception.And to finish, I checked the unit tests, they neither pass in the main branch (at least on my setup). I would take a look.
Please let me know about your thought on this! ✨