/palm-ai-app

An application built using the PaLM API

Primary LanguageJavaScriptCreative Commons Zero v1.0 UniversalCC0-1.0

๐Ÿ๏ธ Colors A.I. ๐ŸŽจ

๐Ÿšจ NOTE: this application was originally built using Google's Palm API. However, in October 2024, I updated it to use Google's Gemini API, because Palm was discontinued.

  • I didn't change this repo name or other links because they've been shared and I don't want those links to be broken links.

An application built using the PaLM API (Update to Gemini API), the App is a fun color generator game that associates "Things" with "colors" by utilizing a trained AI Large Language Model to generate responses.

Live Links ๐ŸŽ™๏ธ
Where Code is Hosted ๐Ÿฆ

๐Ÿ—๏ธ Development ๐Ÿ—๏ธ

Setting Up & Adding Dependancies:
  • cd server
  • npm install
Running the Back End Locally:
  • cd server
  • npm start, Or: npm run dev for hot reload.
Running the Front End Locally:
  • cd client
  • Open index.html
  • If you're using VS Code you can install "Live Server" extention and click "Go Live" on the bottom nav bar in VS Code to hot reload your front end.

NOTE: the default API url is http://localhost:8080/. If you'd like to use the production API url, add #prod to your client url.

  • For example: http://127.0.0.1:5500/#prod

๐Ÿš€ Deployment ๐Ÿš€

This project uses Google App Engine. I wrote this blog post about setting that up. Also, see this blog post if you're having issues with the gcloud command not being found. Once that's set up all you'll need to do is run these commands to deploy.

NOTE: To get your API URL run the following command to open the URL in the browser.

  • gcloud app browse
Deploying Front End

This app is setup to deploy from the client subfolder. And, the branch gh-pages was made to handle that. So pushing to the main branch will not deploy changes to the front end. You'll need to run this command to do that. Which will trigger Github's actions to update your code and deploy the changes.

Deploying Back End API
  • cd server

  • gcloud app deploy

  • Then, you can run gcloud app browse to open the root url in a browser window.

  • And, you can even watch the live logs with gcloud app logs tail -s default


๐Ÿฅฝ Tests ๐Ÿงช

Client: app.js configs

To generate Hard Coded Results to add to examples.js

  • Just set _getHardCoded to true.

If you want to see all tests and examples

  • Just set _showTests to true.

Server: Mac OS Command-line test commands

You can add a string after npm start to force a specific input and join words with - to be more specfic...

  • Example: node app/test.js bear

  • Example: node app/test.js polar-bear

Mac OS Command-line test commands

Mac OS Command-line test commands


โ˜•๏ธ Resources โ˜•๏ธ