<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -",
    "macOS: 27.2.0 -",
    "visionOS: 27.2.0 -",
    "watchOS: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/DataAttachmentRepresentable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels27DataAttachmentRepresentableP"
  },
  "title" : "DataAttachmentRepresentable"
}
-->

# DataAttachmentRepresentable

A type that you use as the content of a data attachment.

```
protocol DataAttachmentRepresentable : Sendable
```

## Overview

Conform to this protocol to describe how a value serializes into — and
deserializes back from — a [`Transcript.DataAttachment`](/documentation/FoundationModels/Transcript/DataAttachment). The serialized
form is a portable `Data` blob identified by a content type identifier, which is what
gets persisted when a [`Transcript`](/documentation/FoundationModels/Transcript) is encoded, so a transcript remains
readable even in environments where the declaring package isn’t installed.

A [`LanguageModel`](/documentation/FoundationModels/LanguageModel) advertises which content types it accepts through
[`supportsDataAttachmentType(_:)`](/documentation/FoundationModels/LanguageModel/supportsDataAttachmentType(_:)); the framework validates
each data attachment’s [`contentType`](/documentation/FoundationModels/Transcript/DataAttachment/contentType) against
that predicate before dispatching to the executor.

## Topics

### Initializers

[`init(Transcript.DataAttachment) throws`](/documentation/FoundationModels/DataAttachmentRepresentable/init(_:))

Rehydrates this content from its transcript representation.

### Instance Properties

[`var transcriptRepresentation: Transcript.DataAttachment`](/documentation/FoundationModels/DataAttachmentRepresentable/transcriptRepresentation)

The transcript representation of this content.

## Relationships

### Inherits From

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)