Skip to main content
PyPI

Overview

Complete API reference documentation for the fiddler-langchain package, which instruments LangChain V1 agents (the langchain.agents.create_agent API and middleware pattern) and exports OpenTelemetry traces to Fiddler.
pip install fiddler-langchain
from fiddler_langchain import FiddlerLangChainInstrumentor

Components

Attributes

Span and session attribute helpers. add_span_attributes attaches component-scoped attributes to a specific model, retriever, or tool. add_session_attributes and set_conversation_id are re-exported from fiddler-otel and propagate through every span in the current trace context.

Tracing

Instrumentation entry points and LLM context helpers. FiddlerLangChainInstrumentor is the one-time setup that wires the Fiddler exporter into LangChain; FiddlerAgentMiddleware is a drop-in agent middleware that emits spans for LLM, tool, and chain steps; set_llm_context and clear_llm_context attach and remove retrieval context (e.g. retrieved documents) on the active model so it appears on its LLM spans.