langchain-ai/langgraph · error · ValueError
func must be provided
Error message
func must be provided
What it means
Constructor guard in EmbeddingsLambda.__init__: the func argument is None. EmbeddingsLambda exists solely to wrap a sync or async embedding function into the Embeddings interface; with no function there is nothing to adapt, so initialization fails immediately.
Solutions
- Pass the embedding function: EmbeddingsLambda(my_embed_fn) where fn takes list[str] and returns list[list[float]]
- For async-only functions, pass the coroutine function and use aembed_documents/aembed_query
- Or use ensure_embeddings(fn) which wraps the function for you
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/checkpoint/langgraph/checkpoint/store/base/embed.py:156 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/0050b060e62b79a6.
Report an issue: GitHub.
Appendix: source
Thrown at libs/checkpoint/langgraph/checkpoint/store/base/embed.py:156
def __init__(
self,
func: EmbeddingsFunc | AEmbeddingsFunc,
) -> None:
if func is None:
raise ValueError("func must be provided")
if _is_async_callable(func):
self.afunc = func
else:
self.func = funcView on GitHub (pinned to 38031739e5)