Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: API support for multiple chat roles for Chat completion APIs #2673

Closed
1 task done
Tracked by #3133
nacharya1 opened this issue Aug 31, 2023 · 7 comments
Closed
1 task done
Tracked by #3133

.Net: API support for multiple chat roles for Chat completion APIs #2673

nacharya1 opened this issue Aug 31, 2023 · 7 comments
Assignees
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Milestone

Comments

@nacharya1
Copy link
Contributor

nacharya1 commented Aug 31, 2023

Important

Labeled Urgent because it will require a breaking change.

This issue should just provide API-level support. Another issue will be created (and linked) for the actual template support. This API support should be exposed to the template engine so that it can call those APIs and return an array of chat messages.

name: Feature request
about: Suggest an idea for this project
We currently have a lack of SK Functions based on Chat prompts (e.g. instead of a single text prompt, a function is based on a mix of chat messages, where each message needs to be rendered, before calling the LLM.
Needed by Devis and memory service.

Tasks

Preview Give feedback
@nacharya1 nacharya1 moved this to Backlog - New features in Semantic Kernel Aug 31, 2023
@nacharya1 nacharya1 added enhancement kernel Issues or pull requests impacting the core kernel labels Aug 31, 2023
@nacharya1 nacharya1 modified the milestones: R3 : Cycle 2, R3: Cycle 3 Aug 31, 2023
@evchaki evchaki added sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) and removed triage labels Sep 5, 2023
@nacharya1 nacharya1 removed the status in Semantic Kernel Sep 7, 2023
@nacharya1 nacharya1 moved this to Backlog - Memory in Semantic Kernel Sep 7, 2023
@markwallace-microsoft markwallace-microsoft moved this from Backlog - Memory to Backlog - New features in Semantic Kernel Oct 10, 2023
@matthewbolanos matthewbolanos changed the title Add SK Functions based on Chat prompts Support multiple chat roles for Chat completion APIs Oct 10, 2023
@matthewbolanos
Copy link
Member

You should be able to author a semantic function that has multiple messages with arbitrary roles (system, assistant, and user)

@matthewbolanos
Copy link
Member

matthewbolanos commented Oct 11, 2023

In Prompt flow, they achieve this by having role tags in the template file (e.g., "system:", "user:", "assistant"). SK should do something similar.

Image

@matthewbolanos matthewbolanos changed the title Support multiple chat roles for Chat completion APIs .Net: Support multiple chat roles for Chat completion APIs Oct 11, 2023
@matthewbolanos
Copy link
Member

This is how Guidance does it

Image

@matthewbolanos matthewbolanos changed the title .Net: Support multiple chat roles for Chat completion APIs .Net: API support for multiple chat roles for Chat completion APIs Oct 12, 2023
@matthewbolanos
Copy link
Member

There needs to be a second issue with "high" priority for the actual template language.

@matthewbolanos
Copy link
Member

We believe the only "net new" work is allowing the template engine to return an array of messages if the connection is "chat". If the connection is "text" then the template engine does not need to break it up into multiple messages.

@matthewbolanos matthewbolanos modified the milestones: R3: Cycle 3, v1.0.0 Oct 12, 2023
@markwallace-microsoft markwallace-microsoft moved this from Backlog - New features to Sprint: In Progress in Semantic Kernel Oct 13, 2023
@SergeyMenshykh SergeyMenshykh moved this from Sprint: In Progress to Sprint: Planned in Semantic Kernel Oct 23, 2023
@SergeyMenshykh
Copy link
Member

The feature requires a few SK components to be changed, so it has been split into three smaller ones to tackle each component separately:

@matthewbolanos
Copy link
Member

matthewbolanos commented Nov 28, 2023

Marking as complete because the intermediate template now supports chat messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Archived in project
Development

No branches or pull requests

8 participants
@matthewbolanos @dmytrostruk @shawncal @evchaki @nacharya1 @SergeyMenshykh @markwallace-microsoft and others