using AIStudio.Tools.Databases.IndexStore;
namespace AIStudio.Tools.Services.Indexing;
///
/// One document of a data source, ready to be embedded.
///
///
/// Everything the shared part of a run needs to know about a document, whatever kind of data source
/// it comes from. Where the text comes from, and how it is cut into chunks, stays with the kind of
/// data source: the chunks are only read once the old vectors of the document are gone.
///
/// What the vectors and the index row of the document are filed under. For a file, its full path.
/// The index row of the document, written before its chunks with a chunk count of zero.
/// How the document is called in messages for the user. For a file, its name.
/// Reads the document and yields its chunks.
internal sealed record EmbeddingDocument(string Key, EmbeddingStateFile State, string DisplayName, Func> StreamChunks);