<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/LanguageModelSession/GenerationError/Context",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels20LanguageModelSessionC15GenerationErrorO7ContextV"
  },
  "title" : "LanguageModelSession.GenerationError.Context"
}
-->

# LanguageModelSession.GenerationError.Context

The context in which the error occurred.

```
struct Context
```

## Topics

### Creating a context

[`init(debugDescription:)`](/documentation/FoundationModels/LanguageModelSession/GenerationError/Context/init(debugDescription:))

Creates a context.

### Getting the debug description

[`debugDescription`](/documentation/FoundationModels/LanguageModelSession/GenerationError/Context/debugDescription)

A debug description to help developers diagnose issues during development.

## Relationships

### Conforms To

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