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

New version 6.0.4 which updates Semantic Kernel to 1.0.0-beta8 #15

Merged
merged 19 commits into from
Dec 3, 2023

Conversation

rliberoff
Copy link
Member

  • Updated Semantic Kernel references from version 0.20.230821.4-preview to version 1.0.0-beta8.
  • Version of ENMARCHA changes from 6.0.3.20 to 6.0.4.0
  • Updated the CHANGELOG.md
  • Removed NotSemanticFunction exception message since now Semantic Kernel does not longer differentiates between Semantic and Native functions. Also the ArgumentException is not thrown anymore. This affects the following methods:
    • GetSemanticFunctionPromptAsync
    • GetSemanticFunctionUsedTokensAsync
  • Extension method ImportQuestionAnsweringPlugin from Encamina.Enmarcha.SemanticKernel.Plugins.QuestionAnswering now expects an ISemanticTextMemory as part of the required services.
  • Extension method ImportMemoryPlugin from Encamina.Enmarcha.SemanticKernel.Plugins.Memory now expects a valid instance of ISemanticTextMemory as input parameter. This breaks the previous signature of the method.
  • The constructor of the MemoryQueryPlugin class now expects a valid instance of ISemanticTextMemory instead of IKernel. This breaks the previous signature of the class constructor.
  • Due to changes form Semantic Kernel, the class ChatRequestSettings is replaced by OpenAIRequestSettings which breaks the previous signature of the ChatRequestSettings property of the ChatWithHistoryPluginOptions class in Encamina.Enmarcha.SemantucKernel.Plugins.Chat.
  • The LengthByTokenCount function from ILengthFunctions mixin interface in Encamina.Enmarcha.SemanticKernel.Abstractions now uses SharpToken instead of the GPT3Tokenizer class which has been removed from Semantic Kernel.
  • Added a new length by tokens function called LengthByTokenCountUsingEncoding in the ILengthFunctions mixin interface.
  • Removed extension method ValidateAndThrowIfErrorOccurred since the properties ErrorOccurred and LastException are removed from SKContext in the new version of Semantic Kernel. This is a breaking change.
  • New extension method AddSemanticTextMemory in Encamina.Enmarcha.SemanticKernel.Connectors.Memory to add a semantic text memory (i.e., ISemanticTextMemory) to the dependency container.
  • Fixed samples.
  • Fixing Sonar Analysis issue
  • Some boy scouting.

…iew" />` to version `1.0.0-beta8`.

- Version of ENMARCHA changes from `6.0.3.20` to  `6.0.4.0`
- Added a CHANGELOG.md
- Removed `NotSemanticFunction` exception message since now `Semantic Kernel` does not longer differentiates between Semantic and Native functions. Also the `ArgumentException` is not thrown anymore. This affects the following methods:
  * GetSemanticFunctionPromptAsync
  * GetSemanticFunctionUsedTokensAsync
- Extension method `ImportQuestionAnsweringPlugin` from `Encamina.Enmarcha.SemanticKernel.Plugins.QuestionAnswering` now expects an `ISemanticTextMemory` as part of the required services.
- Extension method `ImportMemoryPlugin` from `Encamina.Enmarcha.SemanticKernel.Plugins.Memory` now expects a valid instance of `ISemanticTextMemory` as input parameter. This breaks the previous signature of the method.
- The constructor of the `MemoryQueryPlugin` class now expects a valid instance of `ISemanticTextMemory` instead of `IKernel`. This breaks the previous signature of the class constructor.
- Due to changes form Semantic Kernel, the class `ChatRequestSettings` is replaced by `OpenAIRequestSettings` which breaks the previous signature of the `ChatRequestSettings` property of the `ChatWithHistoryPluginOptions` class in `Encamina.Enmarcha.SemantucKernel.Plugins.Chat`.
- The `LengthByTokenCount` function from `ILengthFunctions` mixin interface in `Encamina.Enmarcha.SemanticKernel.Abstractions` now uses `SharpToken` instead of the `GPT3Tokenizer` class which has been removed from Semantic Kernel.
- Added a new length by tokens function called `LengthByTokenCountUsingEncoding` in the `ILengthFunctions` mixin interface.
- Removed extension method `ValidateAndThrowIfErrorOccurred` since the properties `ErrorOccurred` and `LastException` are removed from `SKContext` in the new version of Semantic Kernel. This is a breaking change.
- Some boy scouting.
…SemanticKernel.Connectors.Memory` to add a semantic text memory (i.e., `ISemanticTextMemory`) to the dependency container.
…from `Encamina.Enmarcha.SemanticKernel` to `Encamina.Enmarcha.SemanticKernel.Abstractions`.
@rliberoff rliberoff linked an issue Nov 29, 2023 that may be closed by this pull request
@rliberoff rliberoff changed the title @rliberoff/update semantic kernel New version 6.0.4 which updates Semantic Kernel to 1.0.0-beta8 Nov 29, 2023
@rliberoff rliberoff self-assigned this Nov 29, 2023
@rliberoff rliberoff marked this pull request as ready for review November 29, 2023 16:30
/// </summary>
public static Func<string, int> LengthByTokenCount => (text) => string.IsNullOrEmpty(text) ? 0 : GPT3Tokenizer.Encode(text).Count;
/// <seealso href="https://platform.openai.com/tokenizer"/>
public static Func<string, int> LengthByTokenCount => (text) => string.IsNullOrEmpty(text) ? 0 : GptEncoding.GetEncoding("cl100k_base").Encode(text).Count;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave you a URL that can help you understand the token model. https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I added it as another seealso.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@rliberoff rliberoff added the enhancement New feature or request label Dec 1, 2023
@rliberoff rliberoff merged commit 54691e9 into main Dec 3, 2023
2 checks passed
@rliberoff rliberoff deleted the @rliberoff/update_semantic_kernel branch December 3, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Semantic Kernel references to version 1.0.0
6 participants