<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NaturalLanguage",
  "identifier" : "/documentation/NaturalLanguage/NLContextualEmbedding/requestAssets(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Natural Language"
    ],
    "preciseIdentifier" : "c:objc(cs)NLContextualEmbedding(im)requestEmbeddingAssetsWithCompletionHandler:"
  },
  "title" : "requestAssets(completionHandler:)"
}
-->

# requestAssets(completionHandler:)

Requests embedding model assets and downloads them if available.

```
func requestAssets(completionHandler: @escaping @Sendable (NLContextualEmbedding.AssetsResult, (any Error)?) -> Void)
```

## Parameters

`completionHandler`

A closure that notifies your app when the asset request completes.

## Asynchronous alternative

You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:

```swift
func requestAssets() async throws -> NLContextualEmbedding.AssetsResult
```

For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

## Discussion

You use a contextual embedding after loading the necessary assets onto the device. Use [`hasAvailableAssets`](/documentation/NaturalLanguage/NLContextualEmbedding/hasAvailableAssets) to determine whether assets are available.
This method returns immediately if the framework knows the state of the assets or if an error occurs.

---

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)