openai icon indicating copy to clipboard operation
openai copied to clipboard

FunctionCallingHelper unable to handle array parameter

Open Kanedsodas opened this issue 1 year ago • 5 comments

When making a function definition using FunctionCallingHelper if the function has an array for a parameter it just errors, the code for the other method of making function definitions seems to support it however.

Kanedsodas avatar Nov 05 '23 21:11 Kanedsodas

please share a code sample

kayhantolga avatar Nov 06 '23 15:11 kayhantolga

//Generates a 'Parameter type 'System.Single[]' not supported' Exception when run, any type of array does this
Functions = FunctionCallingHelper.GetFunctionDefinitions<Calculator>();

public class Calculator
{
    [FunctionDescription("Adds an array of numbers together.")]
    public float Sum(float[] nums)
    {
        return nums.Sum();
    }
}

Kanedsodas avatar Nov 06 '23 20:11 Kanedsodas

How to customize the parameters of the ChatCompletionCreateRequest?,openai Updated, you can carry the file ID, but the current SDK does not seem to be supported,Thanks

MayDay-wpf avatar Nov 11 '23 06:11 MayDay-wpf

@MayDay-wpf, I have not yet implemented all the changes announced at devday.

kayhantolga avatar Nov 11 '23 12:11 kayhantolga

@Kanedsodas I will investigate this, thanks for sharing.

kayhantolga avatar Nov 11 '23 12:11 kayhantolga