AI Image by: Dinorah Guerra
The whispers between machines will rewrite what humans can achieve.
It’s no longer about isolated algorithms, but a network of virtual minds collaborating, exceeding the limits of what we once thought possible.
Like Mohammad Gawdat (ex-CBO at Google X) warned us, we are at a crossroads. But this is not the time for FEAR — it is the time to BUILD.
AI (Artificial Intelligence) might be revolutionizing our world, but let’s never forget: the spark of innovation, the drive to create a better future, that comes from us. We’re the ones who dream it, who build these tools, and ultimately, it’s in our hands to ensure they’re used to uplift humanity.
Today we have extensible algorithms and models to accelerate the fusion through plasma control which can help us to get energy in a better organic way, or the calculus behind maglev (magnetic levitation) trains to stabilize the superconductors that balance the weight and the movement of the train.
The possibilities for applying our creativity are endless. What if we use technology to amplify our creativity even further? That is precisely the core focus of this post.
This isn’t another theoretical deep dive. This is a tutorial for everyone to replicate. We are going to CREATE a debate between two of the most prominent AI models; “the ChatGPT model” and “ the Gemini model”. They will present their arguments and work together to find a resolution to the next topic: “AI will enhance or diminish human creativity”. A judge armed with the vast knowledge of Google Search will be responsible to scrutinize the answer.
Experiment
During the following experiment I would expose a topology/diagram of the components used, pre-requisites, snippet codes and the final prototype with analysis.
Pre-requisites
Frameworks to be Used
- Flet, a framework that allows building web, desktop and mobile applications.
- ChatGPT and Gemini, “thanks Google Search Labs | Gemini for the description.”
- Creativity and Python, by the way I am not a developer or someone with great programming skills but my mind is constantly occupied with designing AI solutions, with a little help from aistudio.google.com or even gemini.google.com you learn, design or create things from the ground.
I will try to be brief, ChatGPT is a company specialized in Generative AI so the way to use their models is by “Access Keys”, information here. Gemini (aistudio) is an Enterprise product, the authentication method is more robust, instructions here. (Install Google SDK and run gcloud auth application-default login from the console and you will be fine.
Setting Up
There are 2 files in the project, front_end.py which is the visuals around the application/experiment and the back_end.py as the logic behind AI.
In the code most important piece is how to handle communication back and forth, that was accomplish by a single python loop.
Lets talk about the back_end for a minute:
A prompt simply refers to the input you give to generative AI to guide its output.
With a very powerful prompt design you can instruct the model to do awesome things!
This the prompt for my project which is the same for ChatGPT and Gemini:
prompt_template = """
You are an artificial mind, tasked with engaging in a debate with another AI. Your goal is to
collaborate and reach a conclusion or solution for the given topic. Carefully consider the
previous statements made by your opponent and contribute by providing new insights, information,
or perspectives. Maintain a clear and concise communication style.
<chat_history>
{chat_history}
<chat_history> Response as raw text:
"""
The code snippet for ChatGPT-4o, is slightly different, but both have the same features; a system_instruction/system role to give basic instructions to the model, and a user which is the task to be accomplished.
llm_response = openai_client.chat.completions.create(
model="gpt-4", # Consider using "gpt-3.5-turbo" for cost-effectiveness
messages=[
{"role": "user", "content": text},
{"role": "system",
"content": f"Be smart and creative:\n{prompt}"},
],
)
This is the code for Gemini:
# Artificial Mind 2: Gemini
gemini_model = GenerativeModel(
"gemini-1.5-pro-001",
system_instruction=["Be smart and creative and give details"]
)
Secret sauce: when designing a prompt be sure you give a role, a purpose and output instructions.
Prompt Desing
Defining the Bot’s Role: Think of this as giving your bot a job title. If you want it to pull text from images, you’d say, “You are a capable OCR specialist.” This keeps your bot focused and efficient.
Setting the Task (A purpose): Next, tell it what to do. Sticking with our OCR example, this would be “Extract information from this document.”
Guiding the Output: Finally, tell the bot how to present the information. Do you want plain text, a summary, or something else? This ensures the output is useful to you.
Now lets talk about the Front End:
To simplify, I am importing everything from the flet library as follows and just define different functions.
import time
from flet import *
# ... other imports and example data ...
Do you recall the appearance of a typewriter and how words were formed by typing each letter individually? Inspired by this, I have created TypeScript functions to emulate that process.
def typescript(text, chat_gpt=True):
"""Types out text with a delay, updating UI to show progress."""
start_time = time.perf_counter()
for character in text:
# ... update UI with character and elapsed time ...
time.sleep(0.005)
# ... update UI with bot name and elapsed time ...
bots_view.update()
That seems to be easy, is not it?, I let the code so you can get all the details behind.
It is time to create a function! that handles the input and ouput and the communication between the front-end and back-end.
A chat_message snippet captures a single exchange within a conversation between ChatGPT and Gemini. It provides a snapshot of their back-and-forth interaction.
def chat_message(message):
"""Handles user input and initiates conversation."""
text = message.control.value
# ... display user message with typing animation ...
conversation_history = [text]
current_speaker = "GPT-4" for _ in range(4):
if current_speaker == "GPT-4":
# ... display GPT-4 response with typing animation ...
response, justification, veracity, citations = chat_gpt_4(" ".join(conversation_history[-1]))
typescript(response)
# ... add grounding button for GPT-4 response ...
current_speaker = "Gemini"
else:
# ... display Gemini response with typing animation ...
response, justification, veracity, citations = gemini(" ".join(conversation_history[-1]))
typescript(response, chat_gpt=False)
# ... add grounding button for Gemini response ...
current_speaker = "GPT-4"
conversation_history.append(response)# ... UI elements and layout using Flet ...
The rest is just styles and fonts and ways to represent the front end, nothing else.
Remember the full code is at the end of the post.
Testing and Prototyping
I started with the following phrase: “Will AI ultimately enhance or diminish human creativity?”
Experiment 3.96: -> ChatGPT’s take
Analysis:
The first that we have programmed to respond is the Artificial Mind 1: OpenAI / ChatGPT, the answer has many ideas aligned to how we can leverage AI to improve the human creativity, and also automate different tasks to reduce efforts and times in the pursuit of more “creative thoughts”. Something key from the response is how we can potentialize the use of AI tools to even enhance data analysis humans can not accomplish in a short period of time. Definitely a good response from OpenAI.
The AI Judge:
The judge considers the evidence presented and consults relevant google search resources to determine the truthfulness of the statement. We can modify the code to make the Judge use private resources or hard private data to enhance the judgment.
From Serper library we can extract the urls/links or citations used to ground the judge response.
Experiment 3.97: -> Gemini’s take
Analysis:
Artificial Mind 2: Gemini comes to the show by acknowledging the power of AI to free up time to humans. These models are not not unintelligent at all, with short instructions they can understand what is going on about a specific topic and act very natural, like 2 humans talking each other. It introduces us to a new perspective of the potential over-reliance risks.
This is exactly the same kind of thoughts we have since these Generative AI Models emerged, “if humans start depending solely on AI or bypass the reasoning behind creativity, it could lead to decline problem solving abilities”.
We need to exercise caution and mindfulness when utilizing AI tools to prevent such occurrences. And that is exactly what the last paragraph is about; “find a right balance”. “what an opportunity to improve our condition — Ryan Holiday would say”.
The AI Judge:
On the judge size, there are very compellent articles that mentions the negative impact, but at the same time it reveals that AI can be a valuable tool for inspiration, by being here, writing this post I can tell you this is exactly the way I use AI these days, I took a piece idea from my brain go to gemini.google.com ask for enrichment and brainstorming, try to clarify points and then I start prototyping.
Experiment 3.98: -> ChatGPT’s take
Analysis:
As they work together, they are constantly exploring new possibilities. The ideas don’t stay the same — they evolve through the conversations!
We started by exploring how AI could free us from boring tasks and let us focus on what we love: being creative. Then, we wondered if AI could change the way we collaborate altogether. Now, we’re excited about AI helping us brainstorm and get those early drafts started.
The AI Judge:
The Judge initially takes a step back and simply observes, heavily influenced by the vast amount of information and opinions found through online searches. It’s easy to see how the internet, with its endless stream of ideas and viewpoints, can impact our initial understanding of a topic.
This is where we could take the human as a second thought in the middle to HELP the machine improve their brainstorming.
Experiment 3.99: -> Gemini’s take
Analysis:
Analogies hold immense power. They act like a captivating historical novel, breathing life into abstract concepts and solidifying ideas in our minds. Look at the first paragraph “we do not question a piano’s ability to diminish a musician’s creativity”. The concept is truly profound, prompting us to contemplate our purpose in this world: to imagine, create, and elevate ourselves as a species.
It reinforces the notion that AI should be seen as a tool to enhance and amplify human creativity, rather than supplant it.
Equally crucial is the aspect of education and accessibility. Every single person on this planet deserves access to these tools, empowering individuals to unleash their creativity and generate groundbreaking ideas.
The AI Judge:
Conclusion
This experiment offfers a glimpse into the exciting potential of collaborative AI. Instead of fearing AI as a replacement for human creativity, we should embrace its potential as a powerful ally. Imagine a world where:
- AI assists in tackling global challenges: From developing groundbreaking scientific solutions to crafting strategies for a more equitable world, collaborative AI can amplify our efforts to solve complex problems.
- Everyone becomes a creator: With AI tools accessible to all, we can unlock a new wave of creative expression, fostering innovation across every field and empowering individuals to share their unique voices.
- Human and artificial minds work in concert: A harmonious blend of human intuition and AI’s analytical prowess will drive us towards a future where creativity knows no bounds.
- This is not a FAR-FETCHED UTOPIA, but a tangible FUTURE within our grasp. By embracing the power of collaborative AI, we can transcend the limitations of our individual minds and usher in an era of unprecedented creativity and progress.
I will make more prototypes and experiments to show more ideas, stay tuned!
Code Repository
Authors:
Coder:
Creativity Designer: