Google Search (Interactions)
Code
1import asyncio23from kern.agent import Agent4from kern.models.google import GeminiInteractions56agent = Agent(7 model=GeminiInteractions(8 id="gemini-3-flash-preview",9 search=True,10 ),11 markdown=True,12)1314if __name__ == "__main__":15 agent.print_response("What are the latest developments in quantum computing?")1617 asyncio.run(18 agent.aprint_response("What are the top news stories today?", stream=True)19 )Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export GOOGLE_API_KEY=xxxInstall dependencies
1uv pip install -U "google-genai>=2.0" kern-aiRun Agent
1python cookbook/90_models/google/gemini_interactions/search.py