This repo is an addition to the article on the HubSpot dev blog. Read article for better understanding on how to use the code.
Run npm i command in your terminal to install dependencies.
Then run npm run build to get the file for copying to a HubSpot chat function.
Open dist folder and copy everything from the index.js file.
Paste the code into the HubSpot chat function.
Open index.js.
Change the code as you see it fits.
Run npm run build to get the modified file for copying to a HubSpot chat function.
05/14/2024 code has been updated to support GPT-4o. Just replace your js code with the code from ./dist/index.js