接口说明:获取文章摘要
基本信息
- 请求方式:
GET
- 请求路径:
/summary
- 功能描述:根据文章链接获取由 AI 生成的文章摘要信息。
请求参数
参数名 | 类型 | 位置 | 必填 | 说明 |
---|---|---|---|---|
link | string | query | 是 | 文章链接地址 |
响应参数
成功响应 (200)
- 说明:成功返回文章摘要信息。
- 返回格式:
application/json
- 示例:
json
{
"link": "https://example.com/post",
"summary": "这是一篇关于技术的文章,详细介绍了某个开发工具的使用方法和最佳实践...",
"ai_model": "qwen3",
"content_hash": "abc123def456789",
"created_at": "2025-01-01 10:00:00",
"updated_at": "2025-01-01 12:00:00"
}
失败响应
400 参数错误
- 说明:缺少必填参数
link
。 - 示例:
json
{
"message": "链接参数不能为空"
}
404 未找到摘要
- 说明:未找到该文章的摘要信息。
- 示例:
json
{
"message": "not found"
}
422 验证错误
- 说明:请求参数验证失败(例如未传
link
字段)。 - 示例:
json
{
"detail": [
{
"loc": ["query", "link"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
使用说明
必须传递
link
参数,否则会报 400 错误。响应中包含:
- summary:AI 生成的文章摘要内容
- ai_model:生成摘要所用的模型名称
- content_hash:摘要内容的唯一哈希值,便于缓存与校验
- created_at / updated_at:摘要生成与更新的时间