<!--
{
  "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/Transcript/DataAttachment",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels10TranscriptV14DataAttachmentV"
  },
  "title" : "Transcript.DataAttachment"
}
-->

# Transcript.DataAttachment

A data attachment payload in a serialized, portable format.

```
struct DataAttachment
```

## Overview

A [`Transcript.DataAttachment`](/documentation/FoundationModels/Transcript/DataAttachment) records the bytes and identifier of a value that a
[`LanguageModel`](/documentation/FoundationModels/LanguageModel) implementation opted into via
[`supportsDataAttachmentType(_:)`](/documentation/FoundationModels/LanguageModel/supportsDataAttachmentType(_:)). It’s what a
[`DataAttachmentRepresentable`](/documentation/FoundationModels/DataAttachmentRepresentable)-conforming type produces from its
[`transcriptRepresentation`](/documentation/FoundationModels/DataAttachmentRepresentable/transcriptRepresentation), and it
round-trips through the transcript’s `Codable` conformance so the
transcript remains portable even in environments where the declaring
package isn’t installed.

## Topics

### Initializers

[`init(contentType: UTType, content: Data, metadata: GeneratedContent)`](/documentation/FoundationModels/Transcript/DataAttachment/init(contentType:content:metadata:))

Creates a data attachment with the content type, content, and metadata
you provide.

### Instance Properties

[`var content: Data`](/documentation/FoundationModels/Transcript/DataAttachment/content)

A raw binary representation of the attachment.

[`var contentType: UTType`](/documentation/FoundationModels/Transcript/DataAttachment/contentType)

A `UTType` identifying how to interpret [`content`](/documentation/FoundationModels/Transcript/DataAttachment/content).

[`var metadata: GeneratedContent`](/documentation/FoundationModels/Transcript/DataAttachment/metadata)

Metadata pertinent to this attachment.

## Relationships

### Conforms To

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

[`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)