-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Refactored integration tests for vector stores (#9905)
### 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. --> Resolves: #6459 This PR adds a base class for vector store integration tests and updates all integration tests for concrete vector store to use common workflow. ### 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 😄
- Loading branch information
1 parent
88635e1
commit 43235b8
Showing
25 changed files
with
453 additions
and
501 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
dotnet/src/IntegrationTests/Connectors/Memory/AzureAISearch/AzureAISearchHotel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
using System; | ||
using System.Text.Json.Serialization; | ||
using Azure.Search.Documents.Indexes; | ||
using Azure.Search.Documents.Indexes.Models; | ||
using Microsoft.Extensions.VectorData; | ||
|
||
namespace SemanticKernel.IntegrationTests.Connectors.Memory.AzureAISearch; | ||
|
||
#pragma warning disable CS8618 | ||
|
||
public class AzureAISearchHotel | ||
{ | ||
[SimpleField(IsKey = true, IsFilterable = true)] | ||
[VectorStoreRecordKey] | ||
public string HotelId { get; set; } | ||
|
||
[SearchableField(IsFilterable = true, IsSortable = true)] | ||
[VectorStoreRecordData(IsFilterable = true, IsFullTextSearchable = true)] | ||
public string HotelName { get; set; } | ||
|
||
[SearchableField(AnalyzerName = LexicalAnalyzerName.Values.EnLucene)] | ||
[VectorStoreRecordData] | ||
public string Description { get; set; } | ||
|
||
[VectorStoreRecordVector(1536)] | ||
public ReadOnlyMemory<float>? DescriptionEmbedding { get; set; } | ||
|
||
[SearchableField(IsFilterable = true, IsFacetable = true)] | ||
[VectorStoreRecordData(IsFilterable = true)] | ||
#pragma warning disable CA1819 // Properties should not return arrays | ||
public string[] Tags { get; set; } | ||
#pragma warning restore CA1819 // Properties should not return arrays | ||
|
||
[JsonPropertyName("parking_is_included")] | ||
[SimpleField(IsFilterable = true, IsSortable = true, IsFacetable = true)] | ||
[VectorStoreRecordData(IsFilterable = true)] | ||
public bool? ParkingIncluded { get; set; } | ||
|
||
[SimpleField(IsFilterable = true, IsSortable = true, IsFacetable = true)] | ||
[VectorStoreRecordData(IsFilterable = true)] | ||
public DateTimeOffset? LastRenovationDate { get; set; } | ||
|
||
[SimpleField(IsFilterable = true, IsSortable = true, IsFacetable = true)] | ||
[VectorStoreRecordData] | ||
public double? Rating { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.