MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

MentorAttachment record

The MentorAttachment record of Novior.MentorAgent.Abstractions.Models: A user-supplied image attached to a chat message (roadmap #13 — multimodal input)…

View as Markdown
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.

Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.

public sealed record MentorAttachment : IEquatable<MentorAttachment>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

public MentorAttachment()

public long ApproxBytes { get; }

Approximate decoded byte size of an inline attachment (0 for a URL).

public string? DataBase64 { get; init; }

Base64-encoded bytes for an inline attachment (no data: prefix). Null when MentorAttachment.Url is used.

public string? FileName { get; init; }

Optional original file name (display only).

public bool IsInline { get; }

True when this attachment carries inline base64 data (rather than a URL).

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.

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.

public string ToDisplaySrc()

A browser-renderable src (a data: URI for inline data, or the URL) for thumbnails.