Fix bug related to handling multiple result tools #926
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.
Improves the handling of scenarios where there are multiple response tool calls, especially when one of them is invalid.
I'll note that I think there are further improvements possible in the handling of multiple result tools and how we report validation issues with final results to the model, but I think this should resolve the reported issue and I expect to refactor these code paths in response to other needs, so I think it's better to just get this test passing and added to the code base, and worry about further improvements later (and since we'll have the test, we can make sure we at least don't have regressions).
Thank you @jlowin for providing the unit test! Made it a lot easier to fix than it would have been to concoct that unit test myself.
Closes #672.