Description
Describe the bug
My Action plugin accept 2 parameters, one a basic string, the other an object. This object is retrieving from a Search plugin.
Using IChatCompletionService, the Kernel is able to retrieve the object using the Search PlugIn and invokes the Action plugin with the 2 parameters, as expected.
However when I use an OpenAIAssistantAgent, the Kernel is also able to retrieve the object using the Search plugIn, but invokes the Action plugin only with the string parameter and fails with the error Error: Missing argument for function parameter
In my real use case, the kernel loops many time on
To Reproduce
Steps to reproduce the behavior:
- Define plugIns (using the LightModel from Semantic Kernel examples)
[Description("Gets a list of lights and their current state")]
public async Task<List<LightModel>> GetLightsAsync()
{
return lights;
}
[KernelFunction("switch_on_light")]
[Description("Switch a light on")]
public async Task SwitchOn(LightModel light)
{
light.IsOn = true;
}
- Add plugin to Kernel.
- Create OpenAIAssistantAgent, passing the kernel
- Add input "switch on light"
- Getting Error:
---> System.ArgumentException: Missing argument for function parameter (Parameter 'light')
--- End of inner exception stack trace ---
at Microsoft.SemanticKernel.KernelFunctionFromMethod.<>c__DisplayClass23_0.<GetParameterMarshalerDelegate>g__parameterFunc|9(KernelFunction _, Kernel kernel, KernelArguments arguments, CancellationToken __)
Expected behavior
The kernel should be able to identify the required parameter and prompt for a Light object
Platform
Semantic Kernel:
Model: gpt-4o-mini
Metadata
Metadata
Assignees
Type
Projects
Status