# MentorAttachment record

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

- URL: https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorattachment
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Abstractions

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`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorattachment#database64) for an inline upload / paste / drag-drop, or [`MentorAttachment.Url`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorattachment#url) for a remotely hosted image.

## Definition

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

`public sealed record MentorAttachment : IEquatable<MentorAttachment>`

```shell
dotnet add package Novior.MentorAgent.Abstractions
```

## Constructors

`public MentorAttachment()`

## Properties

### `ApproxBytes`

`public long ApproxBytes { get; }`

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

### `DataBase64`

`public string? DataBase64 { get; init; }`

Base64-encoded bytes for an inline attachment (no `data:` prefix). Null when [`MentorAttachment.Url`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorattachment#url) is used.

### `FileName`

`public string? FileName { get; init; }`

Optional original file name (display only).

### `IsInline`

`public bool IsInline { get; }`

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

### `MimeType`

`public string MimeType { get; init; }`

MIME type, e.g. `image/png`, `image/jpeg`, `image/webp`. Defaults to PNG.

### `Url`

`public string? Url { get; init; }`

Absolute URL of a remotely hosted image. Null when [`MentorAttachment.DataBase64`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorattachment#database64) is used.

## Methods

### `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`

`public string ToDisplaySrc()`

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

---

- Previous: [MentorAgentKind enum](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentoragentkind.md)
- Next: [MentorCard record](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-models/mentorcard.md)
