核心能力
- Google 搜索增强 — 使用实时网络搜索增强回复
- 文档处理 — 处理和分析文档
- 多模态输入 — 接受文本和文件输入
- 快速推理 — 针对速度和效率优化
快速示例
参数说明
API 参考
查看 Gemini 2.5 Flash 的交互式 API Playground。
Documentation Index
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 | string | 是 | API 密钥(查询参数) |
contents | array | 是 | { role, parts } 对象数组 |
tools | array | 否 | 包含 { "googleSearch": {} } 以启用搜索 |
