Skip to content

Commit 16d3004

Browse files
authored
.Net: Update Azure.Search.Documents.nupkg to version 11.5.0-beta.4 (#2725)
### Motivation and Context Breaking changes cause missing method exception when integrating semantic-kernel with semantic-memory since sk references 11.5.0-beta.3 and sm 11.5.0-beta.4. [SearchQueryVector](https://learn.microsoft.com/en-us/dotnet/api/azure.search.documents.models.searchqueryvector?view=azure-dotnet-preview) [SearchOptions](https://learn.microsoft.com/en-us/dotnet/api/azure.search.documents.searchoptions?view=azure-dotnet-preview) ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ``` Method not found: 'Void Azure.Search.Documents.Models.SearchQueryVector.set_Fields(System.String)'. at Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch.AzureCognitiveSearchMemoryStore.<GetNearestMatchesAsync>d__11.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch.AzureCognitiveSearchMemoryStore.<GetNearestMatchesAsync>d__11.System.IAsyncDisposable.DisposeAsync() at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.Enumerator.DisposeAsync() at Microsoft.SemanticKernel.Memory.SemanticTextMemory.<SearchAsync>d__7.MoveNext() at Microsoft.SemanticKernel.Memory.SemanticTextMemory.<SearchAsync>d__7.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at System.Collections.Generic.AsyncEnumerableHelpers.<ToArrayWithLength>d__1`1.MoveNext() at System.Collections.Generic.AsyncEnumerableHelpers.<ToArrayWithLength>d__1`1.MoveNext() at System.Threading.Tasks.ValueTask`1.get_Result() at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult() at System.Collections.Generic.AsyncEnumerableHelpers.<ToArray>d__0`1.MoveNext() at System.Threading.Tasks.ValueTask`1.get_Result() at CopilotChat.WebApi.Services.ChatMemoryMigrationService.<>c__DisplayClass5_0.<<MigrateAsync>g__QueryMemoriesAsync|0>d.MoveNext() in C:\Users\crickman\source\repos\sk-chat-copilot-memory\webapi\Services\ChatMemoryMigrationService.cs:line 88 at CopilotChat.WebApi.Services.ChatMemoryMigrationService.<>c__DisplayClass5_0.<<MigrateAsync>g__QueryMemoriesAsync|0>d.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at CopilotChat.WebApi.Services.ChatMemoryMigrationService.<MigrateAsync>d__5.MoveNext() in C:\Users\crickman\source\repos\sk-chat-copilot-memory\webapi\Services\ChatMemoryMigrationService.cs:line 71 at CopilotChat.WebApi.Services.ChatMemoryMigrationService.<MigrateAsync>d__5.MoveNext() in C:\Users\crickman\source\repos\sk-chat-copilot-memory\webapi\Services\ChatMemoryMigrationService.cs:line 71 at CopilotChat.WebApi.Services.ChatMigrationMiddleware.<Invoke>d__11.MoveNext() in C:\Users\crickman\source\repos\sk-chat-copilot-memory\webapi\Services\ChatMigrationMiddleware.cs:line 74 ``` ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent 782b46e commit 16d3004

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dotnet/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.7" />
99
<PackageVersion Include="Azure.Identity" Version="1.10.0" />
10-
<PackageVersion Include="Azure.Search.Documents" Version="11.5.0-beta.3" />
10+
<PackageVersion Include="Azure.Search.Documents" Version="11.5.0-beta.4" />
1111
<PackageVersion Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
1212
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="11.3.3" />
1313
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="[1.1.0, )" />

dotnet/src/Connectors/Connectors.Memory.AzureCognitiveSearch/AzureCognitiveSearchMemoryStore.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,15 @@ public async IAsyncEnumerable<MemoryRecord> GetBatchAsync(
179179
SearchQueryVector vectorQuery = new()
180180
{
181181
KNearestNeighborsCount = limit,
182-
Fields = AzureCognitiveSearchMemoryRecord.EmbeddingField,
182+
Fields = { AzureCognitiveSearchMemoryRecord.EmbeddingField },
183183
Value = MemoryMarshal.TryGetArray(embedding, out var array) && array.Count == embedding.Length ? array.Array! : embedding.ToArray(),
184184
};
185185

186-
SearchOptions options = new() { Vector = vectorQuery };
186+
SearchOptions options = new()
187+
{
188+
Vectors = { vectorQuery }
189+
};
190+
187191
Response<SearchResults<AzureCognitiveSearchMemoryRecord>>? searchResult = null;
188192
try
189193
{

0 commit comments

Comments
 (0)