-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up some things in LiquidPromptTemplate and PromptyKernelExtensions
- Liquid template parsing should happen during construction, not on each render - Liquid prompt template construction should fail for invalid templates - Default inputs should be evaluated once at Liquid template construction time - RenderAsync should capture any exceptions into returned Task - Role regex used in parsing rendered messages should be Compiled - LiquidPromptTemplateFactory should do arg validation and accomodate a PromptTemplateConfig whose TemplateFormat is null - Use XML comments instead of normal comments to describe properties in internal DOM - Remove unnecessary empty primary constructor - Use a regex to parse the components of a prompty template in order to a) more strictly validate contents but more importantly b) avoid losing part of the template when the separator appears in the contents itself - Clean up some XML comments - Set ModelId appropriately for openai - Avoid storing temperature/top_p in execution settings if they weren't specified - Add an OutputVariable if the prompty specifies one - Cache the default template factory rather than creating a new one on each construction
- Loading branch information
1 parent
513f0b0
commit 2c8c7ca
Showing
7 changed files
with
273 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.