-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: Kernel function arguments cannot be of type Array<Enum> #5451
Labels
Comments
cc: @SergeyMenshykh |
Hi @EdenTanami, thank you for reporting this issue. Here are two options you can use until a long-term solution is found:
|
[Context] Option 1 will not work in cases where there is no access to the enum to mark it with the attribute. A possible solution could be allowing consumer code to specify JsonSerializerOptions for controlling tool call argument deserialization behavior. |
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 21, 2024
…5928) ### Motivation and Context Close #5451 ### Description <!-- 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: --> - [ ] The code builds clean without any errors or warnings - [ ] 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 - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this issue
Aug 25, 2024
…icrosoft#5928) ### Motivation and Context Close microsoft#5451 ### Description <!-- 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: --> - [ ] The code builds clean without any errors or warnings - [ ] 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 - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
Kernel function with argument of type Enum[] throws on invocation.
I am writing a kernel function that finds toys with the following signature:
public string FindToy(Color[] colors) {...}
public enum Color { Blue, Red, Green }
Then I ask in the chat question to invoke my function.
{{"type":"object","required":["colors"],"properties":{"colors":{"type":"array","items":{"enum":["Blue","Red","Green"]}}}}}
"{"colors":["Blue","Red"]}"
Function failed. Error: Object of type 'System.String' cannot be converted to type 'SKCopilotToolkit.Sample.SampleMockScenario.Plugins.ToysPlugin+Color[]'.
To Reproduce
Steps to reproduce the behavior:
[KernelFunction("FindToy")] public string FindToy(Color[] colors)
Expected behavior
The function will be called with array of Enum values [Blue, Red]
Platform
The text was updated successfully, but these errors were encountered: