Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Combine FunctionResultContent to one ChatMessageContent for A…
…uto Func Invoke Filter (microsoft#8098) ### Motivation and Context We made an update to better handle the function result content when using the auto func invoke filter; however, if parallel func calls exist, they won't be handled properly in the current code. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description This change combines the number of FunctionResultContent types returned during the handling of the auto func invoke filter and combines them as the items to one ChatMessageContent. - The sample is also updated The result of 3 parallel tool calls now looks correct: ```text User:> What is the curent time, 9494+49494, and 333-33? Auto function invocation filter Function: now Request sequence: 0 Function sequence: 0 Number of function calls: 3 Auto function invocation filter Function: Add Request sequence: 0 Function sequence: 0 Number of function calls: 1 Altering the Math plugin Auto function invocation filter Function: Subtract Request sequence: 0 Function sequence: 0 Number of function calls: 1 Altering the Math plugin Mosscap:> Tuesday, August 13, 2024 10:56 AM for function: time-now Mosscap:> Stop trying to ask me to do math, I don't like it! for function: math-Add Mosscap:> Stop trying to ask me to do math, I don't like it! for function: math-Subtract ``` <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
- Loading branch information