MicrosoftDocs / semantic-kernel-docs

Semantic Kernel (SK) is a lightweight SDK enabling integration of AI Large Language Models (LLMs) with conventional programming languages.
MIT License
173 stars 100 forks source link

Math Planner in the Semantic Kernel documentation Computes the value incorrectly when a sequential planner is used #57

Open sramaswami11 opened 8 months ago

sramaswami11 commented 8 months ago

Please refer to the following semantic kernel documentation page url : https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/planners/?tabs=Csharp When I used the code given in this page (which matches with the github repository) for MathPlugin and the code under the program.cs to instantiate a SequentialPlanner and run the plan, the result was incorrect. The ask was "If my investment of 2130.23 dollars increased by 23%, how much would I have after I spent $5 on a latte?"; and the result was 46.1 (but the right answer should be 2615.1829

However when I changed the code to use a StepwisePlanner instead (keeping the MathPlugin unchanged) this seems to yield the right result (2615.1829)

Here is my code change: var planner = new StepwisePlanner(kernel); var ask = "If my investment of 2130.23 dollars increased by 23%, how much would I have after I spent $5 on a latte?"; var plan = planner.CreatePlan(ask);

Not sure why the SequentialPlanner failed to compute the result correctly.