LangChain docs/examples don't seem to align with LangChain v1 apis #10162
Replies: 2 comments
-
|
The Langfuse documentation for LangChain JS/TS integration shows passing the The documented approach is: await agent.invoke(
{ messages: [{ role: "user", content: "What's the weather in San Francisco?" }] },
{ callbacks: [langfuseHandler] }
)With LangChain v1, you may need to pass callbacks differently depending on the agent type. The Langfuse integration relies on LangChain's callback system, so if LangChain v1 changed the API for passing callbacks to I don't have specific documentation showing the exact LangChain v1 callback syntax in the available sources. You may want to check LangChain's v1 migration guide for how callbacks are now passed to agents, then apply that pattern with the Langfuse If you continue to experience issues, I recommend opening a GitHub discussion with the Langfuse team about LangChain v1 compatibility, as the documentation may need updates to reflect the new API patterns. 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @dan-massey, thanks for your patience. I am not able to reproduce this. Which version of LangChain and Langfuse were you using? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking at these docs: https://langfuse.com/integrations/frameworks/langchain#langchain-example
I have created an
sdkinstance and calledsdk.start()and an instance ofCallbackHandler.The Langchain API no longer supports passing the handler to
agent.invoke.In the examples:
but
callbacksis not an acceptable key for the second object, and I get this typescript error:I see support for Langchain v1 was added in #9866 by @hassiebp but I don't think the docs are updated yet?
Beta Was this translation helpful? Give feedback.
All reactions