{ "cells": [ { "cell_type": "markdown", "id": "1e7d62e6", "metadata": {}, "source": [ "# Build a Google Search with Gemini AI\n", "\n", "Queens University - GenAI - From Studio 2, Lab 3\n", "\n", "reference:\n", "\n", "hugging face space [Google Search with Gemini AI](https://huggingface.co/spaces/Rahatara/Gemini_2_Web_Search)" ] }, { "cell_type": "code", "execution_count": 45, "id": "ebc531c4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "AI processes data to learn patterns and make decisions or predictions.\n" ] } ], "source": [ "from google import genai\n", "GEMINI_API_KEY = 'AIzaSyCMOojm7aZCdHsN1n6DKQRj4IWl9J9MuVs'\n", "\n", "client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "response = client.models.generate_content(\n", " model=\"gemini-2.5-flash\", contents=\"Explain how AI works in a few words\"\n", ")\n", "print(response.text)" ] } ], "metadata": { "kernelspec": { "display_name": "llmgroq", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.12" } }, "nbformat": 4, "nbformat_minor": 5 }