[PAID] 🧠 Gemini Extension to interact with the Gemini-pro model from Google

the "GenerateGeminiContent" block has stopped working, it is giving the following error message: Error processing Gemini API response: No value for index

:sparkles: You can Try the free version of Gemini Extension

@Black_Knight What about providing a "nice" error message like "all tokens of the free version are used up. You might consider to upgrade to the paid version of the extension"

Taifun

New Update for adding a new models from Gemini called "gemini-2.0-flash-exp" , "gemini-2.0-flash-thinking-exp" , "gemini-2.0-flash-thinking-exp-1219", "gemini-exp-1206" ,
"learnlm-1.5-pro-experimental"

is a powerful model that will handle more complex tasks try it now using the Extension of Gemini

image

Gemini Extension

Experimental models

paid for Gemini.aix today, but I was not directed to the website to download the file.

I sent the files for you in pm
and
I am sorry for your bad situation and my late reply
I recommend at next time you pay you can use pc not phone or use chrome browser

NEW BIG UPDATE FOR GEMINI EXTENSION




:rocket: The Most Powerful AI Extension for MIT App Inventor! :rocket:

This web app showcases just a few of the incredible features of the Gemini API extension—but there’s so much more!

:sparkles: Key Features:
:white_check_mark: Generate human-like responses
:white_check_mark: Understand and process natural language
:white_check_mark: Perform AI-powered text analysis
:white_check_mark: Enhance your app’s interactivity with smart AI
:white_check_mark: Create customizable data APIs using the Structured Response feature

And that’s just the beginning! :bulb: This extension empowers your app with cutting-edge AI capabilities like never before.

:link: Try the Demo Now: https://astounding-beijinho-4cd939.netlify.app/

New Update => (Search the web feature added)

How to Build Your Own AI "APIs" in App Inventor—The Easy Way!

Stop Wrestling with Text! Build Your Own AI "APIs" in App Inventor—The Easy Way!

Tired of getting long, messy sentences back from AI and then spending hours trying to pick out the exact piece of information you need with complex text blocks?

Wish you could just ask an AI to do a specific task and get back clean, predictable data ready to plug straight into your app?

Good news! You absolutely can, and it's WAY easier than you think!

Using The Gemini Extension combined with a simple trick—telling Gemini to respond in JSON —you can unlock powerful, custom AI capabilities right within your App Inventor projects.

Think of it like building your own mini-API service, powered by Google's Gemini, without needing any servers or complex coding!

Why is this so EFFECTIVE?

  • AI Power on Demand: Need instant translation? A smart summarizer? Sentiment analysis? Keyword extraction? You can build specialized AI "functions" for almost anything.

  • Predictable Data: No more guessing! JSON gives you structured data (like {"name": "John", "status": "active"}) that App Inventor handles perfectly.

  • Clean Blocks: Your code becomes dramatically simpler and more readable.

Why is this so EASY for App Inventor Developers?

  1. You Define the "API Call" in Plain English: Your "API function" is just part of your prompt! You simply tell Gemini what to do AND how to format the answer as JSON.
  • Example Prompt: "Translate this to Spanish: '{text_to_translate}'. Respond ONLY with JSON like this: {'translation': '...'}. No extra text!"
  1. One Block to Decode: You already have the tool! The standard Web component's JsonTextDecode block instantly turns that clean JSON response into an App Inventor dictionary.

  2. Simple Data Access: Use the basic lookup in pairs dictionary block to grab exactly the piece of data you need (e.g., get the value for the translation key).

See this simple example blocks :

That's it! Seriously.

Prompt -> Send with Extension -> Receive Event -> JsonTextDecode -> lookup in pairs -> Use Data!

Forget complicated text parsing or setting up external servers. You leverage the visual blocks you already know to command a powerful AI and get back exactly what you need, neatly packaged.

This method transforms Gemini from just a text generator into a flexible, custom backend service tailor-made for your app's specific needs.

Ready to make your apps smarter and your blocks cleaner? Grab BlackNight's Gemini extension, craft a prompt asking for JSON, and see how easy and effective it is to have your own custom AI service running directly inside App Inventor!

Note : ChatGPT extension has the same feature

1 Like

Nice trick!
I think its possible to do it with the ChatBot component too?

1 Like

I don't see the structured output response blocks in your topic!
Could you quote the block image of your extension that achieve this .

For more info, see the meaning of structured outputs

1 Like

After prompting the AI to respond in json can't we use native dictionary blocks to parse json?

Not exactly like this,
This is the difference between the fixed original JSON response of the gemini API
and the customized json structured inside the original json structure that called structed output "

image

  • Free Text Response:

    • What it is: Normal sentences, like a chat conversation.

    • Problem: Unpredictable format. App Inventor needs complex/fragile text blocks (split, segment) to try and find the data. Often breaks.

  • Customized Structured (JSON) Response:

    • What it is: Data organized with specific labels (keys) in a strict format ({"key": "value"}). You tell the AI to use this format.

    • Benefit: Predictable format. App Inventor uses JsonTextDecode + simple dictionary blocks (lookup in pairs) to easily and reliably grab the exact data needed. Much more robust.

To clarify it more, see this example

Example: Translation API using Gemini with Structured Output

Here is the JSON schema that defines the structured output for the translation API based on the provided MIT App Inventor blocks.


JSON Schema for Structured Output

{
  "type": "object",
  "properties": {
    "translation": {
      "type": "string",
      "description": "The translated text."
    },
    "original_text": {
      "type": "string",
      "description": "The original input text before translation."
    }
  },
  "required": ["translation", "original_text"]
}

How This Schema Works

  1. Defines an Object: The response is structured as an object.
  2. Includes Two Properties:
  • "translation" → Contains the translated text.
  • "original_text" → Stores the original text before translation.
  1. Required Fields: Ensures that both "translation" and "original_text" are present in every response.

Example API Response Matching the Schema

{
  "translation": "Translate this into English",
  "original_text": "ترجم هذا إلى الإنجليزية"
}

Blocks:

image


image

This schema ensures that the Gemini API consistently returns structured data, making it easy to parse and use in your MIT App Inventor project.

@techxsarthak you can try this feature inside Google AI Studio

with structured output

without structured output

Added a block in GroqText, as I said earlier... was working on an update with new blocks, released it just now.

Same for Groq Playground - GroqCloud. Its JSON mode btw :smile:

Added blocks for it in my extension too!

:office: Structured JSON output

RequestCustomStructuredOutput

UserRequest= Question to ask to the AI
customScheme= The json type to generate

For eg.

Output

Yes its now possible with GroqText

Btw Gemini extension is also very good!

1 Like

Good job :clap:

1 Like

Thanks, your extensions are also good as always

:tada: New Update

Gemini extension now allows you to create and modify images via instructions using Google's Gemini AI models directly within your App Inventor projects!