Skip to content

Bug: OpenAIAssistantAgent - doesn't pass complex parameter to PlugIn #10611

Closed
@chesnelg

Description

@chesnelg

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:

  1. 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;
   }
  1. Add plugin to Kernel.
  2. Create OpenAIAssistantAgent, passing the kernel
  3. Add input "switch on light"
  4. 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

Labels

agentsbugSomething isn't workingfollow upIssues that require a follow up from the community.

Type

Projects

Status

Sprint: In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions