Our docs got a refresh! Check out the new content and improved navigation. For detailed API reference see our Python SDK docs and TypeScript SDK.
Description
PercivalIntegrations

Langchain Integration

This guide shows how to instrument LangChain applications with Percival/Patronus by installing the required packages and initializing the instrumentor.

pip install patronus
pip install langchain langchain_openai langgraph
pip install openinference-instrumentation-langchain
pip install opentelemetry-instrumentation-threading
pip install opentelemetry-instrumentation-asyncio

Once installed, you can import the following instrumentors:

from openinference.instrumentation.langchain import LangChainInstrumentor
from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
 
import patronus
patronus.init(integrations=[LangChainInstrumentor(), ThreadingInstrumentor(), AsyncioInstrumentor()])

On this page

No Headings