This is a project that provides the API that allows you to chat with an AI
- Put necessary contents in the
config.json
file - Put the necessary contents in the
client_secretes.json
file
Those files go under .env folder in root of the project.
config.json requires the following keys:
"OPEN_API_KEY"
- Enter your own Open Api Key"WORKING_URL"
- Either http://localhost:4200/ for DEV or to https://ezy.works/ for PROD."PROTOCOL"
- "http" for DEV or "https" for PROD
See doc for additional info
Run the following command to start the flask backend
flask run
Run the following command to test the agent locally by entering the message thru the command prompt.
python -m local_agent_chat
# Run the following command back to back. Should give end result of: 105
curl -X POST http://127.0.0.1:5000/chat/conversation -H 'Content-Type: application/json' -d '{"userid":"1","message":"Whats 10 times 10"}'
curl -X POST http://127.0.0.1:5000/chat/conversation -H 'Content-Type: application/json' -d '{"userid":"1","message":"and plus 5"}'
curl -X POST http://127.0.0.1:5000/chat/conversation -H 'Content-Type: application/json' -d '{"userid":"1","message":"Write 1 to 5 to cell A1 to A5 in my google sheet with sheetid=0"}'
Project utilises Redis for persistent storage of user sessions, see doc. Redis along with Redis-cli have to be installed in order for persistence to work. Once cli and server are installed, it must be run using 'redis-server' command first.