LLMs hallucinate, especially regarding recent events. Vertex AI allows you to instantly "Ground" Gemini's responses using Google Search.
from vertexai.generative_models import Tool
# Enable Google Search Grounding
tool = Tool.from_google_search_retrieval()
response = model.generate_content(
"What is the stock price of Alphabet today?",
tools=[tool]
)
The response will include citations and links to the exact web pages it used to construct the factual answer.