Skip to content

.Net: Add Enum Support for Auto-Function Calling in OpenAIAssistantAgent with Updated Test Case #10495

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

Closed
wants to merge 1 commit into from

Conversation

shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Feb 11, 2025

Add Enum Support for Auto-Function Calling in OpenAIAssistantAgent with Updated Test Case

PR Description:
This PR addresses the issue of enum handling when invoking kernel functions through OpenAIAssistantAgent using auto-function calling. Specifically, it adds proper handling for WidgetType and WidgetColor enums in the WidgetFactory plugin.

Key Changes:

  • Enhanced enum handling in WidgetFactory.CreateWidget to support automatic function invocation using enums.
  • Updated test case (AddPluginsAsync) demonstrating enum support during kernel function invocation, ensuring that enums are properly parsed and handled in plugin functions.
  • Added required JsonConverter for correct enum parsing in WidgetType and WidgetColor.

This change ensures that the OpenAIAssistantAgent auto-function calling can handle enums without errors and provides an example test case to validate the behavior.

Contribution Checklist

Fixes #10442

@shethaadit shethaadit requested a review from a team as a code owner February 11, 2025 23:25
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Feb 11, 2025
@github-actions github-actions bot changed the title Add Enum Support for Auto-Function Calling in OpenAIAssistantAgent with Updated Test Case .Net: Add Enum Support for Auto-Function Calling in OpenAIAssistantAgent with Updated Test Case Feb 11, 2025
@crickman crickman self-assigned this Feb 12, 2025
@crickman crickman added the wontfix This will not be worked on label Feb 12, 2025
@crickman
Copy link
Contributor

Hi @shethaadit, this is an insightful work-around. I am working to add support for enums, however.

Copy link
Contributor

@crickman crickman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on a fix that addresses root-cause for this issue.

@crickman
Copy link
Contributor

#10513

@crickman crickman closed this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code wontfix This will not be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

.Net: Bug: Enums not supported in function calling from Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent
3 participants