How to pass additional data while calling InvokeStreamingAsync() method? #6913
-
Hi Team, We have implementation of our own Chat Completion service. When we call a native prompt based function, using SK's InvokeStreamingAsync() method, this in turn is calling our custom implementation of GetStreamingChatCompletionAsync() API. Here, I would like to pass some additional data to GetStreamingChatCompletionAsync() method. One approach can be Kernel's data. But, kernel being singleton object, it can cause multi-threading issues. Is there any solution for this issue?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's not a singleton unless you're creating/registering it as such. The AddKernel method registers it as transient, for reasons like this. |
Beta Was this translation helpful? Give feedback.
-
Thank you. This helps. |
Beta Was this translation helpful? Give feedback.
It's not a singleton unless you're creating/registering it as such. The AddKernel method registers it as transient, for reasons like this.