-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Make intermediate results available when MaxTurnExceededException
is thrown
#719
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
Comments
Yes we should indeed do this. Will try to get to it soon - as always, PR welcome from anyone |
I can have a look if @chiehmin-wei is not already working on it. How would you return / save the partial results? |
I think partial results are already built up in Runner, as you described; when the exception is raised, you can add a RunErrorDetails object with all that data |
Okay, so I have to create a new class |
yup! |
### Summary Introduced the `RunErrorDetails` object to get partial results from a run interrupted by `MaxTurnsExceeded` exception. In this proposal the `RunErrorDetails` object contains all the fields from `RunResult` with `final_output` set to `None` and `output_guardrail_results` set to an empty list. We can decide to return less information. @rm-openai At the moment the exception doesn't return the `RunErrorDetails` object for the streaming mode. Do you have any suggestions on how to deal with it? In the `_check_errors` function of `agents/result.py` file. ### Test plan I have not implemented any tests currently, but if needed I can implement a basic test to retrieve partial data. ### Issue number This PR is an attempt to solve issue #719 ### Checks - [✅ ] I've added new tests (if relevant) - [ ] I've added/updated the relevant documentation - [ ✅] I've run `make lint` and `make format` - [ ✅] I've made sure tests pass
Describe the feature
I want to access intermediate results when
MaxTurnExceededException
is thrown.I have a workflow broken into 2 phases.
Phase 1 is investigation.
Phase 2 is writing up a report based on the investigation results.
I'm feeding the results of phase 1 into phase 2 like so:
I want to limit the number of turns in Phase 1.
If a
MaxTurnExceededException
is thrown in Phase 1, I still want to make use of the available information in Phase 2.Currently this doesn't seem possible to do. I have no way to access the intermediate results (tool calls, etc.) if I reach max turns in Phase 1.
The text was updated successfully, but these errors were encountered: