namespace AIStudio.Assistants.BeyondFactsLab; /// /// A file the person added to a preparation, e.g., notes, a talk draft, a paper, an invitation, the recording of an /// interview, or a poster, which the chats of every step read. /// /// /// The lab reads a file once, when the person adds it. Of a document or a recording, it keeps the text which passed /// the prompt injection filter beside this record, as materials/ID.md in the folder of the preparation; of an image, /// a copy prepared for models, see BflMaterialImage. This record lies beside it as materials/ID.json. Neither keeps /// the path of the file: the person may move or delete it afterward, and the preparation still works on another /// computer after a backup. /// public sealed class BflMaterial { /// /// The version of the stored form this version of AI Studio writes. Raise it with every new property, once a /// release of AI Studio stored materials. /// public const int CURRENT_SCHEMA_VERSION = 1; /// /// Gets or sets the version of the stored form. /// public int SchemaVersion { get; set; } = CURRENT_SCHEMA_VERSION; /// /// Gets or sets the ID of the material, which also names its files. /// public Guid MaterialId { get; set; } /// /// Gets or sets the name of the file as the person knows it, e.g., "Invitation.docx", never its path. /// public string Name { get; set; } = string.Empty; /// /// Gets or sets what the material came from. /// public BflMaterialKind Kind { get; set; } = BflMaterialKind.DOCUMENT; /// /// Gets or sets the copy of an image, or null for any other kind of material. /// public BflMaterialImage? Image { get; set; } /// /// Gets or sets when the person added the material. /// public DateTimeOffset AddedAtUtc { get; set; } /// /// Gets or sets the size of the document in bytes. /// public long SourceBytes { get; set; } /// /// Gets or sets the SHA-256 hash of the document, in lowercase hexadecimal, to recognize a document the person /// added already. /// public string SourceHash { get; set; } = string.Empty; /// /// Gets or sets how many characters the stored text has, so that the lab can share out the room in a prompt /// without reading every text. /// public int TextLength { get; set; } /// /// Gets or sets whether parts of the document could not be read, e.g., single pages of a PDF. /// public bool IsIncomplete { get; set; } /// /// Gets or sets whether the lab kept only the beginning of the text, because the document holds more than a /// conversation can ever take of one material. /// public bool IsShortened { get; set; } /// /// Gets or sets the pages which could not be read, when they are known. /// public List FailedPages { get; set; } = []; /// /// Gets or sets how many passages the prompt injection filter removed from the text. /// public int FilteredPassages { get; set; } }