Files
semantic-kernel/python/tests
378a1a949c Python: Add Logit-Bias to TextCompletion abstractions (#1880)
### 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.
-->
1. Adds the Logit-Bias feature that is in the C# into Python.
2. It adds the token bias configuration to the text and chat completion
settings.
3. It contributes to flexibility in prompt engineering by allowing the
user to influence the likelihood of specified tokens appearing in the
text and chat completion.
4. Closes #1854 

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
We added a dictionary field called token_selection_biases to the classes
CompleteRequestSettings and ChatRequestSettings to implement logit bias
and included an example to demonstrate functionality.
### 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: sneha <[email protected]>
Co-authored-by: Alisha Maddy <[email protected]>
Co-authored-by: Alisha Maddy <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Sneha <[email protected]>
2023-07-14 00:04:00 +00:00
..
2023-04-13 16:12:36 -07:00