Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
MentorAttachment record
The MentorAttachment record of Novior.MentorAgent.Abstractions.Models: A user-supplied image attached to a chat message (roadmap #13 — multimodal input)…
On this page
A user-supplied image attached to a chat message (roadmap #13 — multimodal input). Serializable so it flows over the SignalR hub, the SSE endpoint and to JS clients. Exactly one source is set: MentorAttachment.DataBase64 for an inline upload / paste / drag-drop, or MentorAttachment.Url for a remotely hosted image.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.
public sealed record MentorAttachment : IEquatable<MentorAttachment>
dotnet add package Novior.MentorAgent.AbstractionsConstructors
Section titled “Constructors”public MentorAttachment()
Properties
Section titled “Properties”ApproxBytes
Section titled “ApproxBytes”public long ApproxBytes { get; }
Approximate decoded byte size of an inline attachment (0 for a URL).
DataBase64
Section titled “DataBase64”public string? DataBase64 { get; init; }
Base64-encoded bytes for an inline attachment (no data: prefix). Null when MentorAttachment.Url is used.
FileName
Section titled “FileName”public string? FileName { get; init; }
Optional original file name (display only).
IsInline
Section titled “IsInline”public bool IsInline { get; }
True when this attachment carries inline base64 data (rather than a URL).
MimeType
Section titled “MimeType”public string MimeType { get; init; }
MIME type, e.g. image/png, image/jpeg, image/webp. Defaults to PNG.
public string? Url { get; init; }
Absolute URL of a remotely hosted image. Null when MentorAttachment.DataBase64 is used.
Methods
Section titled “Methods”ToAIContent
Section titled “ToAIContent”public AIContent? ToAIContent()
Converts to a Microsoft.Extensions.AI content part for the agent turn — UriContent for a URL, DataContent for inline base64. Returns null if empty.
ToDisplaySrc
Section titled “ToDisplaySrc”public string ToDisplaySrc()
A browser-renderable src (a data: URI for inline data, or the URL) for thumbnails.
