<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/ConvertibleToGeneratedContent/generatedContent",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels29ConvertibleToGeneratedContentP09generatedF0AA0eF0Vvp"
  },
  "title" : "generatedContent"
}
-->

# generatedContent

This instance represented as generated content.

```
var generatedContent: GeneratedContent { get }
```

## Discussion

Conformance to this protocol is provided by the `@Generable` macro.
You can provide a manual implementation to map values onto properties using
different names. Use the generated content property as shown below, to
manually return a new [`GeneratedContent`](/documentation/FoundationModels/GeneratedContent) with the properties you specify.

```swift
struct Person: ConvertibleToGeneratedContent {
   var name: String
   var age: Int

   var generatedContent: GeneratedContent {
       GeneratedContent(properties: [
           "firstName": name,
           "ageInYears": age
       ])
   }
}
```

> Important: If your type also conforms to ``doc://com.apple.foundationmodels/documentation/FoundationModels/ConvertibleFromGeneratedContent``,
> it is critical that this implementation be symmetrical with ``doc://com.apple.foundationmodels/documentation/FoundationModels/ConvertibleFromGeneratedContent/init(_:)``.

---

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)