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

# GeneratedContent

A type that represents structured, generated content.

```
struct GeneratedContent
```

## Overview

Generated content may contain a single value, an array, or key-value pairs with unique keys.

## Topics

### Creating generated content

[`init(_:)`](/documentation/FoundationModels/GeneratedContent/init(_:))

Creates generated content from another value.

[`init(_:id:)`](/documentation/FoundationModels/GeneratedContent/init(_:id:))

Creates content that contains a single value with a custom generation identifier.

[`init(elements:id:)`](/documentation/FoundationModels/GeneratedContent/init(elements:id:))

Creates content representing an array of elements you specify.

[`init(properties:id:)`](/documentation/FoundationModels/GeneratedContent/init(properties:id:))

Creates generated content representing a structure with the properties you specify.

[`init(properties:id:uniquingKeysWith:)`](/documentation/FoundationModels/GeneratedContent/init(properties:id:uniquingKeysWith:))

Creates generated content from key-value pairs, resolving duplicate keys with a combining closure.

[`init(json:)`](/documentation/FoundationModels/GeneratedContent/init(json:))

Creates equivalent content from a JSON string.

[`init(kind:id:)`](/documentation/FoundationModels/GeneratedContent/init(kind:id:))

Creates content with the specified kind and generation identifier.

[`GeneratedContent.ParsingError`](/documentation/FoundationModels/GeneratedContent/ParsingError)

A failure that occurs when a string cannot be parsed into GeneratedContent.

### Accessing the content

[`kind`](/documentation/FoundationModels/GeneratedContent/kind-swift.property)

The representation of the generated content.

[`GeneratedContent.Kind`](/documentation/FoundationModels/GeneratedContent/Kind-swift.enum)

A representation of the different types of content that can be stored in generated content.

[`value(_:)`](/documentation/FoundationModels/GeneratedContent/value(_:))

Reads a top level, concrete partially generable type from a named property.

[`value(_:forProperty:)`](/documentation/FoundationModels/GeneratedContent/value(_:forProperty:))

Reads a concrete generable type from a named property.

[`isComplete`](/documentation/FoundationModels/GeneratedContent/isComplete)

A Boolean value that indicates whether the generated content is complete.

[`generatedContent`](/documentation/FoundationModels/GeneratedContent/generatedContent)

A representation of this instance.

[`jsonString`](/documentation/FoundationModels/GeneratedContent/jsonString)

A JSON string representation of the generated content.

[`debugDescription`](/documentation/FoundationModels/GeneratedContent/debugDescription)

A string representation for the debug description.

### Identifying a generation

[`id`](/documentation/FoundationModels/GeneratedContent/id)

A unique id that is stable for the duration of a generated response.

[`GenerationID`](/documentation/FoundationModels/GenerationID)

A unique identifier that is stable for the duration of a response, but not across responses.



---

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)