semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Input confusion when ActionPlanner works with substep

Open poweihuang0817 opened this issue 1 year ago • 3 comments

Describe the bug Input will show up in state. And then it will not be captured correctly into substep for action planner.

For example, for function name below, workspaceName could not be passed with correct input. It will get input from upstream. For example, user intent in chatapp. We need to do custom coding to make it work.

public string GetDatasetName(string workspaceName)

User intent: I want to retrieve the names of datasets within a Power BI workspace named High_Memory.

{"state":[{"Key":"INPUT","Value":"High_Memory"}],"steps":[{"state":[{"Key":"INPUT","Value":""}],"steps":[],"parameters":[{"Key":"INPUT","Value":""}],"outputs":[],"next_step_index":0,"name":"GetDatasetName","skill_name":"PowerBI","description":"Return dataset name of my power bi workspace"}],"parameters":[{"Key":"INPUT","Value":""}],"outputs":[],"next_step_index":0,"name":"","skill_name":"Microsoft.SemanticKernel.Planning.Plan","description":"User intent: I want to retrieve the names of datasets within a Power BI workspace named High_Memory."}

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • IDE: [e.g. Visual Studio, VS Code]
  • NuGet Package Version [e.g. 0.1.0]

Additional context Add any other context about the problem here.

poweihuang0817 avatar May 15 '23 17:05 poweihuang0817

This problem might comes from a general design issue. Need a contract between skills.

poweihuang0817 avatar May 16 '23 04:05 poweihuang0817

This is related to #998 right @poweihuang0817 ?

lemillermicrosoft avatar May 18 '23 15:05 lemillermicrosoft

yes, related

poweihuang0817 avatar May 19 '23 05:05 poweihuang0817

This seems like an ActionPlanner bug. It is placing SoP_High_Memory into the Plan.State which gets overridden by the input when the plan is executed (Yes, proceed). LIke SequentialPlanner, this should be a Parameter on the step where this should be input.

https://github.com/microsoft/semantic-kernel/blob/f1448c9a0759947256af7f4c6b940c9eab06ea91/dotnet/src/Extensions/Planning.ActionPlanner/ActionPlanner.cs#L127

lemillermicrosoft avatar Jun 15 '23 21:06 lemillermicrosoft