I need your suggestions on implementing a scenario in handlebar planners.
When I get a request on a particular format, I need to override the planners that is getting created by default. Sample below.
if (Regex.IsMatch(UserPrompt, "myregex pattern"))
{
plan = new HandlebarsPlan(OverrideTemplate());
}
else
{
plan = await planner.CreatePlanAsync(Kernel, UserPrompt);
}
plan.InvokeAsync(Kernel, []);
My OverrideTemplate Functionlooks like this.
public string OverrideTemplate()
{
string template =
@"
{{set ""StudentDetails"" (StudentPlugin-GetStudentDetails studentId)}}
.. other related plugin calls.
{{concat StudentDetails ... json }}";
return template;
}
My prompts would be something like this.
- Get the details of studentid 123
- complete information of Studentid 123
- studentid 123 details
I need to extract hte value 123 alone from the prompt and set it in my planner so that the kernelfunction GetStudentDetails in Student plugin gets the correct value. How can I set the studentid in my planner from teh given prompt.