You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to create a kernel function to sum an array of numbers however if I use an array as the function argument I get the error Function failed. Error: Object of type 'System.String' cannot be converted to type 'System.Double[]'.
To Reproduce
From the logs it looks like openai function call is correct.
{"function":{"name":"MathPlugin_Sum","description":"Sum an array of numbers.","parameters":{"type":"object","required":["numbers"],"properties":{"numbers":{"type":"array","items":{"type":"number"},"description":"The array of numbers to sum."}}}},"type":"function"}
github-actionsbot
changed the title
Kernel function arguments cannot be complex type (e.g., array)
.Net: Kernel function arguments cannot be complex type (e.g., array)
Jan 22, 2024
### Motivation and Context
It would be very convenient and beneficial for both SK consumer code and
SK itself if there was an implicit mechanism for deserializing function
arguments provided as JSON into their actual types specified in the
function signature, similar to the implicit data type conversion
mechanism SK currently has.
Closes#4696,
#3126
### Description
The change adds the 'TryToDeserializeValue' fallback, which attempts to
deserialize the argument value into the target parameter type if all the
methods to convert the argument to its actual type have been exhausted.
### Motivation and Context
It would be very convenient and beneficial for both SK consumer code and
SK itself if there was an implicit mechanism for deserializing function
arguments provided as JSON into their actual types specified in the
function signature, similar to the implicit data type conversion
mechanism SK currently has.
Closesmicrosoft#4696,
microsoft#3126
### Description
The change adds the 'TryToDeserializeValue' fallback, which attempts to
deserialize the argument value into the target parameter type if all the
methods to convert the argument to its actual type have been exhausted.
Describe the bug
I am trying to create a kernel function to sum an array of numbers however if I use an array as the function argument I get the error
Function failed. Error: Object of type 'System.String' cannot be converted to type 'System.Double[]'.
To Reproduce
From the logs it looks like openai function call is correct.
However later on it looks like the method is being called with a string.
Here is my F# script. Run with
dotnet fsi script.fsx
.Expected behavior
I am expecting the method to be called with an array of floats instead of a string.
Screenshots
If applicable, add screenshots to help explain your problem.
Platform
The text was updated successfully, but these errors were encountered: