Skip to content
Discussion options

You must be logged in to vote

Hi @idlemind !

What's the most efficient way of instantiating and instance of the kernel per chat session? I doubt instantiating a new instance per web request is a great idea?

Kernel is a lightweight object, so it should be safe to initialize a new instance as Scoped (per request) or Transient (per object).

There is an extension method to easily add Kernel to your application, and we add it as Transient by default:

public static IKernelBuilder AddKernel(this IServiceCollection services)
{
Verify.NotNull(services);
// Register a K…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@idlemind
Comment options

Answer selected by idlemind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants