Expand description
Embedding model implementations for LangChainRust.
Provides embedding generation via multiple backends:
- OpenAI (
text-embedding-ada-002,text-embedding-3-small/large) - DeepSeek
- Qwen (Alibaba Cloud / DashScope)
- Local:
BagOfWordsEmbeddings(always available) andLocalEmbeddings(ONNX, feature-gated) MockEmbeddingsfor testing
Structs§
- BagOf
Words Embeddings - Lightweight local embedding (word-frequency hash + L2 normalization)
- Deep
Seek Embeddings - DeepSeek embeddings client for generating vector embeddings.
- Deep
Seek Embeddings Config - Configuration for DeepSeek embeddings API.
- Mock
Embeddings - Mock embeddings for testing purposes.
- OpenAI
Embeddings - OpenAI Embeddings client
- OpenAI
Embeddings Config - OpenAI Embeddings configuration
- Qwen
Embeddings - Qwen embeddings client for generating vector embeddings.
- Qwen
Embeddings Config - Configuration for Qwen embeddings API.
Enums§
- Embedding
Error - Embedding error type
Constants§
- DEEPSEEK_
EMBED_ MODEL - Default embedding model for DeepSeek.
- QWEN_
EMBED_ MODEL - Default embedding model for Qwen.
Traits§
- Embeddings
- Embedding model trait
Functions§
- cosine_
similarity - Compute cosine similarity between two vectors.
Type Aliases§
- Local
Embeddings - Without the
local-embeddingsfeature,LocalEmbeddingsis a type alias forBagOfWordsEmbeddings, maintaining backward compatibility.