-
Notifications
You must be signed in to change notification settings - Fork 3k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chat system prompt option for text completion #1465
Merged
lemillermicrosoft
merged 2 commits into
microsoft:main
from
lemillermicrosoft:613_text_as_chat
Jun 15, 2023
Merged
Add chat system prompt option for text completion #1465
lemillermicrosoft
merged 2 commits into
microsoft:main
from
lemillermicrosoft:613_text_as_chat
Jun 15, 2023
Conversation
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
Greatly helps scenarios like #1472 |
5 tasks
shawncal
approved these changes
Jun 14, 2023
This commit adds a new property to the CompleteRequestSettings class that allows specifying a custom system prompt to use when generating text completions using a chat model. This can be useful for setting the tone and context of the conversation. The default value is "Assistant is a large language model." which is the same as the OpenAI API. The commit also modifies the ClientBase class to pass the chat system prompt to the InternalCreateNewChat method, which creates a new instance of the OpenAIChatHistory class. This way, the chat history will include the system prompt as the first message.
365ab76
to
abd2822
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 26, 2023
### Motivation and Context This pull request adds a new extension for semantic planning using a stepwise approach. The StepwisePlanner extension allows users to create and execute plans that consist of a sequence of semantic and native functions, each with a goal and a set of inputs and outputs. The extension uses a semantic search engine to find relevant functions for each step, and a plan creation service to generate a plan that satisfies the user's ask. The extension also provides a system step function that executes the plan and returns the final answer and intermediate observations. The extension can be configured with various parameters, such as the relevancy threshold, the maximum number of relevant functions, the excluded and included functions and skills, and the maximum number of tokens, iterations, and time for the plan. Regarding #1472 ### Description - Add StepwisePlanner.cs, which registers the planner native functions and the system step function - Add StepwisePlannerConfig.cs, which defines the configuration options for the StepwisePlanner extension - Add SystemStep.cs, which represents a step in a Stepwise plan, with properties for the thought, action, action variables, observation, final answer, and original response - Add helper methods for formatting and validating function views, generating plan requests, and invoking the plan. - Add logging and error handling for the planner extension - Add unit tests for the planner extension and the native functions ### Related - Majority of work initially started from @kaza in #992 ### Changes in other PRs to merge separately - #1464 - #1465 - #1466 ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 馃槃 --------- Co-authored-by: Almir Kazazic <kaza@users.noreply.github.com> --------- Co-authored-by: Lee Miller <lemillermicrosoft@users.noreply.github.com>
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
This change adds a new property to the CompleteRequestSettings class that allows specifying a custom system prompt to use when generating text completions using a chat model. This can be useful for setting the tone and context of the conversation. The default value is "Assistant is a large language model." which is the same as the OpenAI API. The change also modifies the ClientBase class to pass the chat system prompt to the InternalCreateNewChat method, which creates a new instance of the OpenAIChatHistory class. This way, the chat history will include the system prompt as the first message. Co-authored-by: Lee Miller <lemillermicrosoft@users.noreply.github.com>
shawncal
pushed a commit
to shawncal/semantic-kernel
that referenced
this pull request
Jul 6, 2023
### Motivation and Context This pull request adds a new extension for semantic planning using a stepwise approach. The StepwisePlanner extension allows users to create and execute plans that consist of a sequence of semantic and native functions, each with a goal and a set of inputs and outputs. The extension uses a semantic search engine to find relevant functions for each step, and a plan creation service to generate a plan that satisfies the user's ask. The extension also provides a system step function that executes the plan and returns the final answer and intermediate observations. The extension can be configured with various parameters, such as the relevancy threshold, the maximum number of relevant functions, the excluded and included functions and skills, and the maximum number of tokens, iterations, and time for the plan. Regarding microsoft#1472 ### Description - Add StepwisePlanner.cs, which registers the planner native functions and the system step function - Add StepwisePlannerConfig.cs, which defines the configuration options for the StepwisePlanner extension - Add SystemStep.cs, which represents a step in a Stepwise plan, with properties for the thought, action, action variables, observation, final answer, and original response - Add helper methods for formatting and validating function views, generating plan requests, and invoking the plan. - Add logging and error handling for the planner extension - Add unit tests for the planner extension and the native functions ### Related - Majority of work initially started from @kaza in microsoft#992 ### Changes in other PRs to merge separately - microsoft#1464 - microsoft#1465 - microsoft#1466 ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 馃槃 --------- Co-authored-by: Almir Kazazic <kaza@users.noreply.github.com> --------- Co-authored-by: Lee Miller <lemillermicrosoft@users.noreply.github.com>
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
PR: ready for review
All feedback addressed, ready for reviews
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a new property to the CompleteRequestSettings class that allows specifying a custom system prompt to use when generating text completions using a chat model. This can be useful for setting the tone and context of the conversation. The default value is "Assistant is a large language model." which is the same as the OpenAI API.
The change also modifies the ClientBase class to pass the chat system prompt to the InternalCreateNewChat method, which creates a new instance of the OpenAIChatHistory class. This way, the chat history will include the system prompt as the first message.
Contribution Checklist
dotnet format