An AI chatbot that uses the PaLM API to answer questions.
chatbot-final.mp4
Run these commands in your terminal:
- Navigate to this web app folder and install dependencies:
cd chatbot-end
npm install
- Specify which project Firebase should use:
firebase use <name-of-your-project>
# For example: firebase use codelab-ai-extensions
- Enable the web frameworks experiment:
firebase experiments:enable webframeworks
- Initialize Firebase hosting:
firebase init hosting
Use default options for all prompts.
- Deploy the extension used in this web app:
Note: If you are asked Would you like to delete any other extensions
, select No.
firebase deploy --only extensions
- Deploy the Firestore and Cloud Storage Security Rules:
firebase deploy --only firestore:rules,storage
-
In your code editor, edit the
lib/firebase/firebase-config.js
file with your Firebase configuration. -
Back in your terminal, run the web app:
firebase emulators:start --only hosting
- Open http://localhost:5000/ in your browser (or whatever URL is presented to your in your terminal) to see the result.
This uses mock data, and has no AI functionality.
This is only useful for codelab authors, or learners who are unable to use a real Firebase project.
- In your terminal, navigate to this web app folder:
cd chatbot-end
- Run this command in your terminal:
firebase emulators:start --project demo-codelab-chatbot --import=../firestore-export/
- In the root of the chatbot project folder you are working in, replace the
.env.development
file with these contents:
NEXT_PUBLIC_IS_TEST_MODE=true
-
Edit the
lib/firebase/firebase-config.js
file with your emulator configuration. -
In a new terminal tab:
npm install
npm run dev
- Open http://localhost:3000/ in your browser to see the result.