Utilities for working with embedding functions and LangChain's Embeddings interface.
This module provides tools to wrap arbitrary embedding functions (both sync and async) into LangChain's Embeddings interface. This enables using custom embedding functions with LangChain-compatible tools while maintaining support for both synchronous and asynchronous operations.
Type for synchronous embedding functions.
The function should take a sequence of strings and return a list of embeddings, where each embedding is a list of floats. The dimensionality of the embeddings should be consistent for all inputs.
Type for asynchronous embedding functions.
Similar to EmbeddingsFunc, but returns an awaitable that resolves to the embeddings.
Ensure that an embedding function conforms to LangChain's Embeddings interface.
This function wraps arbitrary embedding functions to make them compatible with LangChain's Embeddings interface. It handles both synchronous and asynchronous functions.
Extract text from an object using a path expression or pre-tokenized path.
Tokenize a path into components.