embeddings turns text into vectors you can compare.
rerank takes a query and a list of candidates and reorders them by relevance.
Embedding text
i of the result matches index i of the input.
Batch rather than looping: one call with fifty strings is far cheaper than fifty calls.
Comparison helpers
Electron is the only SDK with these on the namespace:Embedding or a raw Float32Array. Elsewhere you write these yourself, or use
helpers on the vector type.
Options
Leave
normalize on unless you have a reason. With it off, similarity scores are not
comparable across texts of different lengths.