Files
wehub-resource-sync b957a53def
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:21:23 +08:00

35 lines
960 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
using System.Text.Json.Serialization;
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Data;
namespace ChatWithAgent.ApiService;
/// <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]
[JsonPropertyName("chunk_id")]
public required TKey Key { get; set; }
[VectorStoreData]
[JsonPropertyName("chunk")]
[TextSearchResultValue]
public string? Text { get; set; }
[VectorStoreData]
[JsonPropertyName("title")]
[TextSearchResultName]
[TextSearchResultLink]
public string? Reference { get; set; }
[VectorStoreVector(1536)]
[JsonPropertyName("text_vector")]
public ReadOnlyMemory<float> TextEmbedding { get; set; }
}