---
title: "init(_:)"
framework: foundationmodels
role: symbol
role_heading: Initializer
path: "foundationmodels/convertiblefromgeneratedcontent/init(_:)"
---

# init(_:)

Creates an instance from content generated by a model.

## Declaration

```swift
init(_ content: GeneratedContent) throws
```

## Discussion

Discussion Conformance to this protocol is provided by the @Generable macro. A manual implementation may be used to map values onto properties using different names. To manually initialize your type from generated content, decode the values as shown below: struct Person: ConvertibleFromGeneratedContent {     var name: String     var age: Int

init(_ content: GeneratedContent) {         self.name = try content.value(forProperty: "firstName")         self.age = try content.value(forProperty: "ageInYears")     } } important: If your type also conforms to ConvertibleToGeneratedContent, it is critical that this implementation be symmetrical with generatedContent. note: @Generable macro Generable(description:)
