---
title: Attachment
framework: foundationmodels
role: symbol
role_heading: Structure
path: foundationmodels/attachment
---

# Attachment

An asset provided to the model.

## Declaration

```swift
struct Attachment<Content> where Content : AttachmentContent
```

## Mentioned in

Analyzing images with multimodal prompting

## Overview

Overview Use Attachment to include media such as images alongside text in your prompts and instructions. let response = try await session.respond {     "Describe this image:"     Attachment(image) } Use the label(_:) method to assign a label to an attachment. Labels help the model identify specific attachments when making tool calls. Prompt {     "Compare these two images:"     Attachment(firstImage)         .label("image-0")     Attachment(secondImage)         .label("image-1") }

## Topics

### Creating an attachment instance

- [init(_:orientation:)](foundationmodels/attachment/init(_:orientation:).md)
- [init(imageURL:orientation:)](foundationmodels/attachment/init(imageurl:orientation:).md)

### Assigning a label

- [label(_:)](foundationmodels/attachment/label(_:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [InstructionsRepresentable](foundationmodels/instructionsrepresentable.md)
- [PromptRepresentable](foundationmodels/promptrepresentable.md)

## See Also

### Prompt attachments

- [Analyzing images with multimodal prompting](foundationmodels/analyzing-images-with-multimodal-prompting.md)
- [AttachmentContent](foundationmodels/attachmentcontent.md)
- [ImageAttachmentContent](foundationmodels/imageattachmentcontent.md)
- [ImageReference](foundationmodels/imagereference.md)
