Skip to content

Commit b4cb208

Browse files
authored
langchain[patch]: Add warning in react agent (#26980)
1 parent 2f62546 commit b4cb208

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

libs/core/langchain_core/callbacks/manager.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,8 @@ async def foo(inputs):
25022502
):
25032503
print(event)
25042504
2505-
.. warning: If using python <= 3.10 and async, you MUST
2505+
.. warning::
2506+
If using python <= 3.10 and async, you MUST
25062507
specify the `config` parameter or the function will raise an error.
25072508
This is due to a limitation in asyncio for python <= 3.10 that prevents
25082509
LangChain from automatically propagating the config object on the user's

libs/langchain/langchain/agents/react/agent.py

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def create_react_agent(
2727
Based on paper "ReAct: Synergizing Reasoning and Acting in Language Models"
2828
(https://arxiv.org/abs/2210.03629)
2929
30+
.. warning::
31+
This implementation is based on the foundational ReAct paper but is older and not well-suited for production applications.
32+
For a more robust and feature-rich implementation, we recommend using the `create_react_agent` function from the LangGraph library.
33+
See the [reference doc](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent)
34+
for more information.
35+
3036
Args:
3137
llm: LLM to use as the agent.
3238
tools: Tools this agent has access to.

0 commit comments

Comments
 (0)