[Free Extension] TCBGeminiBot - Create a Chatbot with Gemini API (Free Key Support) šŸš€

Hello everybody! Today, I am excited to introduce my new extension called TCBGeminiBot
This extension allows you to create a chatbot using the Gemini API with a free API key.
Simply input your API key and start sending questions to receive AI-generated responses instantly.

:bulb: Current Version: 1.0
:open_file_folder: File Size: 430KB
File: TCBGeminiBot.aix (429.2 KB)
:date: Created On: 2025-03-16

TCBGeminiBot Extension Documentation

Overview

The TCBGeminiBot extension allows you to integrate the Gemini API into your MIT App Inventor projects. With this extension, you can create chatbots, AI-powered apps, and more by sending questions to the Gemini API and receiving responses.


Features

  1. Set API Key: Securely set your Gemini API key.
  2. Send Questions: Send questions to the Gemini API and receive responses.
  3. Event-Driven Responses: Use the GotResponse event to handle API responses.
  4. Retrieve Last Response: Fetch the last response from the API at any time.

Installation

  1. Download the .aix file for the TCBGeminiBot extension.
  2. Open your MIT App Inventor project.
  3. Go to the Extensions section and click Import Extension.
  4. Upload the .aix file.
  5. The TCBGeminiBot component will appear in the Non-visible components section.

Properties

The TCBGeminiBot extension has no visible properties. It is a non-visible component.


Methods

1. SetAPIKey

  • Description: Sets the API key required to authenticate requests to the Gemini API.
  • Parameters:
    • key (String): Your Gemini API key.
  • Usage:

blocks
TCBGeminiBot1.SetAPIKey("your_api_key_here")


2. SendQuestion

  • Description: Sends a question to the Gemini API and triggers the GotResponse event with the API's response.
  • Parameters:
    • question (String): The question or prompt to send to the API.
  • Usage:

blocks

TCBGeminiBot1.SendQuestion("What is the capital of France?")


3. GetLastResponse

  • Description: Returns the last response received from the Gemini API.
  • Returns:
    • response (String): The last response from the API.
  • Usage:

blocks
TCBGeminiBot1.GetLastResponse()


Events

1. GotResponse

  • Description: Triggered when a response is received from the Gemini API.
  • Parameters:
    • response (String): The response from the API.
  • Usage:

blocks
when TCBGeminiBot1.GotResponse do set Label1.Text to response end when

Guide to Create a API Key and Create Simple ChatBot App -: How to Create ChatBot App - The Coding Bus

2 Likes

Good work
but you can add some advanced features of the API like streaming , contentious context chat and ....
See this example extension :

2 Likes

Or like json filtering, fast inference
Example extension

2 Likes

Thanks.
sure i'll do that.

1 Like

ya sure @techxsarthak

Which software do you use for your screenshots

it's Guidde