<!--
{
  "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/DataEntryRepresentable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels22DataEntryRepresentableP"
  },
  "title" : "DataEntryRepresentable"
}
-->

# DataEntryRepresentable

A type that a model can produce and represent as a top-level transcript entry.

```
protocol DataEntryRepresentable : Sendable
```

## Overview

Conform to this protocol to describe how a value serializes into — and
deserializes back from — a [`Transcript.DataEntry`](/documentation/FoundationModels/Transcript/DataEntry).

[`transcriptRepresentation`](/documentation/FoundationModels/DataEntryRepresentable/transcriptRepresentation) is non-throwing: any fallible encoding
should be surfaced from the conformer’s own initializer, where the
developer is already deciding what input to accept. [`init(_:)`](/documentation/FoundationModels/DataEntryRepresentable/init(_:)) is
throwing because the wire representation may come from a persisted
transcript, from over the network, or from any source the conformer
doesn’t control, and could be malformed. The asymmetry mirrors
Foundation’s `String.init(data:encoding:)` (failable) and `String.utf8`
(total).

## Topics

### Initializers

[`init(Transcript.DataEntry) throws`](/documentation/FoundationModels/DataEntryRepresentable/init(_:))

Rehydrate this type from its transcript representation.

### Instance Properties

[`var transcriptRepresentation: Transcript.DataEntry`](/documentation/FoundationModels/DataEntryRepresentable/transcriptRepresentation)

How this type appears when recorded in a session transcript.

## Relationships

### Inherits From

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

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

---

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)