semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Add a function that accepts a chat history (or group chat) object and takes the last N messages

Open madsbolaris opened this issue 1 year ago • 1 comments

The following handlebars template should be possible...

{{messages (topNMessages chatHistory 20)}}

This would render the top 20 messages in the prompt template

madsbolaris avatar Jun 07 '24 12:06 madsbolaris

I saw handlebars was deprecated, and also now all of use use native model plugins, I think we need a pass to pass history into plugin. And also system message

KSemenenko avatar Jul 02 '24 18:07 KSemenenko

This can be done by creating a method and registering with the Kernel

markwallace-microsoft avatar Nov 25 '24 12:11 markwallace-microsoft