Expand description
Embeddings: embed for one value, embed_many for several (split
into provider calls by the model’s limits) and cosine_similarity.
Design: docs/01-architecture/11-other-modalities.md §1.
Structs§
- Embed
- Builder returned by
embed;.awaitruns the call. - Embed
Many - Builder returned by
embed_many;.awaitruns the calls. - Embed
Many Result - Result of
embed_many. - Embed
Result - Result of
embed. - Embedding
Usage - Token usage of embedding calls;
Nonewhen the provider reported none.
Functions§
- cosine_
similarity - Cosine similarity of two vectors;
0.0when either has zero length. - embed
- Embeds one value.
- embed_
many - Embeds several values, splitting them into provider calls by the model’s limits and running the calls concurrently when the model allows it.
Type Aliases§
- Embedding
- An embedding vector.