MicrosoftDocs / semantic-kernel-docs

Semantic Kernel (SK) is a lightweight SDK enabling integration of AI Large Language Models (LLMs) with conventional programming languages.
MIT License
173 stars 100 forks source link

Problem with creating semantic functions inline... #53

Open sramaswami11 opened 8 months ago

sramaswami11 commented 8 months ago

Please refer to the document at the following url: https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/plugins/semantic-functions/inline-semantic-functions?tabs=Csharp

When I am trying to create a semantic function inline, the code given in the documentation url above does not work: Specifically, in the following code: var promptConfig = new PromptTemplateConfig { Schema = 1, Type = "completion", Description = "Gets the intent of the user.", Completion = { MaxTokens = 500, Temperature = 0.0, TopP = 0.0, PresencePenalty = 0.0, FrequencyPenalty = 0.0 }, Input = { Parameters = new List { new InputParameter { Name = "input", Description = "The user's request.", DefaultValue = "" } } } };

I get syntax errors for the following : MaxTokens, Temperature, TopP, PresencePenalty, FrequencyPenalty

Error CS0117 'AIRequestSettings' does not contain a definition for 'MaxTokens' etc...

I am using microsoft.semantickernel\1.0.0-beta2\

crickman commented 8 months ago

Thank you for reporting this. I apologies for this confusion. It appears this has been refactored after publishing the beta2 package. The current version in the git repo defines this class as part of SemanticKernel.Core (Microsoft.SemanticKernel.Core.dll).

But for beta2, it appears it was pushed into the Microsoft.SemanticKernel.Functions.Semantic.nuget package (which has been subsequently removed). To unblock immediately, you can reference this additional package.

This nuget package and git repo should align with docs as part of the next beta release.

crickman commented 8 months ago

https://github.com/microsoft/semantic-kernel/issues/3173

sramaswami11 commented 8 months ago

Thanks for the response Chris, I will try that later. BTWI was also trying to use the code in the docs where context parameters are used to pass multiple inputs as shown in the url below: https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/plugins/native-functions/multiple-parameters?tabs=Csharp and I am running into syntax errors related to SKParameter not being recognized, the error is:

Error CS0246 The type or namespace name 'SKParameter' could not be found (are you missing a using directive or an assembly reference?) SKPrompts C:\Siva\Projects\SemanticKernel\SKPrompts\SKPrompts\Plugins\MathPlugin\Math.cs 19 Active Lemme know if you need me to create a separate issue for this.

Thanks

crickman commented 8 months ago

Beta3 is available: https://github.com/microsoft/semantic-kernel/releases/tag/dotnet-1.0.0-beta3

sramaswami11 commented 8 months ago

Just curious, is semantic kernel going to GA status in November with the release of .net 8.0? Thanks

On Wed, Oct 25, 2023, 5:05 PM Chris @.***> wrote:

Beta3 is available: https://github.com/microsoft/semantic-kernel/releases/tag/dotnet-1.0.0-beta3

— Reply to this email directly, view it on GitHub https://github.com/MicrosoftDocs/semantic-kernel-docs/issues/53#issuecomment-1780054533, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHYIQDYE36SHRLFSABOKXTYBF5IRAVCNFSM6AAAAAA6KRHWEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBQGA2TINJTGM . You are receiving this because you authored the thread.Message ID: @.***>