You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.Net [ChatRoles] 1. Convert SK templating engine chat role syntax to intermediate SK format #3250
As an engineer working on SK,
I want templating engines to generate an intermediate format for chat roles,
So that subsequent components (such as semantic functions or connectors) can recognize it and map it to chat messages or history
Scope:
Create ADR and present it to the team.
Collect feedback and implement the conversion functionality in the 'BasicPromptTemplateEngine' class.
Context
Today, various templating engines have their unique syntax and may represent chat completion roles in a manner specific to the engine's syntax:
To prevent the handling of templating engine-specific syntax in other SK components besides the prompt template, we need a mechanism to map templating engine-specific syntax to the SK format. For example, if the SK prompt uses syntax like:
Handlebars: "{{#system}}You are a banker.{{/system}}"
Jinja2: "system: You are a banker"
Then it should be converted to the SK format, so that the resulting prompt, as it will be described in the ADR, looks like "<role:system>You are a banker.<role:system>." This way, the other SK components (connectors?) participating in the semantic function execution can rely on a well-defined format to extract those roles from the rendered prompt and map them to chat messages for chat completion APIs.
changed the title [-].Net [ChatRoles] Convert templating engune chat role syntax to intermediate SK format[/-][+].Net [ChatRoles] Convert SK templating engine chat role syntax to intermediate SK format[/+]on Oct 23, 2023
changed the title [-].Net [ChatRoles] Convert SK templating engine chat role syntax to intermediate SK format[/-][+].Net [ChatRoles] 1. Convert SK templating engine chat role syntax to intermediate SK format[/+]on Oct 27, 2023
Activity
[-].Net [ChatRoles] Convert templating engune chat role syntax to intermediate SK format[/-][+].Net [ChatRoles] Convert SK templating engine chat role syntax to intermediate SK format[/+]SergeyMenshykh commentedon Oct 23, 2023
Parent - #2673
ADR - https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0014-chat-completion-roles-in-prompt.md
[-].Net [ChatRoles] Convert SK templating engine chat role syntax to intermediate SK format[/-][+].Net [ChatRoles] 1. Convert SK templating engine chat role syntax to intermediate SK format[/+]