-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: implement Chat history, and refactor prompt config/prompt con…
…fig template (#5023) ### Motivation and Context This PR addresses a few of our remaining urgent work items: #4856, #4630. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description In this PR: - The prompt template/prompt template config is refactored to be similar to the dotnet versions. - The KernelPromptTemplate is introduced as the default prompt template (will need to make it more dynamic in the future when we have other prompt templates, like handlebars or jinja2). - The methods related to `create_semantic_function` were removed and it their places a method `create_function_from_prompt` was added. - ChatHistory was introduced as a way to take over what ChatMessage was doing. ChatHistory is passed into the complete chat/text methods. - As of these latest changes, all unit and integration tests are passing. - New kernel examples were added to exercise this new code. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
- Loading branch information
1 parent
52d043b
commit ec02d89
Showing
120 changed files
with
5,242 additions
and
3,019 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
Oops, something went wrong.