** Please make sure you read the contribution guide and file the issues in the rigth place. **
Contribution guide.
Describe the bug
Contents.rearrangeEventsForAsyncFunctionResponsesInHistory method could generate duplicate function Response type event, casusing message disorder, leading to model invocation failure.
To Reproduce
Steps to reproduce the behavior:
Bad case:
If filtered events order are FC1,FR1,FR2,FC2, after execute rearrangeEventsForAsyncFunctionResponsesInHistory we will get a new events list like: FC1,FR1,FR2,FC2,FR2; In this case, FR2 is added duplicate
Expected behavior
Add the following check code to avoid dupplicate adding.
Desktop (please complete the following information):
- OS: [e.g. iOS] macos
- Java version: 17
- ADK version(see maven dependency): 0.4.0
Additional context
Add any other context about the problem here.