It looks like the code you've shared is an example of how to interact with Google's Gemini API using Python and its associated library for various demo purposes. The script showcases different capabilities such as agentic workflows (combining search and custom functions), location-aware responses with Grounding, and multi-turn conversations.
Here are some key points about what the code does:
- Initialization: It starts by importing necessary modules and setting up API credentials.
- Demo 1: Agentic Workflow:
- Demonstrates how to use a custom function alongside Google Search.
- The script sends an initial prompt asking for a trending restaurant in Austin and booking a table, then simulates the confirmation of the booking.
- Demo 2: Location-Aware Responses with Grounding:
- Uses the Gemini API's Grounding feature with Google Maps to provide location-aware responses.
- Queries for nearby Italian restaurants, detailed information about places, and generates an itinerary for San Francisco.
- Demo 3: Full Agentic Workflow:
- Combines Google Search and a custom booking function in one request.
- The script sends a complex prompt asking the model to find a highly-rated BBQ restaurant near the Drisk
Read the full article at MarkTechPost
Want to create content about this topic? Use Nemati AI tools to generate articles, social posts, and more.

![[AINews] The Unreasonable Effectiveness of Closing the Loop](/_next/image?url=https%3A%2F%2Fmedia.nemati.ai%2Fmedia%2Fblog%2Fimages%2Farticles%2F600e22851bc7453b.webp&w=3840&q=75)



