Google Gemini/AI Studio: Better than Custom GPTs?
Gemini provides what could best be described as a formidable and forward-thinking no/low-code development environment for everyone -- even coders.
Google’s newly renamed and updated AI Studio is arguably a perfect start as a no/low-code platform for generative AI engineering1. It has all the trappings of a platform that will delight anyone who has tried and largely failed to build repeatable and testable prompts using ChatGPT.
This is a topic I have debated with many who say they are 2x, 10x, and even 100x more efficient using ChatGPT. But the reality is, we cannot chat our way to higher output. Eventually, our hands and fingers will tire. We will become weary. We will craft crappy prompts even when we know we should take the time to be explicit. Those we push to use ChatGPT will feel the same, or worse, as they try to mimic our success. They won’t be as successful.
Something’s gotta give. Or something’s gotta change.
Structured and Freeform Prompts
AI Studio is a development veneer for creating AI resources. Two of them are prompts. One intended for the usual and customary type of prompting you are familiar with - Freeform. And another you are not familiar with - Structured. The latter is designed to embrace your data and provides a framework for binding it to a prompt.
Structured prompts, chat prompts, and tuned models will undoubtedly pique your interest, but I have limited time this week, so I’ll remain focused on getting you into a frame of mind that GPT-whatever may not be ideally positioned to help you do your best AI work.
The key point is that all of these prompt types are persistent. You build them like a document. They have a name. They can be saved. They can include test cases. And they can be shared through the entire Google Workspaces ecosystem. You can even get the code to implement the resources you craft as a feature in other apps.
Do you see where this is going? Repeatable, shareable, testable, versionable and prompt code generator - this is an integrated development environment for everyday generative AI users who have no desire to code and for many who may be code-proficient.
Imagine you wanted to build an FAQ system for your small business workers. I’ll use an FAQ for CyberLandr as an example since I can openly discuss these capabilities using public content on the web.
In this use case, it needs to feature questions and answers like this.
They could just as easily be technical guidelines, or HR policies, or whatever. The Freeform prompt makes it possible to build a specific “agent” to help users close the distance and time between a question and an answer.
The prompt development environment is simple and very functional. It allowed me to build, test, and share the FAQ agent in about 20 minutes.
By the numbers…
The prompt name.
The prompt’s prologue establishes the boundaries for its behavior.
The corpus - i.e., your data. In this case, questions and answers.
The test facility where you describe likely user inputs to validate outputs.
Save, share, get code.
The prompt settings, model choice, temperature, etc. I’ve selected Gemini-Pro for this prompt. Soon, Ultra will be available.
Imagine encountering a test case that doesn’t respond well like this one.
Just add it to the data, save it, and retest.
This no/low-code development environment also features batch testing. If you are concerned about a change in your prompt that could affect other contexts, AI Studio has the remedy - run all tests.
Creator Economy
Do you see where this is taking us? You have the ability to bind your knowledge to AI “apps” in a fully secure platform - one that already exists in the Google ecosystem. But it’s more than just apps; it embraces fine-tuned models as well. And it includes a framework for injecting your data or your business data into these resources.
I believe this holds great promise for generative AI creators.
My Take
Perhaps I’m as drunk on AI Studio (and Gemini) as many have been on ChatGPT. But, unlike most, I got drunk at both parties and I gotta say, the DJ at Google’s party is playing some tunes that resonate with me as a developer and a no-code enthusiast.
Low-code
The Python code to replicate this prompt without the UI (of course) is quite simple. I’ve experimented with JavaScript output; it is fast and easy to integrate.
"""
At the command line, only need to run once to install the package via pip: $ pip install google-generativeai
"""
import google.generativeai as genai
genai.configure(api_key="YOUR_API_KEY")
# Set up the model
generation_config = {
"temperature": 0.7,
"top_p": 1,
"top_k": 1,
"max_output_tokens": 2048,
}
model = genai.GenerativeModel(model_name="gemini-pro",
generation_config=generation_config,
safety_settings=safety_settings)
prompt_parts = [
"You are an expert in all things CyberLandr. You will answer only questions pertaining to CyberLandr and you will respond with comments that are grounded in truth.\n\nI will give you the CyberLandr FAQs. Users will give you questions, and you will generate terse, but clear responses based on CyberLandr FAQs and only that source of information.\n\nWhen asked about anything other than CyberLandr, you will politely respond with something like \"I'm sorry Dave, I can't do that.\"\n\nCyberLandr FAQs: \n\nQ: What is the CyberLandr FAQ page address?\nA: https://cyberlandr.com/faq\n\nQ: Are you designing CyberLandr based on a Cybertruck prototype?\nA: Yes, we have continued to adapt and refine our design based on the latest Cybertruck prototypes and we now have high confidence that our specifications are very close to the production Cybertruck. ...",
]
response = model.generate_content(prompt_parts)
print(response.text)
Onward with more code …
I’ve successfully integrated Gemini-Pro using Google Apps Script for tests and some production work. It is faster than OpenAI’s APIs, and it has demonstrated to me (anecdotally at least) a somewhat higher degree of inferencing precision than ChatGPT-3.5 Turbo.
Here’s a simple Google Apps Script function to call the Gemini-Pro model.
Keep reading with a 7-day free trial
Subscribe to Impertinent to keep reading this post and get 7 days of free access to the full post archives.