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: Markdown prompt support (without tool call support) #5961

Conversation

LittleLittleCloud
Copy link
Contributor

@LittleLittleCloud LittleLittleCloud commented Apr 22, 2024

Motivation and Context

Description

This PR brings markdown prompt template support for semantic kernel. It essentially does a code-level copy of the original markdown prompt template implementation to the sk repo, plus an extension API to execute the template.

Because the markdown prompt template support is still in an very, very early stage. All code is put under Experimental namespace and all the class except the extension API is marked as internal only.

You can find the spec for the markdown prompt template here

The intergration comes with two projects

  • PromptTemplates.Liquid: liquid syntax support for the markdown prompt template, which renders liquid-like template into the chat format that can be processed by ChatPromptParser
  • Function.Prompty: load and create KernelFunctionFromPrompt from prompty file via CreateFunctionFromPrompty API

The tool call support will come in the next PR as this PR is already growing large. Also tool call support needs some extra care which might need further discussion on how to implement cohere to sk pattern

Contribution Checklist

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Apr 22, 2024
@github-actions github-actions bot changed the title [.Net] [WIP] Markdown prompt support .Net: [.Net] [WIP] Markdown prompt support Apr 22, 2024
@LittleLittleCloud LittleLittleCloud changed the title .Net: [.Net] [WIP] Markdown prompt support .Net: [WIP] Markdown prompt support Apr 22, 2024
@markwallace-microsoft markwallace-microsoft self-assigned this Apr 24, 2024
@LittleLittleCloud LittleLittleCloud marked this pull request as ready for review April 25, 2024 00:13
@LittleLittleCloud LittleLittleCloud requested a review from a team as a code owner April 25, 2024 00:13
@LittleLittleCloud LittleLittleCloud changed the title .Net: [WIP] Markdown prompt support .Net: Markdown prompt support (without tool call support) Apr 25, 2024
public string? AzureDeployment { get; set; }

[YamlMember(Alias = "api_key")]
public string? ApiKey { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this information really put into a prompty file?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information would tie a Prompty file to one particular deployment. These will change frequently as new models emerge and these artifacts should be easily transferable to other contexts e.g. a Prompty file the Data Scientists developed should be transferable to another team to deploy. Or if I'm building a product my Prompty files should run with any customer deployment.
In our YAML file we include the model configuration i.e. temperature, top_p, ... but not the model deployment, that is treated as a seperate concern.

@markwallace-microsoft markwallace-microsoft merged commit 09778cd into microsoft:feature-prompty Apr 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants