Add project metadata and docs
build-winui / winui (push) Has been cancelled

This commit is contained in:
QWQLwToo
2026-06-26 13:26:40 +08:00
parent e43a25ce71
commit f59190251d
32 changed files with 5492 additions and 1 deletions
+230
View File
@@ -0,0 +1,230 @@
\# AI全网最新资讯 - API 对接文档
\## 接口概览
该接口用于获取最近24小时内的全网AI最新资讯。内容涵盖模型发布/更新、开发工具/框架、学术研究/论文、公司/商业动态、应用案例/创意、技术问题讨论、伦理/安全等7个方面。数据缓存24小时,首次访问扣费,24小时内同一Key再次访问不重复扣费。
\## 请求地址
`https://api.pearapi.ai/api/latest\_ai\_consultative`
\## 请求方式
GET
\## 返回格式
JSON
\## 权限/付费要求
\- \*\*接口类型\*\*:免费接口
\- \*\*付费策略\*\*:首次请求扣费,24小时内同一Key重复请求不扣费。
\## 请求参数说明
| 参数名 | 是否必填 | 用途 |
| :--- | :--- | :--- |
| `key` | 是 | API Key值,用于身份验证。 |
\## 默认请求示例
```json
{
  "key": "xxx"
}
```
实际请求时,请将 `xxx` 替换为有效的API Key。
\## 返回字段说明
| 字段路径 | 类型 | 说明 |
| :--- | :--- | :--- |
| `code` | integer | 状态码。例如:200表示成功。 |
| `msg` | string | 状态信息。例如:“获取最新AI咨询成功”。 |
| `cache` | string | 是否命中缓存。 |
| `data` | object | 返回内容主体,包含所有分类的资讯数据。 |
| `data.image\_url` | string | AI报道的封面图片链接。 |
| `data.models\_and\_releases` | array | 模型发布/更新分类下的资讯列表。 |
| `data.models\_and\_releases\[].created\_at` | string | 资讯发布时间。 |
| `data.models\_and\_releases\[].title` | string | 资讯文章标题。 |
| `data.models\_and\_releases\[].summary` | string | 资讯文章详情摘要。 |
| `data.models\_and\_releases\[].source` | string | 资讯来源平台。 |
| `data.models\_and\_releases\[].url` | string | 资讯原文链接地址。 |
| `data.tools\_and\_frameworks` | array | 开发工具/框架分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.research\_and\_papers` | array | 学术研究/论文分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.industry\_and\_business` | array | 公司/商业动态分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.applications\_and\_use\_cases` | array | 应用案例/创意分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.technical\_discussions` | array | 技术问题讨论分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.ethics\_and\_safety` | array | 伦理/安全分类下的资讯列表。元素结构与 `models\_and\_releases` 相同。 |
| `data.models\_and\_architectures` | array | 未提供说明。 |
| `data.engineering\_and\_tools` | array | 未提供说明。 |
| `data.papers\_and\_research` | array | 未提供说明。 |
| `data.industry\_news` | array | 未提供说明。 |
| `api\_source` | string | 返回数据来源说明。 |
\## 返回示例
```json
{
  "code": 200,
  "msg": "获取最新AI咨询成功",
  "cache": true,
  "data": {
  "image\_url": "https://api.pearapi.ai/cache/images/2026-01-04/f658f4a2-8319-49b3-859d-4b5955c49e86.jpg",
  "models\_and\_releases": \[
  {
  "created\_at": "2026-01-04 15:06:49",
  "title": "Kimi 发布新模型 kiwi-do 并在 LM Arena 开启测试",
  "summary": "Kimi 旗下的新模型 kiwi-do 正式在 Chatbot Arena (lmarena) 平台上线并开启公开测试。该模型旨在通过竞技场实测收集用户反馈,以评估其在真实对话和复杂指令遵循方面的性能表现。这一动态显示了 Kimi 在模型迭代上的持续发力,通过公开竞技场测试有助于提升其在全球主流模型排名中的透明度与认可度。",
  "source": "linux.do",
  "url": "https://linux.do/t/topic/1403800"
  }
  ],
  "tools\_and\_frameworks": \[
  "省略"
  ],
  "research\_and\_papers": \[
  "省略"
  ],
  "industry\_and\_business": \[
  "省略"
  ],
  "applications\_and\_use\_cases": \[
  "省略"
  ],
  "technical\_discussions": \[
  "省略"
  ],
  "ethics\_and\_safety": \[
  "省略"
  ],
  "models\_and\_architectures": \[],
  "engineering\_and\_tools": \[],
  "papers\_and\_research": \[],
  "industry\_news": \[]
  },
  "api\_source": "官方API网:https://api.pearapi.ai/"
}
```
\## 对接注意事项
1\. \*\*Key验证\*\*:所有请求都必须携带有效的 `key` 参数,否则请求将被拒绝。
2\. \*\*缓存机制\*\*:接口数据缓存24小时。在缓存有效期内,使用相同的 `key` 再次请求将直接返回缓存数据,不会产生新的扣费。
3\. \*\*数据分类\*\*:返回的 `data` 对象中包含多个分类数组,每个数组内的元素结构均与示例中的 `models\_and\_releases` 数组元素一致(包含 `created\_at`, `title`, `summary`, `source`, `url` 字段)。
4\. \*\*空数组\*\*:示例中 `models\_and\_architectures``engineering\_and\_tools` 等字段可能返回空数组,表示该时段内无对应分类的资讯。
\## 给AI助手的实现建议
1\. \*\*请求构建\*\*:使用HTTP GET方法,将 `key` 作为查询参数附加到URL上。例如:`https://api.pearapi.ai/api/latest\_ai\_consultative?key=你的Key`
2\. \*\*错误处理\*\*:建议检查返回的 `code` 字段。若 `code` 不为200,应根据 `msg` 字段内容进行错误提示。
3\. \*\*数据解析\*\*:解析JSON响应后,优先处理 `data` 对象下的 `models\_and\_releases``tools\_and\_frameworks` 等数组字段。遍历每个数组中的元素,提取 `title``summary``source``url``created\_at` 等信息进行展示。
4\. \*\*缓存判断\*\*:可以通过 `cache` 字段判断返回的数据是否为缓存数据,用于日志记录或调试。
5\. \*\*付费逻辑\*\*:无需在客户端实现复杂的付费逻辑,只需正常调用接口即可。服务端会自动处理首次扣费和缓存期内免扣费的策略。