Skip to content

Commit

Permalink
Merge pull request #79 from Encamina/@lmarcos/#72_remove_memory_store…
Browse files Browse the repository at this point in the history
…_extender_workaround

Remove MemoryStoreExtender workaround
  • Loading branch information
LuisM000 authored Feb 15, 2024
2 parents 950a8cc + 46a78d9 commit 08cf111
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 51 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ Also, any bug fix must start with the prefix �Bug fix:� followed by the desc

Previous classification is not required if changes are simple or all belong to the same category.

## [8.1.4]

### Major Changes
- Updated dependencies:
- Updated `Microsoft.AspNetCore.Authentication.JwtBearer` from `8.0.1` to `8.0.2`.
- Updated `Microsoft.AspNetCore.Authentication.OpenIdConnect` from `8.0.1` to `8.0.2`.
- Updated `Microsoft.Azure.Cosmos` from `3.38.0` to `3.38.1`.
- Updated `Microsoft.EntityFrameworkCore` from `8.0.1` to `8.0.2`.
- Updated `Microsoft.EntityFrameworkCore.SqlServer` from `8.0.1` to `8.0.2`.
- Updated `Microsoft.Extensions.Azure` from `1.7.1` to `1.7.2`.
- Updated `Microsoft.Extensions.Options` from `8.0.1` to `8.0.2`.
- Updated `Microsoft.NET.Test.Sdk` from `17.8.0` to `17.9.0`.
- Updated `Microsoft.SemanticKernel.Abstractions` from `1.3.1` to `1.4.0`.
- Updated `Microsoft.SemanticKernel.Connectors.AzureAISearch` from `1.3.1-alpha` to `1.4.0-alpha`. This does fix the [Issue 72](https://github.com/Encamina/enmarcha/issues/72).
- Updated `Microsoft.SemanticKernel.Connectors.OpenAI` from `1.3.1` to `1.4.0`.
- Updated `Microsoft.SemanticKernel.Connectors.Qdrant` from `1.3.1-alpha` to `1.4.0-alpha`.
- Updated `Microsoft.SemanticKernel.Core` from `1.3.1` to `1.4.0`.
- Updated `Microsoft.SemanticKernel.Plugins.Document` from `1.3.1-alpha` to `1.4.0-alpha`.
- Updated `Microsoft.SemanticKernel.Plugins.Memory` from `1.3.1-alpha` to `1.4.0-alpha`.
- Updated `System.Text.Json` from `8.0.1` to `8.0.2`.
- Bug fix ([Issue 72](https://github.com/Encamina/enmarcha/issues/72)). Removed `MemoryStoreExtender` workaround after updating to `Microsoft.SemanticKernel.Connectors.AzureAISearch` version `1.4.0-alpha` which resolves the issue.

## [8.1.3]

### Breaking Changes
Expand Down
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>8.1.3</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>8.1.4</VersionPrefix>
</PropertyGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.3.1-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.4.0-alpha" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand All @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<ItemGroup>
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.13" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.1" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -46,7 +46,7 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Encamina.Enmarcha.AI/Encamina.Enmarcha.AI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -37,7 +37,7 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Encamina.Enmarcha.Core/Encamina.Enmarcha.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.38.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.38.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Encamina.Enmarcha.Data.Abstractions\Encamina.Enmarcha.Data.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.3.1" PrivateAssets="none" />
<PackageReference Include="Microsoft.SemanticKernel.Core" Version="1.3.1" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.4.0" PrivateAssets="none" />
<PackageReference Include="Microsoft.SemanticKernel.Core" Version="1.4.0" />
<PackageReference Include="SharpToken" Version="1.2.15" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Document" Version="1.3.1-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Document" Version="1.4.0-alpha" />
<PackageReference Include="PdfPig" Version="0.1.8" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAISearch" Version="1.3.1-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.3.1-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAISearch" Version="1.4.0-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.4.0-alpha" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.3.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.3.1" />
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.4.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.3.1" />
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 1 addition & 18 deletions src/Encamina.Enmarcha.SemanticKernel/MemoryStoreExtender.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Ignore Spelling: Upsert

using System.Collections.ObjectModel;
using System.Net;
using System.Runtime.CompilerServices;
using System.Text.Json;

using Azure;

using Encamina.Enmarcha.SemanticKernel.Abstractions;
using Encamina.Enmarcha.SemanticKernel.Abstractions.Events;

Expand Down Expand Up @@ -144,21 +141,7 @@ public virtual async IAsyncEnumerable<string> BatchUpsertMemoriesAsync(string co
private async Task<int> GetChunkSize(string memoryId, string collectionName, CancellationToken cancellationToken)
{
var key = BuildMemoryIdentifier(memoryId, 0);
MemoryRecord firstMemoryChunk = null;

try
{
firstMemoryChunk = await MemoryStore.GetAsync(collectionName, key, cancellationToken: cancellationToken);
}
catch (RequestFailedException e) when (e.Status == (int)HttpStatusCode.NotFound)
{
// At this point, we need to catch the NotFound exception. This is necessary because, in the case of Azure AI Search Memory Store,
// if the element does not exist, it throws an exception instead of returning a null value, which would be the expected behavior.
// We have opened an issue in Semantic Kernel and also an issue in ENMARCHA to track the progress of this issue and remove this try/catch block once it is resolved.
// Issue ENMARCHA: https://github.com/Encamina/enmarcha/issues/72

/* Do nothing */
}
var firstMemoryChunk = await MemoryStore.GetAsync(collectionName, key, cancellationToken: cancellationToken);

if (firstMemoryChunk == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Bogus" Version="35.4.0" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion tst/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.analyzers" Version="1.10.0" />
Expand Down

0 comments on commit 08cf111

Please sign in to comment.