DEV Community

Cover image for 🤖 ChatGPT meets Firestore: Create Intelligent Conversations in Your App
Alvin James Bellero
Alvin James Bellero

Posted on • Edited on

🤖 ChatGPT meets Firestore: Create Intelligent Conversations in Your App

👋 🤝 Hello, everyone! It's been a long time!


⚡️ Quick Story

I can still vividly recall the excitement I felt when Firebase announced Extensions at the 2019 Summit in Madrid, Spain. I immediately saw the immense value they could bring to us developers, especially for those of us heavily relying on Firebase products.

Now, as AI's popularity soars, I've seen a multitude of innovative applications powered by this technology, giving rise to increasingly beneficial products. Truly, the sky's the limit when it comes to AI's potential!


👀 What's New?

It's been a week now since the Firebase Team approved my first-ever Firebase Extension: Chatbot with ChatGPT ! 🥳 👏 🍾

It is an extension that integrates the ChatGPT Model from OpenAI and designed to facilitate AI-based conversations in real-time chat applications backed by Firestore.

By making use of Firebase and ChatGPT's powerful language processing capabilities, this extension empowers developers to implement AI-based automated interactions within their apps, making them more engaging and interactive!


📌 How to Use

Setting up and using Chatbot with ChatGPT is easy.

Go to the extensions page and click Install in Firebase console button. Follow the prompts, and you're good to go!



⚙️ Configurable Parameters

  • Collection Path: Path to a Cloud Firestore collection which will represent a discussion with OpenAI's ChatGPT.

  • Prompt Field: The field in the message document that contains the prompt. (Default: prompt)

  • Response Field: The field in the message document into which to put the response. (Default: response)

  • Cloud Functions Location: Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the location selection guide.

  • Language Model: Which language model do you want to use? Refer to OpenAI's Model Reference.

  • Temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Learn more here.

  • Nucleus Sampling Probability: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. Learn more here.


🎬 Demo

For this demo, here's my configured params:

  • OpenAI API Key: *******************
  • Collection path: users/{uid}/messages
  • Prompt field: (default - prompt)
  • Response field: (default - response)
  • Language Model: GPT-3.5

Chatbot with ChatGPT Demo


That's all folks! 🤜🤛

Give it a try, please share your experiences, thoughts, and suggestions. Also, please don't forget to share this to your friends! 😊

Thank you so much! 🙇


Top comments (2)

Collapse
 
dream_exch38181e7a profile image
galaxy book

Thank you for providing such an outstanding post. Dreamexch whatsapp number

Collapse
 
stephanietichenor profile image
StephanieTichenor

Thanks for sharing amazing post with us. Dreamexch whatsapp number