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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version 8.1.3 - Introduced IChatHistoryProvider interface and its corresponding implementation ChatHistoryProvider. #78

Merged
merged 9 commits into from
Feb 13, 2024

Conversation

MarioRamosEs
Copy link
Contributor

@MarioRamosEs MarioRamosEs commented Feb 13, 2024

Description

A new IChatHistoryProvider abstraction layer has been added to decouple the history management from ChatWithHistoryPlugin, so that it can be used by other parts of the code.

Changelog

Breaking Changes

  • Removed HistoryMaxMessages property from ChatWithHistoryPluginOptions as part of a refactor to improve the configuration management of chat history. This property is now available within a new dedicated class ChatHistoryProviderOptions, which is designed to configure aspects of the IChatHistoryProvider implementation.
  • The method ImportChatWithHistoryPluginUsingCosmosDb has been renamed to ImportChatWithHistoryPlugin to reflect its decoupling from the specific storage implementation and to align with the new IChatHistoryProvider abstraction. This change requires consumers to update their method calls to match the new signature, and to provide an instance of IChatHistoryProvider in the dependency container. You can use AddCosmosChatHistoryProvider to add an instance of IChatHistoryProvider that uses Azure Cosmos DB for storing chat histories.
  • Modified the ChatAsync method signature in ChatWithHistoryPlugin by changing the order of parameters and making userName and locale optional. This change requires consumers to update their method calls to match the new signature.
  • The KernelExtensions.cs and ChatWithHistoryPluginOptions.cs files in Encamina.Enmarcha.SemanticKernel.Plugins.Chat had been moved to a new location to better align with the project's structure.

Major Changes

  • Introduced IChatHistoryProvider interface and its corresponding implementation ChatHistoryProvider. This new abstraction layer provides a more flexible and decoupled way to work with chat history.
  • Added a new extension method AddCosmosChatHistoryProvider to the service collection extensions. This method streamlines the setup and registration of IChatHistoryProvider that uses Azure Cosmos DB for storing chat histories.
  • Removed direct dependency on IAsyncRepository<ChatMessageHistoryRecord> in ChatWithHistoryPlugin, now relying on IChatHistoryProvider for chat history management.
  • Added new calculation methods LengthChatMessage and LengthChatMessageWithEncoding in ILengthFunctions to determine the length of chat messages considering the author's role.

Minor Changes

  • Adjusted package references in Encamina.Enmarcha.SemanticKernel.csproj to include Encamina.Enmarcha.Data.Abstractions.

@MarioRamosEs MarioRamosEs added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 13, 2024
@rliberoff rliberoff requested a review from LuisM000 February 13, 2024 08:17
@MarioRamosEs MarioRamosEs changed the title New version 8.1.3 - Introduced IChatHistoryProvider interface and its corresponding implementation ChatHistoryProvider. Bump version 8.1.3 - Introduced IChatHistoryProvider interface and its corresponding implementation ChatHistoryProvider. Feb 13, 2024
@MarioRamosEs MarioRamosEs marked this pull request as ready for review February 13, 2024 09:56
@rliberoff rliberoff self-requested a review February 13, 2024 10:12
rliberoff
rliberoff previously approved these changes Feb 13, 2024
@MarioRamosEs MarioRamosEs dismissed stale reviews from LuisM000 and rliberoff via 4b8e8ec February 13, 2024 11:03
@MarioRamosEs MarioRamosEs merged commit 950a8cc into main Feb 13, 2024
2 checks passed
@MarioRamosEs MarioRamosEs deleted the @mramos/V8.1.3 branch February 13, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants