Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Fix FunctionChoiceBehavior State Restoration in OllamaPromptExecutionSettings. #9718

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

shethaadit
Copy link
Contributor

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

Fixes #9682

@shethaadit shethaadit requested a review from a team as a code owner November 15, 2024 18:37
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Nov 15, 2024
@github-actions github-actions bot changed the title Fix FunctionChoiceBehavior State Restoration in OllamaPromptExecutionSettings. .Net: Fix FunctionChoiceBehavior State Restoration in OllamaPromptExecutionSettings. Nov 15, 2024
@raffaeler
Copy link

Out of curiosity, are you going to support images as well? (They currently are not working)

@RogerBarreto
Copy link
Member

@raffaeler, please open an issue and (if you could provide your not working example code would be very helpful) we can investigate this. Thanks!

@RogerBarreto RogerBarreto added this pull request to the merge queue Nov 19, 2024
Merged via the queue into microsoft:main with commit 0d11264 Nov 19, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Ollama connector does not send the tools/agents/functions list
4 participants