Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
通过 Gemini API 调用 Google Gemini 2.5 Flash,支持 Google 搜索增强。
curl "https://ai.alad.com/v1beta/models/gemini-2.5-flash:generateContent?key=YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [{ "text": "今天有什么AI相关的最新新闻?" }] } ], "tools": [{ "googleSearch": {} }] }'
import requests url = "https://ai.alad.com/v1beta/models/gemini-2.5-flash:generateContent" params = {"key": "YOUR_API_KEY"} data = { "contents": [ { "role": "user", "parts": [{"text": "今天有什么AI相关的最新新闻?"}] } ], "tools": [{"googleSearch": {}}] } response = requests.post(url, params=params, json=data) result = response.json() print(result["candidates"][0]["content"]["parts"][0]["text"])
key
contents
{ role, parts }
tools
{ "googleSearch": {} }