Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Fix FunctionChoiceBehavior State Restoration in OllamaPromptExe…
…cutionSettings. (#9718) ### Description This PR addresses a bug in `OllamaPromptExecutionSettings` where the `FunctionChoiceBehavior` state was not properly restored during the conversion process from `PromptExecutionSettings`. Specifically, the internal state of `FunctionChoiceBehavior`, including its list of associated functions, was lost during serialization and deserialization. ### Motivation and Context **Why is this change required?** The lack of proper state restoration led to missing function definitions in HTTP requests when using the Ollama connector, causing failures in scenarios that rely on function calls. **What problem does it solve?** This change ensures that the `FunctionChoiceBehavior` is fully restored when converting execution settings, maintaining the expected behavior for function calls in the Ollama connector. **What scenario does it contribute to?** This fix enables consistent and reliable function calling with the Ollama connector, ensuring that defined functions are included in requests and operate as expected. **Related Issues** This change fixes the issue described in the bug report, improving usability and reliability when working with function behaviors in Semantic Kernel integrations. ### Contribution Checklist - [Y] The code builds clean without any errors or warnings - [Y] 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 - [Y] All unit tests pass, and I have added new tests where possible - [Y] I didn't break anyone :) Fixes #9682 --------- Co-authored-by: Adit Sheth <adsheth@microsoft.com> Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
- Loading branch information