# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
# π§Ή This line removes JupyterLab (a tool that helps run notebooks),
# because we don't need it here and it can sometimes cause errors.
!pip uninstall -qy jupyterlab
# π This line installs the Google Generative AI Python library (google-genai)
# The version we're installing is 1.7.0 β it's like downloading the latest brain
# that helps our code talk to Google's smart Gemini robot!
!pip install -U -q "google-genai==1.7.0"
ββββββββββββββββββββββββββββββββββββββββ 144.7/144.7 kB 7.8 MB/s eta 0:00:00
ββββββββββββββββββββββββββββββββββββββββ 100.9/100.9 kB 5.0 MB/s eta 0:00:00
# We are using special tools from Google to talk to the Gemini AI
from google import genai
# We are importing extra tools (called "types") to help talk to Gemini in a smart way
from google.genai import types
# These tools help us show pretty text and output (like bold, colors, or math) in Jupyter Notebooks
from IPython.display import HTML, Markdown, display
# We import something called `retry` from Google's API tools.
# It helps us automatically try again if something goes wrong (like the internet is slow).
from google.api_core import retry
# This line says: "If there's an error, check if it's an API error AND the code is 429 or 503"
# - 429 means: "Too many requests, slow down!"
# - 503 means: "Server is too busy or not ready!"
# So we want to retry only if it's one of these errors.
is_retriable = lambda e: (isinstance(e, genai.errors.APIError) and e.code in {429, 503})
# Now we take Geminiβs generate_content function and wrap it with a retry feature.
# That means: if Gemini is too busy (429/503), it will try again automatically instead of giving up.
genai.models.Models.generate_content = retry.Retry(
predicate=is_retriable # This tells it which errors to retry
)(genai.models.Models.generate_content) # This is the actual function we're retrying
# This line imports a special helper from Kaggle that lets us get secret info (like passwords or keys)
from kaggle_secrets import UserSecretsClient
# This line gets our super-secret Google API key from Kaggle's safe storage.
# It's like opening a locked treasure chest and grabbing the special key we need to talk to Gemini!
GOOGLE_API_KEY = UserSecretsClient().get_secret("GOOGLE_API_KEY")
# First, we make a connection to the smart Gemini robot by using our secret API key.
# This is like saying "Hi Gemini! Here's my key, can I ask you something?"
client = genai.Client(api_key = GOOGLE_API_KEY)
# Now we ask Gemini a question using the model "gemini-2.0-flash".
# We give it some text (our question) and ask it to explain black holes in a simple way.
response = client.models.generate_content(
model = "gemini-2.0-flash", # This is the brain we're using (a fast version!)
contents = "Explain about the Black holes to me like I'm a kid in a single line" # Our question
)
# We print the answer that Gemini gives us.
# This will show up in our screen like a fun explanation from a smart robot friend.
print(response.text)
Black holes are like cosmic vacuum cleaners with gravity so strong that nothing, not even light, can escape them!
Markdown(response.text)
Loading...
display(response.text)
'Black holes are like cosmic vacuum cleaners with gravity so strong that nothing, not even light, can escape them!\n'
client = genai.Client(api_key=GOOGLE_API_KEY)
response = client.models.generate_content(
model = "gemini-2.0-flash",
contents = "Explain about Singularity briefly about 2 lines"
)
print(response.text)
The Singularity is a hypothetical point in time when technological growth becomes uncontrollable and irreversible, resulting in unforeseeable changes to human civilization. It's often associated with the advent of superintelligence (AI) that surpasses human intellect.
# This line starts a new chat with the Gemini robot.
# We tell it which version to use ('gemini-2.0-flash') and start with an empty history.
chat = client.chats.create(model='gemini-2.0-flash', history=[])
# Now we send a message to the Gemini robot, like saying "Hi!"
# The robot will think and answer back.
response = chat.send_message('Hello!, My name is Rajesh Karra')
# Finally, we print the robot's reply so we can read it.
print(response.text)
Hello Rajesh Karra! It's nice to meet you. How can I help you today?
response = chat.send_message('Can you explain me about how the warmholes created in just about 30 words')
print(response.text)
Wormholes, theoretical shortcuts through spacetime, are created by extreme gravity warping spacetime, potentially connecting distant points or even different universes, but their existence is unproven and traversability uncertain.
response = chat.send_message('Do you remember what my name is')
print(response.text)
Yes, your name is Rajesh Karra.
client = genai.Client(api_key = GOOGLE_API_KEY)
response = client.models.generate_content(
model = "gemini-2.0-flash",
contents = "Causes of smell from the mouth, whether it is because of Vitamin defeciency or food"
)
print(response.text)
#Markdown(response.text)
Okay, let's break down the causes of bad breath (halitosis), covering both dietary and vitamin deficiency-related factors.
**I. Common Causes - Primarily Related to Oral Hygiene and Diet**
These are the most frequent culprits:
* **Poor Oral Hygiene:**
* **Plaque and Bacteria:** A sticky film of bacteria (plaque) constantly forms on your teeth. If you don't brush and floss regularly, bacteria multiply and break down food particles, releasing foul-smelling compounds (volatile sulfur compounds - VSCs) like hydrogen sulfide (rotten eggs), methyl mercaptan (fecal odor), and dimethyl sulfide.
* **Food Debris:** Food particles trapped between teeth, on the tongue, or around gums decompose and contribute to bad breath.
* **Dry Mouth (Xerostomia):** Saliva helps cleanse the mouth and neutralize acids. When saliva production is reduced (due to medications, certain medical conditions, or simply not drinking enough water), bacteria thrive, and bad breath becomes more likely.
* **Dietary Factors:**
* **Strong-Smelling Foods:** Garlic, onions, spices (like curry), coffee, and some cheeses contain compounds that are absorbed into the bloodstream. These compounds are then exhaled through the lungs, causing temporary bad breath. The smell persists until the compounds are eliminated from the body.
* **Sugary Foods and Drinks:** Sugar feeds bacteria in the mouth, leading to acid production and bad breath.
* **High-Protein, Low-Carbohydrate Diets:** These diets can sometimes lead to ketosis (the body burning fat for energy), which produces ketones, some of which have a distinct odor that can be smelled on the breath (often described as fruity or acetone-like).
* **Alcohol:** Alcohol can contribute to dry mouth and can also be metabolized into substances that cause bad breath.
* **Tobacco Use:**
* Smoking and chewing tobacco dry out the mouth, irritate the gums, and stain teeth, all contributing to bad breath. They also have their own distinct, unpleasant odor.
* **Dental Problems:**
* **Tooth Decay (Cavities):** Cavities provide areas where bacteria can thrive and decompose food.
* **Gum Disease (Gingivitis and Periodontitis):** Gum disease causes inflammation and pockets in the gums where bacteria can accumulate and cause a strong, foul odor.
* **Dental Abscesses:** Infections around the teeth can cause very bad breath.
* **Poorly Fitting Dentures or Bridges:** These can trap food and bacteria.
* **Medical Conditions:**
* **Respiratory Tract Infections:** Sinus infections, bronchitis, pneumonia, and postnasal drip can all contribute to bad breath.
* **Tonsillitis/Tonsil Stones:** Tonsils can have crevices where bacteria, mucus, and debris collect, forming tonsil stones (calcified debris) that smell very bad.
* **Kidney Disease:** Kidney failure can lead to a buildup of toxins in the body, which can cause a ammonia-like odor on the breath.
* **Liver Disease:** Severe liver disease can sometimes cause a musty or sweetish odor on the breath.
* **Diabetes:** Uncontrolled diabetes can lead to ketoacidosis, which can cause a fruity or acetone-like odor on the breath.
* **Gastrointestinal Issues:** In rare cases, conditions like GERD (gastroesophageal reflux disease) can contribute to bad breath. However, it's less common than oral causes.
**II. Vitamin Deficiencies and Their Potential Link to Bad Breath**
While *direct* causation of bad breath solely from vitamin deficiencies is less common, deficiencies can indirectly contribute by impacting oral health and immune function:
* **Vitamin C Deficiency (Scurvy):**
* Vitamin C is crucial for collagen production, which is essential for healthy gums. A deficiency can lead to:
* **Gingivitis:** Inflammation and bleeding of the gums, creating an environment for bacteria to thrive. Bleeding gums also provide a source of protein for bacteria.
* **Loose Teeth:** Severe vitamin C deficiency can weaken the ligaments that hold teeth in place.
* **Impaired Wound Healing:** Vitamin C is important for healing, so deficiencies can delay the healing of gum tissue, making it more susceptible to infection. Infection equals bad breath.
* **Vitamin D Deficiency:**
* Vitamin D plays a role in bone health and immune function. Deficiencies can:
* **Increase Susceptibility to Gum Disease:** A weakened immune system makes it harder to fight off the bacteria that cause gum disease.
* **Impair Bone Health:** Vitamin D is essential for bone health, including the bones that support the teeth. Deficiency can weaken these bones, increasing the risk of tooth loss and related oral health problems.
* **B Vitamin Deficiencies (Especially B12):**
* B vitamins are important for cell growth and repair. Deficiencies can sometimes cause:
* **Mouth Ulcers (Canker Sores):** These can be painful and harbor bacteria.
* **Glossitis:** Inflammation of the tongue, which can alter the oral microbiome and contribute to bad breath.
* **Anemia (often associated with B12 deficiency):** Anemia can weaken the immune system, making you more susceptible to infections in the mouth.
* **Zinc Deficiency:**
* Zinc is important for taste and smell, immune function, and wound healing. Deficiencies can:
* **Impair Taste and Smell:** This might make it harder to detect your own bad breath, leading to a lack of awareness.
* **Increase Susceptibility to Infections:** Weakened immune system.
* **Dry Mouth:** Zinc is involved in saliva production, and a deficiency can contribute to dry mouth.
**Important Considerations:**
* **Indirect Effects:** Vitamin deficiencies are more likely to contribute to bad breath indirectly by weakening the immune system, affecting gum health, or causing other oral health problems. They are rarely the *sole* cause.
* **Holistic Approach:** If you suspect a vitamin deficiency, it's crucial to consult a doctor for testing and treatment. Don't self-diagnose and self-treat with supplements without medical advice.
* **Focus on Oral Hygiene:** Even if a vitamin deficiency is present, maintaining good oral hygiene is essential for controlling bad breath.
* **Medical Evaluation:** Persistent bad breath, despite good oral hygiene, should be evaluated by a dentist or doctor to rule out underlying medical conditions.
**In summary, while specific vitamin deficiencies can contribute to conditions that worsen breath, they are rarely the primary cause. The most common culprits are poor oral hygiene, diet, and underlying dental or medical issues. A balanced diet rich in vitamins and minerals, coupled with excellent oral hygiene, is the best approach for preventing and managing bad breath.**
# This line goes through all the models that the Gemini client knows about
for model in client.models.list():
# For each model, we print its name so we can see which ones we can use
print(model.name)
models/chat-bison-001
models/text-bison-001
models/embedding-gecko-001
models/gemini-1.0-pro-vision-latest
models/gemini-pro-vision
models/gemini-1.5-pro-latest
models/gemini-1.5-pro-001
models/gemini-1.5-pro-002
models/gemini-1.5-pro
models/gemini-1.5-flash-latest
models/gemini-1.5-flash-001
models/gemini-1.5-flash-001-tuning
models/gemini-1.5-flash
models/gemini-1.5-flash-002
models/gemini-1.5-flash-8b
models/gemini-1.5-flash-8b-001
models/gemini-1.5-flash-8b-latest
models/gemini-1.5-flash-8b-exp-0827
models/gemini-1.5-flash-8b-exp-0924
models/gemini-2.5-pro-exp-03-25
models/gemini-2.5-pro-preview-03-25
models/gemini-2.5-flash-preview-04-17
models/gemini-2.5-flash-preview-04-17-thinking
models/gemini-2.5-pro-preview-05-06
models/gemini-2.0-flash-exp
models/gemini-2.0-flash
models/gemini-2.0-flash-001
models/gemini-2.0-flash-exp-image-generation
models/gemini-2.0-flash-lite-001
models/gemini-2.0-flash-lite
models/gemini-2.0-flash-preview-image-generation
models/gemini-2.0-flash-lite-preview-02-05
models/gemini-2.0-flash-lite-preview
models/gemini-2.0-pro-exp
models/gemini-2.0-pro-exp-02-05
models/gemini-exp-1206
models/gemini-2.0-flash-thinking-exp-01-21
models/gemini-2.0-flash-thinking-exp
models/gemini-2.0-flash-thinking-exp-1219
models/learnlm-2.0-flash-experimental
models/gemma-3-1b-it
models/gemma-3-4b-it
models/gemma-3-12b-it
models/gemma-3-27b-it
models/embedding-001
models/text-embedding-004
models/gemini-embedding-exp-03-07
models/gemini-embedding-exp
models/aqa
models/imagen-3.0-generate-002
models/gemini-2.0-flash-live-001
from pprint import pprint # This helps print things in a neat and easy-to-read way
# We go through all the AI models available using the Gemini API
for model in client.models.list():
# We check if the model's name is "gemini-2.0-flash" (this is the one we want to use)
if model.name == 'models/gemini-2.0-flash':
# If we found it, we print out all its details nicely (like how it works, its version, etc.)
pprint(model.to_json_dict())
# Stop the loop β we found what we were looking for!
break
{'description': 'Gemini 2.0 Flash',
'display_name': 'Gemini 2.0 Flash',
'input_token_limit': 1048576,
'name': 'models/gemini-2.0-flash',
'output_token_limit': 8192,
'supported_actions': ['generateContent', 'countTokens', 'createCachedContent'],
'tuned_model_info': {},
'version': '2.0'}
# We import something called "types" from Google's genai tools.
# These help us set up rules for how the Gemini model should respond.
from google.genai import types
# We are creating a setting (called config) that says:
# "Give me no more than 200 words (tokens) in the answer."
short_config = types.GenerateContentConfig(max_output_tokens = 200)
# Now we ask Gemini to do something for us!
# We tell it:
# - Which model to use: "gemini-2.0-flash" (this is a fast and smart AI)
# - What settings to follow (short_config)
# - What question or task to answer: "Write a 100 word essay on Einstein's E=MC^2"
response = client.models.generate_content(
model = "gemini-2.0-flash",
config = short_config,
contents = "Write a 100 word essay on the Einstein's E=MC^2"
)
# Finally, we print out what Gemini said (its answer!)
print(response.text)
Einstein's E=mcΒ², the most famous equation in physics, reveals a profound relationship between energy (E) and mass (m). The constant cΒ², the speed of light squared, acts as a massive conversion factor. This elegant formula demonstrates that mass and energy are fundamentally interchangeable; a tiny amount of mass can be converted into a tremendous amount of energy, as exemplified in nuclear reactions like those powering the sun or nuclear weapons. Conversely, energy can be converted into mass, albeit on a much smaller scale in everyday scenarios. E=mcΒ² revolutionized our understanding of the universe, solidifying Einstein's legacy as a scientific visionary.
response = chat.send_message('Do you remember my name')
print(response.text)
Yes, I remember your name is Rajesh Karra.
# First, we create a "config" that controls how random the AI's answers are.
# A higher temperature like 2.0 makes the answers more creative and surprising!
high_temp_config = types.GenerateContentConfig(temperature=2.0)
# Now we repeat the next part 5 times
for _ in range(5):
# We ask the Gemini model (the smart robot) to give us a random color name
# We give it our "high randomness" config so it gives different answers
response = client.models.generate_content(
model="gemini-2.0-flash", # This tells it which version of Gemini to use
config=high_temp_config, # This is how random/creative it should be
contents="Pick a random color...(respond in a single word)" # This is our question
)
# If we got an answer from Gemini...
if response.text:
# Print the answer and a row of dashes to separate the outputs
print(response.text, '-' * 25)
Azure
-------------------------
Azure
-------------------------
Teal
-------------------------
Turquoise
-------------------------
Magenta
-------------------------
response = chat.send_message('Do you rememeber my name')
print(response.text)
Yes, I remember your name is Rajesh Karra. I will continue to remember it throughout our conversation.
# This line sets up how "creative" or "random" Gemini should be.
# Temperature = 0.0 means: "Be very serious and give the same answer every time"
low_temp_config = types.GenerateContentConfig(temperature = 0.0)
# We are going to ask Gemini the same question 5 times
for _ in range(5):
# We ask Gemini: "Pick a random color... (just one word)"
# But because the temperature is low, it may not be very random
response = client.models.generate_content(
model = "gemini-2.0-flash", # This is the name of the Gemini model we are using
config = low_temp_config, # We tell Gemini to use the serious (low-temp) setting
contents = 'Pick a random color...(respond in a single word)' # This is the question we ask
)
# If Gemini gave us an answer, we print it
if response.text:
print(response.text, '-' * 25) # We also print some dashes to separate each answer
Azure
-------------------------
Azure
-------------------------
Azure
-------------------------
Azure
-------------------------
Azure
-------------------------
# First, we are setting how the model should behave using settings
# temperature = how creative Gemini should be (higher = more random and fun!)
# top_p = helps pick the best words (like choosing from a smart list)
model_config = types.GenerateContentConfig(
temperature = 1.0, # Full creativity
top_p = 0.95 # Pick from the top 95% of best next words
)
# Now we give Gemini a fun task!
# We're pretending it's a creative writer and asking it to write a story
story_prompt = "you are a creative writer. Write a short story about a cat who goes on an adventure"
# This is where we ask Gemini to do the job
# We send our prompt and settings to Gemini, and it gives us a story
response = client.models.generate_content(
model = "gemini-2.0-flash", # We're using the fast Gemini model
config = model_config, # Use the creative settings we picked
contents = story_prompt # This is our prompt (what we want Gemini to write)
)
# Finally, we print out the story Gemini created!
print(response.text)
Clementine, a ginger tabby of impeccable taste and questionable bravery, lived a life of scheduled luxury. Her days consisted of naps in sunbeams, strategic head-butts for treats, and the occasional dramatic stalking of dust bunnies. Adventure, in her mind, was limited to reaching the highest shelf in the pantry.
But then, Bartholomew arrived.
Bartholomew was a scruffy, one-eyed stray, smelling faintly of fish and freedom. He told Clementine tales of sprawling meadows brimming with butterflies, of whispering woods echoing with birdsong, and of a mythical place called "The Stream of Milk," where legend held that creamy goodness flowed freely.
Clementine scoffed. "The Stream of Milk? Preposterous. My human provides me with the finest cream, delivered in a delicate porcelain saucer."
Bartholomew, unperturbed, merely winked his good eye. "Some things, Clementine, can't be delivered. They must be discovered."
That night, under the silver glow of a crescent moon, Clementine found herself perched on the garden fence, Bartholomew beside her. Her heart hammered against her ribs, a frantic drumbeat against the purr of the night. They slipped into the shadowy embrace of the overgrown rose bushes, leaving behind the familiar comfort of her pampered life.
The journey was fraught with peril. They dodged the grumpy glare of Mrs. Higgins' chihuahua, navigated the treacherous terrain of the neighbor's vegetable patch (where Clementine surprisingly discovered a fondness for cherry tomatoes), and even had a terrifying encounter with a particularly aggressive squirrel.
Bartholomew, with his street-smarts and unwavering optimism, proved to be an invaluable guide. He taught Clementine to sharpen her claws on bark, to listen for the rustle of hidden creatures, and to embrace the thrill of the unknown.
Finally, after what felt like a lifetime, they arrived. It wasn't a river, as Clementine had imagined, but a small, sun-dappled spring bubbling up from the earth. The water, though not literally milk, was crystal clear and tasted sweeter than any she had ever known.
Clementine lapped at the spring, feeling a profound sense of accomplishment. It wasn't the Stream of Milk, but it was something infinitely more valuable. It was proof that the world was bigger, wilder, and more wonderful than she had ever dared to imagine.
As the first rays of dawn painted the sky, they started their journey home. Clementine was no longer the pampered housecat. She was Clementine, the adventurer, a cat who had braved the unknown and discovered a new strength within herself.
She returned to her comfortable home, slipping back in through the slightly ajar window. As her human fussed over her, stroking her soft fur, Clementine purred. She was still Clementine, the ginger tabby of impeccable taste, but now she held a secret, a whispered promise of future adventures hidden within the heart of a braver, wilder cat. And sometimes, when she looked at the horizon, she could still taste the sweetness of the spring, and hear the echoes of Bartholomew's one-eyed wink.
# π§ This block sets how the Gemini model should behave
# Think of it like telling the AI:
# "Be calm (low temperature), give full answers (top_p), and donβt talk too much (limit tokens)"
model_config = types.GenerateContentConfig(
temperature = 0.1, # Low temperature = more predictable answers
top_p = 1, # Top-p = allow full creativity range (1 = use all words)
max_output_tokens = 5, # Only return up to 5 words in the answer
)
# π This is the message (prompt) we send to Gemini
# Weβre asking it to guess the emotion of a movie review (Positive, Neutral, or Negative)
zero_shot_prompt = """Classify movie reviews as POSITIVE, NEUTRAL or NEGATIVE.
Review: "Her" is a disturbing study revealing the direction
humanity is headed if AI is allowed to keep evolving,
unchecked. I wish there were more movies like this masterpiece.
Sentiment: """ # π We're asking Gemini to complete this line with one word: POSITIVE, NEUTRAL, or NEGATIVE
# π€ Now we send the prompt to Gemini to get an answer
response = client.models.generate_content(
model = "gemini-2.0-flash", # Use the fast Gemini model
config = model_config, # Tell it how to behave (from above)
contents = zero_shot_prompt # Give it the question we want answered
)
# π’ Show Gemini's answer on the screen
print(response.text)
POSITIVE
# We import a special tool called 'enum' that helps us make a list of choices
import enum
# We make a class (like a labeled box) called Sentiment
# Inside, we list 3 possible feelings (or moods):
# - POSITIVE: means happy or good
# - NEUTRAL: means okay, not good or bad
# - NEGATIVE: means sad or bad
class Sentiment(enum.Enum):
POSITIVE = 'positive'
NEUTRAL = 'neutral'
NEGATIVE = 'negative'
# We ask the Gemini robot to give us a response based on some input (zero_shot_prompt)
# We tell it:
# - Use the "gemini-2.0-flash" model
# - Expect the answer to be one of the moods (Sentiment)
# - Send the question we want to ask (zero_shot_prompt)
response = client.models.generate_content(
model = "gemini-2.0-flash",
config = types.GenerateContentConfig(
response_mime_type = "text/x.enum", # This says: "Send the answer in one of our enum moods"
response_schema = Sentiment # This tells Gemini to use our Sentiment choices
),
contents = zero_shot_prompt # This is the actual thing we ask Gemini to think about
)
# Print the answer Gemini gives us!
print(response.text)
positive
enum_response = response.parsed
print(enum_response)
print(type(enum_response))
Sentiment.POSITIVE
<enum 'Sentiment'>
help(response.parsed)
Help on Sentiment in module __main__ object:
class Sentiment(enum.Enum)
| Sentiment(value, names=None, *, module=None, qualname=None, type=None, start=1)
|
| An enumeration.
|
| Method resolution order:
| Sentiment
| enum.Enum
| builtins.object
|
| Data and other attributes defined here:
|
| NEGATIVE = <Sentiment.NEGATIVE: 'negative'>
|
| NEUTRAL = <Sentiment.NEUTRAL: 'neutral'>
|
| POSITIVE = <Sentiment.POSITIVE: 'positive'>
|
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumMeta:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
few_shot_prompt = """Parse a customer's pizza order into valid JSON:
EXAMPLE:
I want a small pizza with cheese, tomato sauce, and pepperoni.
JSON Response:
```
{
"size": "small",
"type": "normal",
"ingredients": ["cheese", "tomato sauce", "pepperoni"]
}
```
EXAMPLE:
Can I get a large pizza with tomato sauce, basil and mozzarella
JSON Response:
```
{
"size": "large",
"type": "normal",
"ingredients": ["tomato sauce", "basil", "mozzarella"]
}
```
ORDER:
"""
# π£οΈ This is what the customer actually says
customer_order = "Give me a large with cheese & pineapple"
# π€ We now ask Gemini AI to help us figure out what this order means in code (JSON)
response = client.models.generate_content(
model = "gemini-2.0-flash", # π§ We're using Gemini Flash, a fast AI model
config = types.GenerateContentConfig(
temperature = 0.1, # π― Low temperature = more accurate/serious answers
top_p = 1, # π Controls randomness; 1 = normal
max_output_tokens = 250, # π Max length of the answer
),
# π¦ We send both our instructions (examples) and the customer order
contents = [few_shot_prompt, customer_order]
)
# π¨οΈ Finally, we print what Gemini answered!
print(response.text)
```json
{
"size": "large",
"type": "normal",
"ingredients": ["cheese", "pineapple"]
}
```