From scratch implementation of the ReAct pattern for agents that basically approaches user's request in Thought/Action/Observation manner with tool calling support
notebookscontainsinit_playground.ipynbthat served as a playground during testing/implementation phase.
extraction_result.pya simple python dataclass that contrains extracted content informationmessage.pysimple python dataclass that contains role and content of the message.react_agent.pyimplementation of the ReAct agent that leverages groq to interact with LLMtool.pyhelper class to construct list of available tools for LLMmain.pycontains base usage of theReactAgentand contains predefined tools + message
To run the project first you need to clone the repository
git clone https://github.com/georgetsouvaltzis/agents-react-pattern.gitthen navigate to project repo by using
cd agents-react-patterncreate .env file based on .env.example
cp .env.example .envsupply the GROQ_API_KEY(required) in .env file
GROQ_API_KEY=<"your-key-here">
create virtual environment(.venv) and activate by typing:
python3 -m venv .venv
source .venv/bin/activateinstall the project requirements:
pip install -r requirements.txtto see an example run the main.py by using:
python main.py