generateEmbedding

fun generateEmbedding(input: String, dimensions: Int = 1536): List<Float>(source)

Generates a deterministic, normalized embedding vector from a string.

Converts the input string into a floating-point vector of the specified dimension, using a repeatable mathematical transformation. The resulting vector has an L2 norm of approximately 1.0. For empty input, returns a zero vector.

Intended for testing purposes only; does not produce semantically meaningful embeddings.

Return

A list of floats representing the normalized embedding vector.

Parameters

input

The string to convert into an embedding vector.

dimensions

The number of dimensions for the output vector (default is 1536).