OrchestratorPlugin class would crash when the intent is "Multiply"
sramaswami11 opened this issue · comments
Please refer to the following doc page:
https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/plugins/native-functions/calling-nested-functions?tabs=Csharp
The csharp code under this page (in the Putting it all together section) as well as in the github code orchestrator.cs will cause the application to crash due to an iinvalid cast exception when the intent evaluates to "Multiply"
Here are the details:
System.InvalidCastException
HResult=0x80004002
Message=Cannot cast System.String to System.Double
Source=Microsoft.SemanticKernel.Abstractions
StackTrace:
at Microsoft.SemanticKernel.Orchestration.KernelResult.GetValueT
at SKPrompts.Plugins.OrchestratorPlugin.Orchestrator.d__2.MoveNext() in C:\Siva\Projects\SemanticKernel\SKPrompts\SKPrompts\Plugins\OrchestratorPlugin\OrchestratorPlugin.cs:line 61
at Microsoft.SemanticKernel.NativeFunction.<>c.<b__35_7>d.MoveNext()
at Microsoft.SemanticKernel.NativeFunction.d__18.MoveNext()
at Microsoft.SemanticKernel.Kernel.d__21.MoveNext()
at Program.<
The code that causes this exception is in Orchestrator.cs line#58
return result.GetValue()!.ToString();
This line needs to be changed to
return result.GetValue()!.ToString(); //same as line#48
Thank you, I suspect this is related to the rapid SK march thru beta towards release (currently beta-3: https://github.com/microsoft/semantic-kernel/releases/tag/dotnet-1.0.0-beta3)
I'll see if we can't get some hygiene scheduled.