question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Planner does not call expected skills to achieve goal

See original GitHub issue

Hey all,

Love Semantic Kernel, it does a great job of organizing the codebase for LLM apps, and distinction/chaining of Semantic and Native skills is a charm

I’ve tried messing around with the planner to create a small lil star wars themed demo, but the planner itself does not chain or use the correct skills at all. Here is my code

My code:

using Microsoft.SemanticKernel.CoreSkills;
using Microsoft.SemanticKernel.KernelExtensions;
using Microsoft.SemanticKernel.Orchestration;

var kernel = Kernel.Builder.Build();

// For Azure Open AI service endpoint and keys please see
// https://learn.microsoft.com/azure/cognitive-services/openai/quickstart?pivots=rest-api
kernel.Config.AddAzureTextCompletionService(stuff goes here);

// import any other skills or functions ....
var planner = kernel.ImportSkill(new PlannerSkill(kernel));
var chatSkills = kernel.ImportSemanticSkillFromDirectory("Skills", "Chat");

int step = 1;
int maxSteps = 10;
var input = "";

while(true) {
    Console.Write("User: ");
    input = Console.ReadLine();
    step = 1;
    maxSteps = 4;

    if (input.ToLower() == "exit")
    {
        break;
    }

    var result = await kernel.RunAsync(input, planner["CreatePlan"]);

    // Pulled from: https://github.com/microsoft/semantic-kernel/blob/32e35d7c28a40d67bd27d81ddbfe028697c872a7/samples/notebooks/dotnet/5-using-the-planner.ipynb
    var executionResults = result;

    // Execute the plan until it is complete or we reach the maximum number of steps
    while (!executionResults.Variables.ToPlan().IsComplete && step < maxSteps) {
        var results = await kernel.RunAsync(executionResults.Variables, planner["ExecutePlan"]);
        if (results.Variables.ToPlan().IsSuccessful)
        {
            Console.WriteLine($"Step {step} \n");
            Console.WriteLine(results.Variables.ToPlan().PlanString);

            if (results.Variables.ToPlan().IsComplete)
            {
                Console.WriteLine($"Step {step} - COMPLETE!");
                Console.WriteLine("C-3PO: " + results.Variables.ToPlan().Result);
                break;
            }
        }
        else
        {
            Console.WriteLine($"Step {step} - Execution failed!");
            Console.WriteLine(results.Variables.ToPlan().Result);
            break;
        }
        
        executionResults = results;
        step++;
    }
}

Console.WriteLine("Program ended.");

I have two skills I am trying this out with:

  • FindStarTrip
  • YodaSpeak

From my understanding the planner leverages the function description to decide which skills to use

FindStarTrip description: “Help the user find a star trips between locations”

YodaSpeak description: “Translate a sentence from the user to Yoda-speak”

No matter what the user input is, the Planner only ever calls YodaSpeak

Whats going on here? And if I should be called a different built-in Planner skill or using the Planner in a different way could the docs be updated to reflect that?

Thanks!

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
BIZZLETONCcommented, Apr 21, 2023

After installing the missing dependency, try running the Semantic Kernel again and see if the issues been resolved

3reactions
BIZZLETONCcommented, Apr 21, 2023

Seems like the error is caused by a missing dependency libffi-dev.try to install libffi-dev like so

On Ubuntu/Debian/Linux Mint:

sudo apt-get install libffi-dev

On Fedora:

sudo dnf install libffi-devel

On CentOS/RHEL:

sudo yum install libffi-devel

Read more comments on GitHub >

github_iconTop Results From Across the Web

`Planner` selected a wrong skill when there are two similar ...
Planner selected a wrong skill when there are two similar skills within a skills folder #211.
Read more >
9 Key Time Management Skills and How To Improve Them
1. Set short and long-term goals ... Practicing regular goal-setting can help you clearly understand exactly what you need to accomplish to ...
Read more >
How to automatically orchestrate AI with planner
Learn how to automatically create chains of functions with planner.
Read more >
SMART Goals - How to Make Your Goals Achievable
Set SMART goals to clarify your ideas, focus your efforts, use your time and resources productively, and achieve what you want at work...
Read more >
SMART Goals: A How to Guide
This focuses on how important a goal is to you and what you can do to make it attainable and may require developing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found