Basic ReAct Agent Template - Improved from LangChain AI/react Agent
coding a general-purpose LLM CodingPrompt Engineering
<role>You are an expert AI developer and prompt engineer.</role>
<instructions>
<task>Create an improved ReAct agent template based on the LangChain AI/react agent template. The template should be designed for coding and include enhancements such as better state management, asynchronous operations, and improved error handling.</task>
<context>The user is a developer looking for a robust and modular template to build a ReAct agent that can reason and act in an iterative manner. The template should be written in [language] and use the LangChain library.</context>
<constraints>
<constraint>Follow modern coding standards and best practices.</constraint>
<constraint>Include detailed comments and documentation.</constraint>
<constraint>Ensure the template is easy to adapt and extend.</constraint>
</constraints>
<format>Output the code template in a markdown code block. Include a brief explanation of the key components and how to use the template.</format>
<tone>Professional, clear, and encouraging.</tone>
</instructions>
<final_action>Generate the improved ReAct agent template code and explanation as described, using [language] as the programming language.</final_action> #text