向量数据库VikingDB
/api/v1/content/abstract 接口用于读取 OpenViking 文件系统中目录的 L0 摘要(约 100 token 的概要)。
完成 API 鉴权说明 页面的 API Key 获取后,可调用本接口读取摘要。
URI | /api/v1/content/abstract | 统一资源标识符 |
|---|---|---|
请求方法 | GET | 客户端请求类型 |
请求头 | Authorization: Bearer | Bearer Token 鉴权 |
参数 | 类型 | 必选 | 默认值 | 备注 |
|---|---|---|---|---|
uri | string | 是 | -- | Viking URI |
字段 | 参数说明 |
|---|---|
status | 请求状态,成功为 |
result | 成功时返回的摘要文本 |
telemetry | 遥测信息,通常为 |
error | 失败时返回的错误对象 |
error.code | 错误码字符串,常见值见下表 |
error.message | 可读的错误描述 |
常见错误码:
error.code | HTTP 状态码 | 说明 |
|---|---|---|
UNAUTHENTICATED | 401 | 缺少或无效的 API Key |
INVALID_ARGUMENT | 400 | 无效参数,如 uri 不是目录 |
INVALID_URI | 400 | 无效的 Viking URI 格式 |
NOT_FOUND | 404 | 资源未找到 |
curl -X GET "https://xxx/api/v1/content/abstract?uri=viking://resources/docs/" \ -H "X-API-Key: your-key"
执行成功返回:
HTTP/1.1 200 OK Content-Type: application/json { "status": "ok", "result": "This repository houses all resources related to the design and development of a coffee ordering page...", "error": null, "telemetry": null }