Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrchestratorPlugin class would crash when the intent is "Multiply" #54

Open
sramaswami11 opened this issue Oct 24, 2023 · 1 comment
Open

Comments

@sramaswami11
Copy link

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.<

$>d__0.MoveNext() in C:\XXX\Program.cs:line 48

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

@crickman
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants