-
Notifications
You must be signed in to change notification settings - Fork 3.7k
.Net: Error on "kernel.RunAsync" #4009
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
Comments
Same here, I tried to follow the Learning site but those code samples are not working, looks like a lot of methods have been changed, including the import plugins and RunAsync, can anyone update the documents please? |
Yes, we'll be updating all of the documents on learn.microsoft.com to reflect all of the name changes. They should be entirely updated by Monday. |
Examples and notebooks are also not updated after the massive breaking changes in RC1 and RC2. This makes the transition very difficult and frustrating. These breaking changes are also not properly documented nor described in issues and difficult to find in commits and pull requests. |
Yes, I am experiencing the same issue. I am sure they would fix it soon btw |
We are actively working on updating all of our documentation. In the meantime, we recommend that folks leverage the KernelSyntaxExamples: https://github.com/microsoft/semantic-kernel/tree/main/dotnet/samples/KernelSyntaxExamples All of these samples are up-to-date with the latest changes. |
Closing this since the docs have now been updated. |
Describe the bug
Hello, i have trouble getting Semantic Kernel running.
the kernel is initialized like this:
var builder = new KernelBuilder();
builder.WithAzureOpenAIChatCompletionService(
"gpt-4-turbo", // Azure OpenAI Deployment Name
"xyz", // Azure OpenAI Endpoint
"xyz"); // Azure OpenAI Key
kernel = builder.Build();
This is my plan: I have 2 sources of functions: a class "CaseManagement", where every function is tagged with [SKFunction]. The other source is a "ChatFunction", that looks like this:
var chatPrompt = @"User: {{$input}}. Assistant: ";
ISKFunction chatFunction = kernel.CreateSemanticFunction(chatPrompt, new OpenAIRequestSettings { ChatSystemPrompt = systemPrompt, ModelId = "gpt-4-turbo" });
The CaseManagement Functions are imported like this:
kernel.ImportFunctions(new BackofficeWorkerAiConsole.Plugins.CaseManagement.CaseManagement(), "CaseManagement");
And the chatFunction is added like this:
kernel.RegisterCustomFunction(chatFunction);
Now when inspecting the kernel afterwards, the chat function does not show up:
(oh i can not paste screenshots? okay nevermind)
So that is the first problem. What do i do wrong with loading the function?
And the actual problem with the planner, when i run this code:
var planner = new StepwisePlanner(kernel);
var plan = planner.CreatePlan(text);
Console.WriteLine(JsonSerializer.Serialize(plan, new JsonSerializerOptions { WriteIndented = true }));
var result = await kernel.RunAsync(plan);
I get this error on "kernel.RunAsync":
System.MissingMethodException: 'Method not found: 'System.Threading.Tasks.Task1<Azure.Response1<Azure.AI.OpenAI.ChatCompletions>> Azure.AI.OpenAI.OpenAIClient.GetChatCompletionsAsync(System.String, Azure.AI.OpenAI.ChatCompletionsOptions, System.Threading.CancellationToken)'.'
I tried to follow the "Microsoft Learn" pages to stich this together, but i feel like i miss something. What am i missing?
The text was updated successfully, but these errors were encountered: