Skip to content

Commit

Permalink
langchain[patch]: Add warning in react agent (langchain-ai#26980)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Oct 31, 2024
1 parent 2f62546 commit b4cb208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/core/langchain_core/callbacks/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,8 @@ async def foo(inputs):
):
print(event)
.. warning: If using python <= 3.10 and async, you MUST
.. warning::
If using python <= 3.10 and async, you MUST
specify the `config` parameter or the function will raise an error.
This is due to a limitation in asyncio for python <= 3.10 that prevents
LangChain from automatically propagating the config object on the user's
Expand Down
6 changes: 6 additions & 0 deletions libs/langchain/langchain/agents/react/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def create_react_agent(
Based on paper "ReAct: Synergizing Reasoning and Acting in Language Models"
(https://arxiv.org/abs/2210.03629)
.. warning::
This implementation is based on the foundational ReAct paper but is older and not well-suited for production applications.
For a more robust and feature-rich implementation, we recommend using the `create_react_agent` function from the LangGraph library.
See the [reference doc](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent)
for more information.
Args:
llm: LLM to use as the agent.
tools: Tools this agent has access to.
Expand Down

0 comments on commit b4cb208

Please sign in to comment.