Fix Incorrect Import Paths In Langchain-Core Docstring Examples
Docstring examples in langchain-core reference modules 'langchain_core.output_parser', 'langchain_core.runnable', and 'langchain_core.documents' which do not exist, causing ModuleNotFoundError or ImportError when copied. The correct modules are 'langchain_core.output_parsers', 'langchain_core.runnables', and 'langchain_core.documents.base'.
The docstrings use singular module names (output_parser, runnable) and import Blob from the package root, but the actual modules are plural (output_parsers, runnables) and Blob is defined in documents.base, not exported from documents.__init__. This is a documentation inconsistency rather than a runtime failure.
Run the following imports as shown in the docstrings:
```python
from langchain_core.output_parser import StrOutputParser
from langchain_core.runnable import RunnableLambda
from langchain_core.documents import Blob
```
Each raises ModuleNotFoundError or ImportError.
Fixing Code Block
Replace the incorrect import statements in the corresponding docstrings with the correct ones:
```python
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnableLambda
from langchain_core.documents.base import Blob
```
Update the import paths in all affected docstrings to use the actual module names: 'output_parsers' (plural), 'runnables' (plural), and 'documents.base' for Blob. This ensures users copying the examples will not encounter import errors.
Edge Case Audit
This is a docstring-only change and does not affect runtime behavior. However, ensure a global search for the old import paths is performed to catch all occurrences. No rollback is necessary unless future versions re-export these names from the old paths, in which case the docstrings could be reverted. The change is safe for all Python versions and concurrency models.