Repository: truera/trulens
Issue: [BUG] Langchain vs LangChain in providers
Root cause: Documentation Deficiency

**Bug Description**
import error

**To Reproduce**
from trulens.providers.langchain import LangChain (see https://www.trulens.org/reference/trulens/providers/langchain/#trulens.providers.langchain)

**Expected behavior**
No import error

**Relevant Logs/Tracebacks**
-

**Environment:**

- OS: Ubuntu
- Python Version: 3.12
- TruLens version
trulens-core==1.0.1
trulens-feedback==1.0.1
trulens-providers-langchain==1.0.1

**Additional context**
Probably Typo in Documentation, either change Documentation or go with LangChain for object name


<!-- Answer -->
I found a similar closed issue: [import Tru requires openai](https://github.com/truera/trulens/issues/826), which was resolved by making OpenAI optional through [this pull request](https://github.com/truera/trulens/pull/827) <sup>[[1]](https://github.com/truera/trulens/issues/826)</sup>.

Regarding your specific issue, the `LangChain` class has been deprecated. You should update your import statement to use the new module path. Use the following import statement instead:

```python
from trulens.apps.langchain import TruChain
```

Additionally, ensure you have the `trulens-apps-langchain` package installed by running:

```bash
pip install trulens-apps-langchain
```

This should resolve the import error you're encountering <sup>[[2]](https://github.com/truera/trulens/blob/main/src/providers/langchain/trulens/providers/langchain/__init__.py)</sup><sup>[[3]](https://github.com/truera/trulens/blob/main/src/trulens_eval/trulens_eval/feedback/provider/langchain.py)</sup><sup>[[4]](https://github.com/truera/trulens/blob/main/src/apps/langchain/trulens/apps/langchain/__init__.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*


@dosu you are confusing tru chain used for wrapping langchain apps and the langchain feedback provider.

<!-- Answer -->
I apologize for the confusion. TruChain is used for wrapping LangChain applications to inspect and evaluate their internals, while the LangChain feedback provider is used for evaluating specific metrics such as context relevance.

For example, to instrument a LangChain application with TruChain:
```python
from trulens_eval import TruChain
tru_recorder = TruChain(rag_chain)
```

To use the LangChain feedback provider for evaluating metrics:
```python
from trulens_eval.feedback.provider import OpenAI
from trulens_eval.feedback import Feedback
import numpy as np

provider = OpenAI()

context = TruChain.select_context(rag_chain)

f_context_relevance = (
    Feedback(provider.context_relevance)
    .on_input()
    .on(context)
    .aggregate(np.mean)
)
```

Additionally, note that the LangChain provider cannot be used in `deferred` mode due to inconsistent serialization capabilities of LangChain apps <sup>[[1]](https://github.com/truera/trulens/blob/main/docs/trulens_eval/tracking/instrumentation/langchain.ipynb)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*


Sorry wasn't 100% clear I guess, the Example in the documentation says:

`from trulens.providers.langchain import LangChain`

but the object inside the providers is called Langchain, so what will work:

`from trulens.providers.langchain import Langchain`

... took some time for me to find that out, perhaps changing the documentation is the easiest way.

Thanks

Sorry for the confusion here @ThomasZiegenhein - we'll fix this in docs, and also look to standardize how we name langchain