<!--
{
  "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/LanguageModelSession/logFeedbackAttachment(sentiment:issues:desiredResponseContent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels20LanguageModelSessionC21logFeedbackAttachment9sentiment6issues22desiredResponseContent0A04DataVAA0cdG0V9SentimentOSg_SayAL5IssueVGAA022ConvertibleToGeneratedM0_pSgtF"
  },
  "title" : "logFeedbackAttachment(sentiment:issues:desiredResponseContent:)"
}
-->

# logFeedbackAttachment(sentiment:issues:desiredResponseContent:)

Logs and serializes a feedback attachment that includes the content you expected.

```
@backDeployed(before: iOS 26.1, macOS 26.1, visionOS 26.1)
@discardableResult final func logFeedbackAttachment(sentiment: LanguageModelFeedback.Sentiment?, issues: [LanguageModelFeedback.Issue] = [], desiredResponseContent: (any ConvertibleToGeneratedContent)?) -> Data
```

## Parameters

`sentiment`

An optional sentiment rating about the model’s output.

`issues`

An array of specific issues identified with the model’s response. Defaults to
an empty array.

`desiredResponseContent`

The content the model should’ve produced.

## Return Value

A `Data` object containing the JSON-encoded feedback attachment that can be
submitted to Feedback Assistant.

---

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)