This project represents a frontend proof-of-concept for a Web3-integrated chatbot, leveraging OpenAI's large language models. The SmartAgent chatbot can assist users with various tasks including token swaps and Ethereum staking.
- Root directory: Contains the
index.jsfile which initiates the backend server responsible for interacting with the OpenAI API. srcdirectory: Houses the React.js client application..env: This is where you'll place your OpenAI API key.
Follow these steps to get the project up and running on your local machine:
-
Clone the repository:
git clone https://github.com/SmartAIAgents/smartaiagent-frontend.git -
Install dependencies:
Navigate into the root directory and run:
yarnThen navigate into the
clientdirectory and do the same. -
Set up your OpenAI API key:
Create a
.envfile in the root directory and add the following:OPENAI_API_KEY=your_openai_key OPENAI_ORGANIZATION=your_openai_orgReplace
your_openai_keyandyour_openai_orgwith your actual OpenAI API key and Organization ID. -
Start the Node.js server:
In the root directory, run:
node index.js -
Start the React.js client:
Navigate into the
clientdirectory and run:yarn startOpen http://localhost:3000 to view the client app in your browser.