FiddlerAgentMiddleware
when creating spans. Unlike add_session_attributes(), these are
scoped to individual components and only applied to spans created for
that component (e.g. a particular model, retriever, or tool).
Parameters
The LangChain component to annotate (modified in place).
Accepts
BaseLanguageModel,
BaseRetriever, or
BaseTool instances.Arbitrary key-value attributes. Keys matching known
FiddlerSpanAttributes values are set
directly; all others are prefixed with fiddler.span.user..Returns
None Example: default from langchain_openai import ChatOpenAI from fiddler_langchain import add_span_attributes llm = ChatOpenAI(model=“gpt-4o”) add_span_attributes(llm, model_tier=“premium”, use_case=“summarization”)