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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for OpenApiSkillsExample #1738

Merged
merged 2 commits into from
Jun 28, 2023
Merged

Conversation

gitri-ms
Copy link
Contributor

Motivation and Context

Fix for issue #1336 - When the token limit is exceeded, we unintentionally remove the system prompt from the chat history in order to remain under the token limit. Also addresses a couple other small issues with this sample.

Description

  • Remove chat history items beginning with index 1, so that the system prompt (index 0) remains in the chat history.
  • Fix a naming mismatch in the configuration - the code looks for TokenLimit not CompletionTokenLimit
  • Add UserSecretsId property to the csproj file so users won't need to run dotnet user-secrets init themselves.

Contribution Checklist

@gitri-ms gitri-ms added PR: ready for review All feedback addressed, ready for reviews samples labels Jun 27, 2023
@gitri-ms gitri-ms self-assigned this Jun 27, 2023
@gitri-ms gitri-ms requested a review from a team as a code owner June 27, 2023 23:39
@github-actions github-actions bot added the .NET Issue or Pull requests regarding .NET code label Jun 27, 2023
@dmytrostruk dmytrostruk added the PR: ready to merge PR has been approved by all reviewers, and is ready to merge. label Jun 28, 2023
@alliscode alliscode added this pull request to the merge queue Jun 28, 2023
Merged via the queue into microsoft:main with commit d10fb87 Jun 28, 2023
10 checks passed
@evchaki evchaki added this to the Sprint 34 milestone Jun 30, 2023
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Motivation and Context
<!-- 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.
-->
Fix for issue microsoft#1336 - When the token limit is exceeded, we
unintentionally remove the system prompt from the chat history in order
to remain under the token limit. Also addresses a couple other small
issues with this sample.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- Remove chat history items beginning with index 1, so that the system
prompt (index 0) remains in the chat history.
- Fix a naming mismatch in the configuration - the code looks for
`TokenLimit` not `CompletionTokenLimit`
- Add `UserSecretsId` property to the csproj file so users won't need to
run `dotnet user-secrets init` themselves.

### 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 馃槃
@gitri-ms gitri-ms deleted the openapi-skill-sample branch September 5, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

OpenAPI skills dotnet sample removes the system prompt from chat history when token limit is exceeded.
4 participants