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.
Current Version: 1.0
File Size: 430KB
File: TCBGeminiBot.aix (429.2 KB)
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
- Set API Key: Securely set your Gemini API key.
- Send Questions: Send questions to the Gemini API and receive responses.
- Event-Driven Responses: Use the
GotResponse
event to handle API responses. - Retrieve Last Response: Fetch the last response from the API at any time.
Installation
- Download the
.aix
file for theTCBGeminiBot
extension. - Open your MIT App Inventor project.
- Go to the Extensions section and click Import Extension.
- Upload the
.aix
file. - 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