Files
langchain/libs/core
Divy yadav 1840b73209 fix(core): improve langsmith loader error messages (#35648)
`LangSmithLoader.lazy_load()` now raises a `ValueError` with a
descriptive message when a configured `content_key` cannot be resolved
against an example's inputs — whether a key along the path is missing or
the path runs into a non-mapping value. Previously the missing-key case
raised a bare `KeyError` and the non-mapping case raised a `TypeError`,
depending on the payload. Callers that caught `KeyError` or `TypeError`
around `lazy_load()` to detect a misconfigured `content_key` should now
catch `ValueError`.

---

Improve `LangSmithLoader` error handling by surfacing clearer exceptions
for conflicting client configuration and invalid nested `content_key`
paths. Valid loader behavior is unchanged; this only improves
invalid-input diagnostics.

When a `content_key` cannot be resolved against an example's inputs,
`lazy_load()` now raises a `ValueError` whose message names the full
path, the offending key, and where traversal stopped — instead of a bare
`KeyError` (missing key) or an opaque `TypeError` (path running into a
non-mapping value, e.g. a leaf string).

---------

Co-authored-by: Divy Yadav <yadavdipu296@gmai.com>
Co-authored-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Mason Daugherty <mason@langchain.dev>
2026-07-05 22:21:50 -04:00
..
2026-06-12 14:54:25 -04:00
2026-06-18 15:23:00 -04:00

🦜🍎 LangChain Core

PyPI - Version PyPI - License PyPI - Downloads Twitter

Looking for the JS/TS version? Check out LangChain.js.

To help you ship LangChain apps to production faster, check out LangSmith. LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.

Quick Install

uv add langchain-core

🤔 What is this?

LangChain Core contains the base abstractions that power the LangChain ecosystem.

These abstractions are designed to be as modular and simple as possible.

The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.

⛰️ Why build on top of LangChain Core?

The LangChain ecosystem is built on top of langchain-core. Some of the benefits:

  • Modularity: We've designed Core around abstractions that are independent of each other, and not tied to any specific model provider.
  • Stability: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
  • Battle-tested: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.

📖 Documentation

For full documentation, see the API reference. For conceptual guides, tutorials, and examples on using LangChain, see the LangChain Docs. You can also chat with the docs using Chat LangChain.

📕 Releases & Versioning

See our Releases and Versioning policies.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Resources

  • LangChain Academy — comprehensive, free courses on LangChain libraries and products, made by the LangChain team
  • Code of Conduct — community guidelines and standards