chore: import upstream snapshot with attribution
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:21:23 +08:00
commit b957a53def
5423 changed files with 863745 additions and 0 deletions
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Data;
namespace VectorStoreRAG;
/// <summary>
/// Data model for storing a section of text with an embedding and an optional reference link.
/// </summary>
/// <typeparam name="TKey">The type of the data model key.</typeparam>
internal sealed class TextSnippet<TKey>
{
[VectorStoreKey]
public required TKey Key { get; set; }
[TextSearchResultValue]
[VectorStoreData]
public string? Text { get; set; }
[TextSearchResultName]
[VectorStoreData]
public string? ReferenceDescription { get; set; }
[TextSearchResultLink]
[VectorStoreData]
public string? ReferenceLink { get; set; }
/// <summary>
/// The text embedding for this snippet. This is used to search the vector store.
/// While this is a string property it has the vector attribute, which means whatever
/// text it contains will be converted to a vector and stored as a vector in the vector store.
/// </summary>
[VectorStoreVector(1536)]
public string? TextEmbedding => this.Text;
}