# EmbeddingType

    enum EmbeddingType: Sendable, Equatable, Hashable, CaseIterable, RawRepresentable

Task intent used to format input text for prompt-aware embedding models.
- `
  ### [classification](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO14classificationyA2CmF)

  ` Formats text for downstream classification.

  #### Declaration

  Swift

      case classification

- `
  ### [clustering](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO10clusteringyA2CmF)

  ` Formats text for clustering.

  #### Declaration

  Swift

      case clustering

- `
  ### [codeRetrieval](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO13codeRetrievalyA2CmF)

  ` Formats text for code retrieval.

  #### Declaration

  Swift

      case codeRetrieval

- `
  ### [factChecking](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO12factCheckingyA2CmF)

  ` Formats text for fact verification.

  #### Declaration

  Swift

      case factChecking

- `
  ### [questionAnswering](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO17questionAnsweringyA2CmF)

  ` Formats text for question answering.

  #### Declaration

  Swift

      case questionAnswering

- `
  ### [retrievalDocument](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO17retrievalDocumentyA2CmF)

  ` Formats text as a retrievable document.

  #### Declaration

  Swift

      case retrievalDocument

- `
  ### [retrievalQuery](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO14retrievalQueryyA2CmF)

  ` Formats text for a search or retrieval query.

  #### Declaration

  Swift

      case retrievalQuery

- `
  ### [semanticSimilarity](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO18semanticSimilarityyA2CmF)

  ` Formats text for semantic similarity comparison.

  #### Declaration

  Swift

      case semanticSimilarity

- `
  ### [allCases](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO8allCasesSayACGvpZ)

  ` A collection of all values of this type.

  #### Declaration

  Swift

      nonisolated static var allCases: [EmbeddingType] { get }

- `
  ### [init(rawValue:)](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO8rawValueACSgSi_tcfc)

  ` Creates a new instance with the specified raw value.

  If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example:

  enum PaperSize: String { case A4, A5, Letter, Legal }

  print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)"

  print(PaperSize(rawValue: "Tabloid")) // Prints "nil"

  #### Declaration

  Swift

      init?(rawValue: Int)

  #### Parameters

  |---|---|
  | `rawValue` | The raw value to use for the new instance. |

- `
  ### [rawValue](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO8rawValueSivp)

  ` The corresponding value of the raw type.

  A new instance initialized with `rawValue` will be equivalent to this instance. For example:

  enum PaperSize: String { case A4, A5, Letter, Legal }

  let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter"

  print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

  #### Declaration

  Swift

      var rawValue: Int { get }

- `
  ### [AllCases](https://developers.google.com/edge/api/mediapipe/swift/text/Enums/EmbeddingType.md.txt#/s:18MediaPipeTasksText13EmbeddingTypeO8AllCasesa)

  ` A type that can represent a collection of all values of this type.

  #### Declaration

  Swift

      typealias AllCases = [EmbeddingType]