---
title: "init(rawValue:)"
framework: Natural Language
role: symbol
role_heading: Initializer
platforms: [iOS 12.0+, iPadOS 12.0+, Mac Catalyst 13.0+, macOS 10.14+, tvOS 12.0+, visionOS 1.0+, watchOS 5.0+]
path: "naturallanguage/nlcontextualembeddingkey/init(rawvalue:)"
---

# init(rawValue:)

Creates an embedding key with the given string as its raw value.

## Declaration

```swift
init(rawValue: String)
```

## Parameters

- `rawValue`: The string value you specify.

## Return Value

Return Value An embedding key instance if the raw value is valid, or nil if the value doesn’t correspond to a valid embedding key.

## See Also

### Creating embedding keys

- [init(_:)](naturallanguage/nlcontextualembeddingkey/init(_:).md)
