Open N-E-W-T-O-N opened 1 week ago
Skill/kernel function
public class ConsoleSkill : ISpeechSkill
{
private bool _isGoodbye = false;
/// <summary>
/// Gets input from the console
/// </summary>
[KernelFunction("Get console input.")]
[Description("Listen")]
public Task<string> Listen()
{
return Task.Run(() =>
{
var line = "";
while (string.IsNullOrWhiteSpace(line))
{
line = Console.ReadLine();
}
if (line.ToLower().StartsWith("goodbye"))
_isGoodbye = true;
return line;
});
}
/// <summary>
/// Writes output to the console
/// </summary>
[Description("Write a response to the console.")]
[KernelFunction("Respond")]
public Task<string> Respond(string message)
{
return Task.Run(() =>
{
WriteAIResponse(message);
return message;
});
}
/// <summary>
/// Checks if the user said goodbye
/// </summary>
[Description("Did the user say goodbye.")]
[KernelFunction("IsGoodbye")]
public Task<string> IsGoodbye()
{
return Task.FromResult(_isGoodbye ? "true" : "false");
}
/// <summary>
/// Write a response to the console in green.
/// </summary>
private void WriteAIResponse(string response)
{
// Write the response in Green, then revert the console color
var oldColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(response);
Console.ForegroundColor = oldColor;
}
Describe the bug Unable TO Get Correct Response from Pipling method
I have implemented Pipling Method . Now the Issue is only the first Function 'Listen' is only Executing
Git Code
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Platform