Install and authenticate
This example uses the Google Gen AI Python SDK and its Interactions API. It replaces the oldergoogle-generativeai integration.
Search from Gemini
Save the following asresearch.py and run python research.py. The loop allows up to five model responses and retains the interaction ID between tool calls.
Adapt the tool to your product
Set source filters, result limits and date ranges inside the search function so your application owns those constraints. Return the Search response, includingsuccess, errors and source URLs, so the model can distinguish a failed request from missing evidence.
For a literature feature, start with a specific paper query and inspect the source catalogue. For a company-research feature, state the company and the evidence you need. Source availability depends on the endpoint and your account.
Model usage is billed by Google; retrieval is billed by Valyu. The loop limit bounds model-tool rounds, not the total cost or number of parallel calls in a round.
Next steps
Search parameters
Configure sources, result count and returned content.
Run a research task
Use DeepResearch when you want Valyu to run the investigation.
Google function calling
Review the current Interactions API and model requirements.