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

.Net: Could not load type 'Microsoft.SemanticKernel.Orchestration.SKContext' from assembly #4138

Closed
Alerinos opened this issue Dec 10, 2023 · 8 comments
Assignees
Labels
.NET Issue or Pull requests regarding .NET code

Comments

@Alerinos
Copy link

Error:

System.Reflection.ReflectionTypeLoadException: „Unable to load one or more of the requested types.
Could not load type 'Microsoft.SemanticKernel.Orchestration.SKContext' from assembly 'Microsoft.SemanticKernel.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'.
Could not load type 'Microsoft.SemanticKernel.Orchestration.SKContext' from assembly 'Microsoft.SemanticKernel.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'.”

Same error as with SqlClient:
dotnet/SqlClient#1930

@shawncal shawncal added .NET Issue or Pull requests regarding .NET code triage labels Dec 10, 2023
@github-actions github-actions bot changed the title Could not load type 'Microsoft.SemanticKernel.Orchestration.SKContext' from assembly .Net: Could not load type 'Microsoft.SemanticKernel.Orchestration.SKContext' from assembly Dec 10, 2023
@dmytrostruk
Copy link
Member

Hi @Alerinos ! SKContext class has been removed starting from RC version of Semantic Kernel. In short, if you want to set variables for your prompts, you can use KernelArguments class.

This document contains list of recent changes in SK:
https://devblogs.microsoft.com/semantic-kernel/release-candidate-1-for-the-semantic-kernel-net-sdk-is-now-live/

By following link, you can find dotnet notebooks with usage examples:
https://github.com/microsoft/semantic-kernel/tree/main/dotnet/notebooks

If you have a specific scenario and need an assistance, please let us know. Thank you!

@Alerinos
Copy link
Author

Hi @dmytrostruk, Here is a compatibility problem with .net 8 and assembly. The same problem has been described by me and others in the SQL repository. Below is the PR that fixes the problem, probably many people will have the same problem as me.

dotnet/SqlClient#1934

@dmytrostruk
Copy link
Member

@Alerinos Could you please share more details about error including:

  1. Code sample
  2. Version of Semantic Kernel.
  3. Version of .NET.

Thank you!

@strikene
Copy link

Hi @Alerinos ! SKContext class has been removed starting from RC version of Semantic Kernel. In short, if you want to set variables for your prompts, you can use KernelArguments class.

This document contains list of recent changes in SK: https://devblogs.microsoft.com/semantic-kernel/release-candidate-1-for-the-semantic-kernel-net-sdk-is-now-live/

By following link, you can find dotnet notebooks with usage examples: https://github.com/microsoft/semantic-kernel/tree/main/dotnet/notebooks

If you have a specific scenario and need an assistance, please let us know. Thank you!

I wonder if Microsoft.SemanticKernel.TemplateEngine.IPromptTemplate in Beta8 has a replacement in RC3 or has been deprecated.
We are trying to upgrade from Beta8 to RC3 However, we are getting all sorts of compiler errors like never before, FunctionResult, SKContext, IPromptTemplate, SequentialPlanner, ISKFunction, KernelResult...

@dmytrostruk
Copy link
Member

I wonder if Microsoft.SemanticKernel.TemplateEngine.IPromptTemplate in Beta8 has a replacement in RC3 or has been deprecated.

@strikene You can find it under root namespace - Microsoft.SemanticKernel:

namespace Microsoft.SemanticKernel;
/// <summary>
/// Interface for prompt template.
/// </summary>
public interface IPromptTemplate

We are trying to upgrade from Beta8 to RC3 However, we are getting all sorts of compiler errors like never before, FunctionResult, SKContext, IPromptTemplate, SequentialPlanner, ISKFunction, KernelResult...

Yes, the migration from beta to RC is harder than usual due to big number of new changes and improvements. As we are preparing to v1 release, we want to make sure that each functionality in SK provides best value for our users.

@strikene
Copy link

I wonder if Microsoft.SemanticKernel.TemplateEngine.IPromptTemplate in Beta8 has a replacement in RC3 or has been deprecated.

@strikene You can find it under root namespace - :Microsoft.SemanticKernel

namespace Microsoft.SemanticKernel;
/// <summary>
/// Interface for prompt template.
/// </summary>
public interface IPromptTemplate

We are trying to upgrade from Beta8 to RC3 However, we are getting all sorts of compiler errors like never before, FunctionResult, SKContext, IPromptTemplate, SequentialPlanner, ISKFunction, KernelResult...

Yes, the migration from beta to RC is harder than usual due to big number of new changes and improvements. As we are preparing to v1 release, we want to make sure that each functionality in SK provides best value for our users.

Thank you for your help, it saved me a lot of time. I also have a tricky question

We've created a function on Beta8 that breaks down complex actions into single steps, and we'll output individual steps. Then create a plan with a separate step using 'SequentialPlanner', which works great. It avoids the 'model hallucination' when multiple functions are selected

For a single plan created, it is actually the result of the previous plan that he uses when he executes it. It's easy to use SKContext to pass the variables of the previous step in a single step. Experimentally, this method is great for creating complex tasks with 'memory', but after upgrading the RC3 it seems that 'handlebar' does not provide such a way to allow us to pass on the results of the previous plan, as this result can be very large or even more than 32k.
Because 'handlebars' create variables in the plan, there is no way to change its value externally. I don't know what I should do at this point. On the one hand, 'handlebars' are indeed suitable for creating complex tasks, but if the task itself does not mention any function-related information, it is difficult to choose the function correctly, for example: I need to buy paint, my house length, width and height, the unit price of paint, I need to calculate the price of paint. At this point, we break down the task and give some guidance, so that the AI can choose the correct Math function.

@dmytrostruk
Copy link
Member

@strikene Could you please share some code examples which will demonstrate the use case and what is missing in current implementation? That would be very helpful, thanks a lot!

@dmytrostruk
Copy link
Member

Closing this issue, as response to initial question was provided. Feel free to create another issue if some of the listed problems are unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

No branches or pull requests

5 participants