UniversalEmbedder
class UniversalEmbedder : NSObjectPerforms multi-modal embedding extraction on text, images, audio, or composite content blocks using the native LiteRT-LM EmbeddingEngine.
-
Creates a
UniversalEmbedderfrom a local model file path.Declaration
Swift
convenience init(modelPath: String) throws -
Creates a
UniversalEmbedderfrom the givenUniversalEmbedderOptions.Declaration
Swift
init(options: UniversalEmbedderOptions) throws -
Extracts an embedding from the input text.
Declaration
Swift
func embed(text: String) throws -> EmbeddingResult -
Extracts an embedding from compressed image data (JPEG/PNG).
Declaration
Swift
func embed(imageBytes: Data) throws -> EmbeddingResult -
Extracts a multi-modal embedding from an array of
TaskPartor media objects.Declaration
Swift
func embed(content: [Any]) throws -> EmbeddingResult -
Computes cosine similarity between two
Embeddingobjects.Declaration
Swift
class func cosineSimilarity(embedding1: Embedding, embedding2: Embedding) throws -> NSNumber