Welcome to Portkey Forum

Updated 5 days ago

the langchain callback handler does not display a tree-like representation of the trace

Also related, I added the Langchain callback handler, but I do not see the tree-like representation of my trace, instead i just see a linear timeline of llm calls. I was expecting something like in the scrrenshot here: https://portkey.ai/docs/integrations/agents/langgraph#5-traces
s
b
4 comments
tagging @Chandeep | Portkey who can help you with this
also can you attach your code snippet ?
Plain Text
portkey_handler = LangchainCallbackHandler(
    api_key=".....",
)

llm = ChatOpenAI(
    api_key=SecretStr("....."),
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        trace_id=thread_id,
        config=".....",
        metadata={
            ....
        },
    ),
    callbacks=[portkey_handler],
)
I can see only this linear timeline of llm calls. Not anything else, for example tool calls.
Attachment
Screenshot_2025-03-03_at_11.25.53_PM.png
Add a reply
Sign up and join the conversation on Discord