// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Data;
namespace VectorStoreRAG;
///
/// Data model for storing a section of text with an embedding and an optional reference link.
///
/// The type of the data model key.
internal sealed class TextSnippet
{
[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; }
///
/// 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.
///
[VectorStoreVector(1536)]
public string? TextEmbedding => this.Text;
}