Replies: 1 comment 2 replies
-
You could use the Something like this: var clonedKernel = kernel.Clone();
clonedKernel.Data["userId"] = "123";
// Use the clonedKernel, for example using IChatCompletionService
var completionService = clonedKernel.GetRequiredService<IChatCompletionService>();
... And in any plugin: [KernelFunction]
public Task DoSomethingAsync(Kernel kernel, ...)
{
var userId = kernel.Data["userId"]
...
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to inject context, such as the user id associated to the current HTTP request. Is that possible with SK .NET?
I could try to do that by adding a userId parameter in my function and pass it in the prompt but that wouldn't be as reliable as fetching it from the context.
Beta Was this translation helpful? Give feedback.
All reactions