Gemini 2.0 Research Agent with Web Search and Citations
ModelsGoogle AI's new Gemini 2.0 model provides first-class support for web search and citations via Google's very own search APIs. With very little effort, we can build impressive AI research agents that generate knowledge-rich responses and even cite their sources.
We'll be exploring how to build this type of agent with Gemini 2.0 Flash and use the GoogleSearch
tool to augment Gemini's knowledge with web search results.
Setup Instructions
The code in this article has been tested both locally with Python 3.12.7
and in Google Colab with Python 3.10.12
.
To run locally, please refer to the setup instructions with uv
here. To run in Google Colab, simply run all cells in the provided notebook.
Setup with Google AI
To begin, we will need a Google API key. For that, you can setup an account in Google AI Studio. To initialize and begin using Gemini 2 that is all we need, but later we will need to upgrade our plan to get access to the Google Search tool.
After you have your account and API key, we initialize our google.genai
client:
import os
from getpass import getpass
from google import genai
# pass your API key here
os.environ["GOOGLE_API_KEY"] = os.getenv("GOOGLE_API_KEY") or getpass(
"Enter Google API Key: "
)
# initialize our client
client = genai.Client()
To generate some text with Gemini we call the generate_content
method, Gemini does tend to respond with markdown, and is pretty verbose, so we'll use IPython's Markdown
to display the output.
from IPython.display import Markdown
model_id = "gemini-2.0-flash-exp"
response = client.models.generate_content(
model=model_id, contents='What is Gemini?'
)
Markdown(response.text)
Gemini refers to several related but distinct things, all connected to Google's AI and
large language model initiatives. Here's a breakdown:
**1. Google Gemini (The Family of Models):**
* **At its core, Gemini is a family of multimodal AI models developed by Google.** This
means they can understand and process various types of data, including text, code,
audio, images, and video.
* **Key characteristics:**
* **Multimodal:** They can understand and generate content across different
modalities (text, image, audio, video).
* **High performance:** Designed to be powerful and capable, aiming to surpass
previous models.
* **Scalable:** Can be tailored to different hardware and needs.
* **Variety of sizes:** There are different Gemini models with varying capabilities
and sizes:
* **Gemini Ultra:** The most powerful model, designed for highly complex tasks.
* **Gemini Pro:** A general-purpose model, suitable for a wide range of tasks.
* **Gemini Nano:** A smaller model designed for on-device usage (like
smartphones).
**2. Gemini (The Product/Interface):**
* **Google has launched a conversational AI service called "Gemini" (formerly known as
Bard) that is powered by the Gemini model family.** This is the most visible way users
interact with Gemini.
* **Key features:**
* **Conversational AI:** Users can interact with it in a natural, conversational
way.
* **Text Generation:** Can generate various text formats (poems, code, scripts,
creative content).
* **Information Retrieval:** Can access and process information from the web.
* **Creative Tasks:** Can assist with creative tasks like writing, brainstorming,
and more.
* **Code Generation:** Can assist with coding tasks in multiple programming
languages.
* **Image Analysis and Understanding:** Can analyze and respond to image inputs.
* **Multimodal capabilities:** In some cases, it can process and combine different
types of inputs (e.g., text and image) to generate more comprehensive results.
**3. Gemini (The Technology Foundation):**
* **Gemini is also the technology underlying various Google products and services.**
This means it's powering features within:
* **Search:** Enhancing search results with more context and understanding.
* **Gmail:** Improving features like smart compose and smart reply.
* **Google Workspace Apps:** Adding AI capabilities to Docs, Sheets, Slides, etc.
* **Android:** Powering on-device AI features.
* **Other Google Products:** Integrating AI in various services across Google's
ecosystem.
**In Summary:**
Think of it like this:
* **Gemini (Family of Models):** The powerful AI engine that fuels everything.
* **Gemini (The Product/Interface):** The conversational interface you directly interact
with, similar to ChatGPT but using Google's Gemini models.
* **Gemini (The Technology Foundation):** The engine being integrated into various
Google products to make them smarter.
**Key Takeaway:**
Gemini represents a significant step forward in Google's AI strategy, pushing the
boundaries of what AI can do and bringing it to a wider audience through various
products and services. It's a multimodal AI that is designed to be powerful, versatile,
and integrated into Google's ecosystem.
We got a pretty descriptive response. Now let's take a look at tool use in Gemini, starting with the GoogleSearch
tool.
Note: to use this tool, you must upgrade your plan, you can do that by navigating to your Google AI studio settings and clicking the API Plan Information link. For the purposes of this notebook, you should be covered by their free allowance but in any case you must have billing enabled.
from google.genai.types import Tool, GoogleSearch
search_tool = Tool(google_search=GoogleSearch())
To use the tool, we must create a GenerateContentConfig
object. This object is used to configure input into Gemini, this can include system_instructions
, temperature
, max_output_tokens
, our response_modalities
, and very importantly, our tools
.
Most of these parameters are optional and the defaults seem to depend on the model being used although it isn't clear what the default parameters are for Gemini 2.0 Flash. Nonetheless, for parameters whose defaults are more easily guessable we have included them in our config
object definition below.
from google.genai.types import GenerateContentConfig
config = GenerateContentConfig(
system_instruction=(
"You are a helpful assistant that provides up to date information "
"to help the user in their research."
),
tools=[search_tool],
response_modalities=["TEXT"],
temperature=0.0, # likely default
candidate_count=1, # likely default
# following are some other parameters, all optional
#top_p,
#top_k,
#max_output_tokens,
#max_tokens,
#stop_sequences,
#safety_settings,
)
config
GenerateContentConfig(system_instruction='You are a helpful assistant that provides up to date information to help the user in their research.', temperature=0.0, top_p=None, top_k=None, candidate_count=1, max_output_tokens=None, stop_sequences=None, response_logprobs=None, logprobs=None, presence_penalty=None, frequency_penalty=None, seed=None, response_mime_type=None, response_schema=None, routing_config=None, safety_settings=None, tools=[Tool(function_declarations=None, retrieval=None, google_search=GoogleSearch(), google_search_retrieval=None, code_execution=None)], tool_config=None, cached_content=None, response_modalities=['TEXT'], media_resolution=None, speech_config=None, automatic_function_calling=None)
Now we have our config
setup, we can go ahead and ask Gemini about the latest news in AI, by default Gemini would not be able to answer this question, but we can get up to date information by augmenting Gemini's knowledge with the GoogleSearch
tool.
response = client.models.generate_content(
model=model_id,
contents="Tell me the latest news in AI",
config=config
)
Markdown(response.text)
Here's a breakdown of the latest news in AI:
**1. AI Model Advancements:**
* **OpenAI's "o1" Model:** OpenAI has introduced the o1-preview and o1-mini models,
which demonstrate enhanced reasoning skills. The o1 model has achieved an estimated IQ
of 120, showcasing proficiency comparable to human performance in solving mathematical
problems. It scored 83% on the International Mathematics Olympiad qualifying exam.
* **Google's Veo and Imagen 3:** Google Cloud has launched Veo and Imagen 3, two new
generative AI models on its Vertex AI platform.
* **Generative AI Evolution:** Generative AI is rapidly evolving, moving from large,
centralized models to smaller, more efficient ones. Open-source models are becoming
increasingly powerful, often outperforming proprietary models on many benchmarks.
**2. AI Applications and Trends:**
* **Autonomous Systems:** AI agents are being developed to proactively take on tasks
and enhance decision-making across various sectors, including banking and healthcare.
* **Explainable AI:** There's a growing emphasis on making AI decision-making
processes more transparent and understandable to build trust and accountability.
* **AI Democratization:** Low-code and no-code AI platforms are making it easier for
businesses to customize and implement AI solutions.
* **Multi-Modal AI:** AI is increasingly combining different types of data, such as
text, images, and speech, for more comprehensive processing.
* **Digital Twins:** Digital twins are gaining prominence for simulating real-world
objects digitally.
* **AI in Robotics:** Robots are being developed with advanced capabilities, including
learning through observation, and are being used in various applications, such as
caregiving and chemical synthesis research.
* **AI in Healthcare:** AI is being used for diagnostics, such as analyzing X-rays,
and there's a focus on regulating AI models and algorithms in healthcare.
* **AI in Cybersecurity:** AI is being used to enhance cybersecurity measures.
**3. Ethical and Regulatory Considerations:**
* **Regulation of AI:** There's a growing need for effective regulation and ethical
oversight of AI to address risks, protect individual rights, and enhance trust in AI
systems.
* **Bias in AI:** Researchers are working on techniques to reduce bias in AI models
while preserving or improving accuracy.
* **AI Governance:** There's a focus on developing governance frameworks to make AI
more trustworthy, sustainable, and accessible.
**4. Other Notable Developments:**
* **AI-powered robots** are being developed for various tasks, including cleaning and
chemical synthesis research.
* **AI is being used in virtual reality** to test the reactions of small animals.
* **AI is being used to create video content**, although some of these technologies
may not be available in all regions.
* **AI is being used in the development of drones**, including attack drones.
* **AI is being used in the development of soft robots**, inspired by manta rays.
**5. Market Growth:**
* The global AI market is projected to reach $1.35 trillion by 2030, with an annual
growth rate of 36.8% from 2023 to 2030.
In summary, AI is rapidly advancing across various fields, with new models,
applications, and ethical considerations emerging constantly.
We can look at the grounding_metadata
to see what sources were used to generate the response.
response.candidates[0].grounding_metadata.__dict__
{
'grounding_chunks': [
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='neudesic.com', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==')),
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='artificialintelligence-news.com', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA')),
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='ibm.com', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV')),
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='appinventiv.com', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==')),
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='mit.edu', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg==')),
GroundingChunk(retrieved_context=None, web=GroundingChunkWeb(title='sciencedaily.com', uri='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88='))
],
'grounding_supports': [
GroundingSupport(confidence_scores=[0.9684452], grounding_chunk_indices=[0], segment=Segment(end_index=207, part_index=None, start_index=77, text='* **OpenAI\'s "o1" Model:** OpenAI has introduced the o1-preview and o1-mini models, which demonstrate enhanced reasoning skills.')),
GroundingSupport(confidence_scores=[0.98998135], grounding_chunk_indices=[0], segment=Segment(end_index=346, part_index=None, start_index=208, text='The o1 model has achieved an estimated IQ of 120, showcasing proficiency comparable to human performance in solving mathematical problems.')),
GroundingSupport(confidence_scores=[0.9827083], grounding_chunk_indices=[0], segment=Segment(end_index=419, part_index=None, start_index=347, text='It scored 83% on the International Mathematics Olympiad qualifying exam.')),
GroundingSupport(confidence_scores=[0.9669729], grounding_chunk_indices=[1], segment=Segment(end_index=554, part_index=None, start_index=420, text="* **Google's Veo and Imagen 3:** Google Cloud has launched Veo and Imagen 3, two new generative AI models on its Vertex AI platform.")),
GroundingSupport(confidence_scores=[0.95705074], grounding_chunk_indices=[2], segment=Segment(end_index=693, part_index=None, start_index=555, text='* **Generative AI Evolution:** Generative AI is rapidly evolving, moving from large, centralized models to smaller, more efficient ones.')),
GroundingSupport(confidence_scores=[0.8243703], grounding_chunk_indices=[2], segment=Segment(end_index=807, part_index=None, start_index=694, text='Open-source models are becoming increasingly powerful, often outperforming proprietary models on many benchmarks.')),
GroundingSupport(confidence_scores=[0.9825873], grounding_chunk_indices=[3], segment=Segment(end_index=1017, part_index=None, start_index=845, text='* **Autonomous Systems:** AI agents are being developed to proactively take on tasks and enhance decision-making across various sectors, including banking and healthcare.')),
GroundingSupport(confidence_scores=[0.9287954], grounding_chunk_indices=[3], segment=Segment(end_index=1178, part_index=None, start_index=1018, text="* **Explainable AI:** There's a growing emphasis on making AI decision-making processes more transparent and understandable to build trust and accountability.")),
GroundingSupport(confidence_scores=[0.9176332], grounding_chunk_indices=[3], segment=Segment(end_index=1317, part_index=None, start_index=1179, text='* **AI Democratization:** Low-code and no-code AI platforms are making it easier for businesses to customize and implement AI solutions.')),
GroundingSupport(confidence_scores=[0.7995712], grounding_chunk_indices=[3], segment=Segment(end_index=1464, part_index=None, start_index=1318, text='* **Multi-Modal AI:** AI is increasingly combining different types of data, such as text, images, and speech, for more comprehensive processing.')),
GroundingSupport(confidence_scores=[0.948631], grounding_chunk_indices=[3], segment=Segment(end_index=1569, part_index=None, start_index=1465, text='* **Digital Twins:** Digital twins are gaining prominence for simulating real-world objects digitally.')),
GroundingSupport(confidence_scores=[0.96584463], grounding_chunk_indices=[0], segment=Segment(end_index=2253, part_index=None, start_index=2074, text="* **Regulation of AI:** There's a growing need for effective regulation and ethical oversight of AI to address risks, protect individual rights, and enhance trust in AI systems.")),
GroundingSupport(confidence_scores=[0.8654255], grounding_chunk_indices=[4], segment=Segment(end_index=2379, part_index=None, start_index=2254, text='* **Bias in AI:** Researchers are working on techniques to reduce bias in AI models while preserving or improving accuracy.')),
GroundingSupport(confidence_scores=[0.78701067], grounding_chunk_indices=[2], segment=Segment(end_index=2512, part_index=None, start_index=2380, text="* **AI Governance:** There's a focus on developing governance frameworks to make AI more trustworthy, sustainable, and accessible.")),
GroundingSupport(confidence_scores=[0.7657468], grounding_chunk_indices=[5], segment=Segment(end_index=2666, part_index=None, start_index=2550, text='* **AI-powered robots** are being developed for various tasks, including cleaning and chemical synthesis research.')),
GroundingSupport(confidence_scores=[0.7108187], grounding_chunk_indices=[5], segment=Segment(end_index=2750, part_index=None, start_index=2667, text='* **AI is being used in virtual reality** to test the reactions of small animals.')),
GroundingSupport(confidence_scores=[0.7387122], grounding_chunk_indices=[5], segment=Segment(end_index=3037, part_index=None, start_index=2954, text='* **AI is being used in the development of soft robots**, inspired by manta rays.')),
GroundingSupport(confidence_scores=[0.97621626], grounding_chunk_indices=[0], segment=Segment(end_index=3187, part_index=None, start_index=3062, text='* The global AI market is projected to reach $1.35 trillion by 2030, with an annual growth rate of 36.8% from 2023 to 2030.')),
GroundingSupport(confidence_scores=[0.9640589], grounding_chunk_indices=[0], segment=Segment(end_index=3326, part_index=None, start_index=3189, text='In summary, AI is rapidly advancing across various fields, with new models, applications, and ethical considerations emerging constantly.'))
],
'retrieval_metadata': None,
'retrieval_queries': None,
'search_entry_point': SearchEntryPoint(
rendered_content='<style>\n.container {\n align-items: center;\n border-radius: 8px;\n display: flex;\n font-family: Google Sans, Roboto, sans-serif;\n font-size: 14px;\n line-height: 20px;\n padding: 8px 12px;\n}\n.chip {\n display: inline-block;\n border: solid 1px;\n border-radius: 16px;\n min-width: 14px;\n padding: 5px 16px;\n text-align: center;\n user-select: none;\n margin: 0 8px;\n -webkit-tap-highlight-color: transparent;\n}\n.carousel {\n overflow: auto;\n scrollbar-width: none;\n white-space: nowrap;\n margin-right: -12px;\n}\n.headline {\n display: flex;\n margin-right: 4px;\n}\n.gradient-container {\n position: relative;\n}\n.gradient {\n position: absolute;\n transform: translate(3px, -9px);\n height: 36px;\n width: 9px;\n}\n@media (prefers-color-scheme: light) {\n .container {\n background-color: #fafafa;\n box-shadow: 0 0 0 1px #0000000f;\n }\n .headline-label {\n color: #1f1f1f;\n }\n .chip {\n background-color: #ffffff;\n border-color: #d2d2d2;\n color: #5e5e5e;\n text-decoration: none;\n }\n .chip:hover {\n background-color: #f2f2f2;\n }\n .chip:focus {\n background-color: #f2f2f2;\n }\n .chip:active {\n background-color: #d8d8d8;\n border-color: #b6b6b6;\n }\n .logo-dark {\n display: none;\n }\n .gradient {\n background: linear-gradient(90deg, #fafafa 15%, #fafafa00 100%);\n }\n}\n@media (prefers-color-scheme: dark) {\n .container {\n background-color: #1f1f1f;\n box-shadow: 0 0 0 1px #ffffff26;\n }\n .headline-label {\n color: #fff;\n }\n .chip {\n background-color: #2c2c2c;\n border-color: #3c4043;\n color: #fff;\n text-decoration: none;\n }\n .chip:hover {\n background-color: #353536;\n }\n .chip:focus {\n background-color: #353536;\n }\n .chip:active {\n background-color: #464849;\n border-color: #53575b;\n }\n .logo-light {\n display: none;\n }\n .gradient {\n background: linear-gradient(90deg, #1f1f1f 15%, #1f1f1f00 100%);\n }\n}\n</style>\n<div class="container">\n <div class="headline">\n <svg class="logo-light" width="18" height="18" viewBox="9 9 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M42.8622 27.0064C42.8622 25.7839 42.7525 24.6084 42.5487 23.4799H26.3109V30.1568H35.5897C35.1821 32.3041 33.9596 34.1222 32.1258 35.3448V39.6864H37.7213C40.9814 36.677 42.8622 32.2571 42.8622 27.0064V27.0064Z" fill="#4285F4"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M26.3109 43.8555C30.9659 43.8555 34.8687 42.3195 37.7213 39.6863L32.1258 35.3447C30.5898 36.3792 28.6306 37.0061 26.3109 37.0061C21.8282 37.0061 18.0195 33.9811 16.6559 29.906H10.9194V34.3573C13.7563 39.9841 19.5712 43.8555 26.3109 43.8555V43.8555Z" fill="#34A853"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M16.6559 29.8904C16.3111 28.8559 16.1074 27.7588 16.1074 26.6146C16.1074 25.4704 16.3111 24.3733 16.6559 23.3388V18.8875H10.9194C9.74388 21.2072 9.06992 23.8247 9.06992 26.6146C9.06992 29.4045 9.74388 32.022 10.9194 34.3417L15.3864 30.8621L16.6559 29.8904V29.8904Z" fill="#FBBC05"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M26.3109 16.2386C28.85 16.2386 31.107 17.1164 32.9095 18.8091L37.8466 13.8719C34.853 11.082 30.9659 9.3736 26.3109 9.3736C19.5712 9.3736 13.7563 13.245 10.9194 18.8875L16.6559 23.3388C18.0195 19.2636 21.8282 16.2386 26.3109 16.2386V16.2386Z" fill="#EA4335"/>\n </svg>\n <svg class="logo-dark" width="18" height="18" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n <circle cx="24" cy="23" fill="#FFF" r="22"/>\n <path d="M33.76 34.26c2.75-2.56 4.49-6.37 4.49-11.26 0-.89-.08-1.84-.29-3H24.01v5.99h8.03c-.4 2.02-1.5 3.56-3.07 4.56v.75l3.91 2.97h.88z" fill="#4285F4"/>\n <path d="M15.58 25.77A8.845 8.845 0 0 0 24 31.86c1.92 0 3.62-.46 4.97-1.31l4.79 3.71C31.14 36.7 27.65 38 24 38c-5.93 0-11.01-3.4-13.45-8.36l.17-1.01 4.06-2.85h.8z" fill="#34A853"/>\n <path d="M15.59 20.21a8.864 8.864 0 0 0 0 5.58l-5.03 3.86c-.98-2-1.53-4.25-1.53-6.64 0-2.39.55-4.64 1.53-6.64l1-.22 3.81 2.98.22 1.08z" fill="#FBBC05"/>\n <path d="M24 14.14c2.11 0 4.02.75 5.52 1.98l4.36-4.36C31.22 9.43 27.81 8 24 8c-5.93 0-11.01 3.4-13.45 8.36l5.03 3.85A8.86 8.86 0 0 1 24 14.14z" fill="#EA4335"/>\n </svg>\n <div class="gradient-container"><div class="gradient"></div></div>\n </div>\n <div class="carousel">\n <a class="chip" href="https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRvcSjDjiwkr5vHwwYPAe3SxVMFtGXZyFH8D_Q2SRUGw1BtjpmCb_KYEavgl1D7g3Vd7y863q5f-W-Zfyjm-vmGdFfr0zkDR7-jAaY8ShJKSdCi3fRb-onSc-uXkRdZ7DUhV605d_zatw4jqD5LLosgOAI214JNnS7duKTAaQBhDlCwU1DhJ9IflVQTcP57">latest news in AI</a>\n <a class="chip" href="https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTq6LtDgdq1fejZS9Sr16eyEx2d6GGyM02GiSHNikIaj2OpJue8R-_rFWonUV2nhwI_Ka8iQbW285m4O3ThTjY8GjUlGjWk-xCddeEEcNkKeU74rYR_rAu2o4qHxz-b-tUNfpoa2hXEmcvv59HzLHWTXG9JsvvUes9uqIil8PdXpisxU19xt_HmzRerBf9-EivPctY=">recent AI developments</a>\n </div>\n</div>\n', sdk_blob=None),
'web_search_queries': ['recent AI developments', 'latest news in AI']
}
Each source used is collected inside a GroundingChunk
object. Inside that we can access the web
property which contains a GroundingChunkWeb
containing the source website title
and uri
, which we can use to build a list of sources:
link_str = ""
for i, chunk in enumerate(response.candidates[0].grounding_metadata.grounding_chunks):
title = chunk.web.title
link = chunk.web.uri
link_str += f"[{i+1}] [{title}]({link})\n\n"
Markdown(link_str)
[1] [neudesic.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)
[2] [artificialintelligence-news.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA)
[3] [ibm.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)
[4] [appinventiv.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)
[5] [mit.edu](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg==)
[6] [sciencedaily.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)
That's great, but we can go a little deeper. Inside response.candidates[0].grounding_metadata
we also have a grounding_support
property containing a list of GroundingSupport
objects, each of those mapping to the GroundingChunk
objects that we already parsed above. We'll combine this information with our title
and link
data to create a list of Citation
objects.
from pydantic import BaseModel
class Citation(BaseModel):
title: str
score: float
start_index: int
end_index: int
chunk_index: int
link: str
def get_link(self):
return f"_[[{self.chunk_index+1}]({self.link})]_"
def count_chars(self):
return len(self.get_link())
citations = []
for support in response.candidates[0].grounding_metadata.grounding_supports:
chunk_index = support.grounding_chunk_indices[0]
citations.append(
Citation(
title=response.candidates[0].grounding_metadata.grounding_chunks[chunk_index].web.title,
score=support.confidence_scores[0],
start_index=support.segment.start_index,
end_index=support.segment.end_index,
chunk_index=chunk_index,
link=response.candidates[0].grounding_metadata.grounding_chunks[chunk_index].web.uri,
)
)
# sort citations by start_index
citations.sort(key=lambda x: x.start_index)
citations
[
Citation(title='neudesic.com', score=0.9684452, start_index=77, end_index=207, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg=='),
Citation(title='neudesic.com', score=0.98998135, start_index=208, end_index=346, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg=='),
Citation(title='neudesic.com', score=0.9827083, start_index=347, end_index=419, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg=='),
Citation(title='artificialintelligence-news.com', score=0.9669729, start_index=420, end_index=554, chunk_index=1, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA'),
Citation(title='ibm.com', score=0.95705074, start_index=555, end_index=693, chunk_index=2, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV'),
Citation(title='ibm.com', score=0.8243703, start_index=694, end_index=807, chunk_index=2, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV'),
Citation(title='appinventiv.com', score=0.9825873, start_index=845, end_index=1017, chunk_index=3, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg=='),
Citation(title='appinventiv.com', score=0.9287954, start_index=1018, end_index=1178, chunk_index=3, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg=='),
Citation(title='appinventiv.com', score=0.9176332, start_index=1179, end_index=1317, chunk_index=3, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg=='),
Citation(title='appinventiv.com', score=0.7995712, start_index=1318, end_index=1464, chunk_index=3, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg=='),
Citation(title='appinventiv.com', score=0.948631, start_index=1465, end_index=1569, chunk_index=3, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg=='),
Citation(title='neudesic.com', score=0.96584463, start_index=2074, end_index=2253, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg=='),
Citation(title='mit.edu', score=0.8654255, start_index=2254, end_index=2379, chunk_index=4, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg=='),
Citation(title='ibm.com', score=0.78701067, start_index=2380, end_index=2512, chunk_index=2, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV'),
Citation(title='sciencedaily.com', score=0.7657468, start_index=2550, end_index=2666, chunk_index=5, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88='),
Citation(title='sciencedaily.com', score=0.7108187, start_index=2667, end_index=2750, chunk_index=5, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88='),
Citation(title='sciencedaily.com', score=0.7387122, start_index=2954, end_index=3037, chunk_index=5, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88='),
Citation(title='neudesic.com', score=0.97621626, start_index=3062, end_index=3187, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg=='),
Citation(title='neudesic.com', score=0.9640589, start_index=3189, end_index=3326, chunk_index=0, link='https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==')
]
We can get our citation links like so:
citations[0].get_link()
'_[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_'
With all of this information, we can go back to our original response.text
and add these into our response.
final_response = response.text
offset = 0
for citation in citations:
final_response = (
final_response[:citation.end_index+offset] +
citation.get_link() +
final_response[citation.end_index+offset:]
)
offset += citation.count_chars()
Markdown(final_response)
Here's a breakdown of the latest news in AI:
**1. AI Model Advancements:**
* **OpenAI's "o1" Model:** OpenAI has introduced the o1-preview and o1-mini models,
which demonstrate enhanced reasoning skills._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
The o1 model has achieved an estimated IQ of 120, showcasing proficiency comparable to
human performance in solving mathematical problems._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
It scored 83% on the International Mathematics Olympiad qualifying exam._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
* **Google's Veo and Imagen 3:** Google Cloud has launched Veo and Imagen 3, two new
generative AI models on its Vertex AI platform._[[2](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA)]_
* **Generative AI Evolution:** Generative AI is rapidly evolving, moving from large,
centralized models to smaller, more efficient ones._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_
Open-source models are becoming increasingly powerful, often outperforming proprietary
models on many benchmarks._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_
**2. AI Applications and Trends:**
* **Autonomous Systems:** AI agents are being developed to proactively take on tasks
and enhance decision-making across various sectors, including banking and healthcare._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Explainable AI:** There's a growing emphasis on making AI decision-making
processes more transparent and understandable to build trust and accountability._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **AI Democratization:** Low-code and no-code AI platforms are making it easier for
businesses to customize and implement AI solutions._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Multi-Modal AI:** AI is increasingly combining different types of data, such as
text, images, and speech, for more comprehensive processing._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Digital Twins:** Digital twins are gaining prominence for simulating real-world
objects digitally._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **AI in Robotics:** Robots are being developed with advanced capabilities, including
learning through observation, and are being used in various applications, such as
caregiving and chemical synthesis research.
* **AI in Healthcare:** AI is being used for diagnostics, such as analyzing X-rays,
and there's a focus on regulating AI models and algorithms in healthcare.
* **AI in Cybersecurity:** AI is being used to enhance cybersecurity measures.
**3. Ethical and Regulatory Considerations:**
* **Regulation of AI:** There's a growing need for effective regulation and ethical
oversight of AI to address risks, protect individual rights, and enhance trust in AI
systems._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
* **Bias in AI:** Researchers are working on techniques to reduce bias in AI models
while preserving or improving accuracy._[[5](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg==)]_
* **AI Governance:** There's a focus on developing governance frameworks to make AI
more trustworthy, sustainable, and accessible._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_
**4. Other Notable Developments:**
* **AI-powered robots** are being developed for various tasks, including cleaning and
chemical synthesis research._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
* **AI is being used in virtual reality** to test the reactions of small animals._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
* **AI is being used to create video content**, although some of these technologies
may not be available in all regions.
* **AI is being used in the development of drones**, including attack drones.
* **AI is being used in the development of soft robots**, inspired by manta rays._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
**5. Market Growth:**
* The global AI market is projected to reach $1.35 trillion by 2030, with an annual
growth rate of 36.8% from 2023 to 2030._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
In summary, AI is rapidly advancing across various fields, with new models,
applications, and ethical considerations emerging constantly._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
We now have functional inline citations inside our response, let's finish by adding a final block containing the more detailed citations.
final_response = f"{final_response}\n\n**Citations**\n\n{link_str}"
Markdown(final_response)
Here's a breakdown of the latest news in AI:
**1. AI Model Advancements:**
* **OpenAI's "o1" Model:** OpenAI has introduced the o1-preview and o1-mini models,
which demonstrate enhanced reasoning skills._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
The o1 model has achieved an estimated IQ of 120, showcasing proficiency comparable to
human performance in solving mathematical problems._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
It scored 83% on the International Mathematics Olympiad qualifying exam._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
* **Google's Veo and Imagen 3:** Google Cloud has launched Veo and Imagen 3, two new
generative AI models on its Vertex AI platform._[[2](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA)]_
* **Generative AI Evolution:** Generative AI is rapidly evolving, moving from large,
centralized models to smaller, more efficient ones._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_ Open-source models are becoming increasingly powerful, often outperforming proprietary models on many benchmarks._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_
**2. AI Applications and Trends:**
* **Autonomous Systems:** AI agents are being developed to proactively take on tasks
and enhance decision-making across various sectors, including banking and healthcare._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Explainable AI:** There's a growing emphasis on making AI decision-making
processes more transparent and understandable to build trust and accountability._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **AI Democratization:** Low-code and no-code AI platforms are making it easier for
businesses to customize and implement AI solutions._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Multi-Modal AI:** AI is increasingly combining different types of data, such as
text, images, and speech, for more comprehensive processing._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **Digital Twins:** Digital twins are gaining prominence for simulating real-world
objects digitally._[[4](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)]_
* **AI in Robotics:** Robots are being developed with advanced capabilities, including
learning through observation, and are being used in various applications, such as
caregiving and chemical synthesis research.
* **AI in Healthcare:** AI is being used for diagnostics, such as analyzing X-rays,
and there's a focus on regulating AI models and algorithms in healthcare.
* **AI in Cybersecurity:** AI is being used to enhance cybersecurity measures.
**3. Ethical and Regulatory Considerations:**
* **Regulation of AI:** There's a growing need for effective regulation and ethical
oversight of AI to address risks, protect individual rights, and enhance trust in AI
systems._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
* **Bias in AI:** Researchers are working on techniques to reduce bias in AI models
while preserving or improving accuracy._[[5](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg==)]_
* **AI Governance:** There's a focus on developing governance frameworks to make AI
more trustworthy, sustainable, and accessible._[[3](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)]_
**4. Other Notable Developments:**
* **AI-powered robots** are being developed for various tasks, including cleaning and
chemical synthesis research._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
* **AI is being used in virtual reality** to test the reactions of small animals._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
* **AI is being used to create video content**, although some of these technologies
may not be available in all regions.
* **AI is being used in the development of drones**, including attack drones.
* **AI is being used in the development of soft robots**, inspired by manta rays._[[6](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)]_
**5. Market Growth:**
* The global AI market is projected to reach $1.35 trillion by 2030, with an annual
growth rate of 36.8% from 2023 to 2030._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
In summary, AI is rapidly advancing across various fields, with new models,
applications, and ethical considerations emerging constantly._[[1](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)]_
**Citations**
[1] [neudesic.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcTKCtJJhHLwIr-0VhJHCgCP6IipNpHpigvjsJMsAC3UAqWjHDuhmKdGZljOnhbv5LlM2dG3vqHuSHS8RErnjGGqcstzhDE1BLvoc6iIcBeNqIDm7lGi1GHacxP3BzOoRyzFHP__gulZmViv__6xZPGdlg==)
[2] [artificialintelligence-news.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRZffpBisMCeWgVhdH1s3r5DEwqET2Klzcx0YI5x_XRgdnAaieuFFJ-WcreQiu70mqxtnlJWE8OA-kr5rfzuRbptFwATCjiDZxqzWIq7MMPUT5jfjmdiqj9mbbsWDIXhOeA)
[3] [ibm.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcRgj-x7drc2UgsgupbyP8asW7uaDp-QL1k-Y-z66NT11LKt5L4TJgnBOh-XCqT2a2TmoBlPHVS6gRArbVKoQHJvpVX-Xzcd52-Hp1-0SsbT9CMKzCiCoaTObhjngxhNArXNQjhlRTWyVRUPYQaJiFNNT7KLOiiV)
[4] [appinventiv.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQ4E_Pzuv1J_yr9n3AnR6PKNTGWjeYbcgRcsuvrS_cdl8tomTmBju69myAPp568o3KTmjtSqMxhk6RCBhCbReMgfJkY3jjPOqiOOjjfVLF3YlU8Pnv8iWdQJF2Jvg==)
[5] [mit.edu](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQqknOhSlrtOwihnhToxiY-Z612vhV0q2HkP0IIwy0kj59hPahdxhgW6K5xqiXWZ9YqcxI-t_zdR_lWEafMszsTV_x03RkxoEk-awq2KN2LO6S_bzO754k3O-ZLiTNCzwHvK5hxpIwUEg==)
[6] [sciencedaily.com](https://vertexaisearch.cloud.google.com/grounding-api-redirect/AYygrcQnbQe7mPP_bx_Z2izdSLcfuAXN5LUs6YxCy7rwrCUX7HeM18yB9Rmz-LAAJp7ylRIUXQCVgpllzUqMnfXYeJcUFJaZ_QVCijeuKcMHELlxSCl3ADT6RiXK0NZGfw385nu--g1kG--Cm6jjWqHksvBBr7oSqWKZDvsFwC-hE88=)
That's it, we've built a comprehensive AI research agent with Gemini 2.0 Flash. Utilizing Google's own search engine and built-in support for search and citations, our agent is - with only a small effort on our side - able to generate impressive and grounded responses.