You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to ask the user for some information while executing a plan? #6014
var _kernel = Kernel.CreateBuilder().AddOpenAIChatCompletion("gpt-3.5-turbo", openAiApiKey, openAiOrg).Build();
_kernel.Plugins.AddFromType<CinemaPlugin>();
while (true)
{
Console.WriteLine("User > ");
var userinput = Console.ReadLine();
if (userinput == "exit")
break;
#pragma warning disable SKEXP0060 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
var planner = new FunctionCallingStepwisePlanner(new FunctionCallingStepwisePlannerOptions()
{
MaxIterations = 1
});
var result = await planner.ExecuteAsync(_kernel, userinput);
var content = result.FinalAnswer;
Console.WriteLine($"Assistant > {content}");
#pragma warning restore SKEXP0060 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
}
I have a plugin with a few methods that will be used to make a movie reservation.
The generated plan is ok:
Original request: how to make a movie reservation?
You are in the process of helping the user fulfill this request using the following plan:
Use CinemaPlugin-GetAvailableMovies function to get the list of available movies for the desired date.
Use CinemaPlugin-MakeReservation function to prepare a reservation for the selected movie, date, and number of seats.
Confirm the reservation by using CinemaPlugin-ConfirmReservation function with the selected movie, date, and number of seats.
Send the final answer to the user confirming the successful reservation using UserInteraction-SendFinalAnswer function.
The user will ask you for help with each step.
As you can see I have ask it how to make a reservation and it figured out how to do it but the FinalAnswer of the planner is an empty string.
What can I do to make it ask me for an input?
Since I have not provided a date for a movie it should ask me for a date. When the user provides a date it can call GetAvailableMovies function to get a list of the movies.
Now the user should pick one from the list. Since we have a date and a movie it can try to make a resevation etc.
+1 :), exact same question/scenario I have. Especially when the plan can contain OpenAI Plugins, which we don't know upfront which parameters are required
Activity
iBoonz commentedon Apr 29, 2024
+1 :), exact same question/scenario I have. Especially when the plan can contain OpenAI Plugins, which we don't know upfront which parameters are required