Thank you for taking time to contribute this pull request! You might have already read the [contributor guide][1], but as a reminder, please make sure to:

issue https://github.com/spring-projects/spring-ai/issues/1370

I fixed the duplicate call by passing the id of the previous response and using it to validate the next call, but the root cause was not identified and the loop continues to execute twice.

Adjusted test do validate correction streamFunctionCallUsageTest

  • Sign the contributor license agreement
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

Comment From: Claudio-code

is that only the switchMap section is executed twice, not the entire method