MediaPipeTasksText Framework Reference

TextFormatContext

class TextFormatContext: NSObject

Encapsulates formatting instructions for models that require a specific prompt format.

  • The embedding type of type MPPEmbeddingType.

    Declaration

    Swift

    var embeddingType: MPPEmbeddingType { get set }
  • The role of the text of type MPPTextRole. Defaults to MPPTextRoleQuery.

    Declaration

    Swift

    var textRole: MPPTextRole { get set }
  • The title of the text. This is only used for MPPEmbeddingTypeRetrievalDocument.

    Declaration

    Swift

    var title: String? { get set }