Hi,
We want to not log some parts of input to Langsmith. Is it possible wit this setup:
We are deploying our app to LangGraph platform. We are using LangGraph to define graphs. We are using langchain’s libraries to invoke LLMs (ChatOpenAI
, ChatAnthropic
etc.).
When running the graphs, every node’s input and output get stored in Langsmith.
This is a sample of what our code looks like:
# State definitions
class GraphInput(TypeDict):
text: str
big_text: str # a larger input
class GraphOutput(TypeDict):
verdict: str
class GraphState(GraphInput, GraphOutput):
hidden_text: str
# Example of a node
async def example_node(state, config):
chain = ChatOpenAI() | StrOutputParser()
res = await chain.ainvoke(state["text"] + state["big_text"])
return {"hidden_text": res}
For this example, I’m interested in hiding in Langsmith traces the values (or entire keys) of big_text
and hidden_text
.
How to do that? I don’t want to hide all inputs and outputs, just some of these keys.
I’ve found these docs (Prevent logging of sensitive data in traces | 🦜️🛠️ LangSmith), but there are no examples of using this for LangGraph platform + langchain libraries, which have tracing automatically failing.
Thanks