Procurize.AI REST API 参考#

使用您的 API 令牌以编程方式访问您的知识库——文档、问卷、RAG 和报告。

适用范围: Procurize.AI API v1
身份验证: 通过 X-API-Key 请求头传递 API 密钥(参见 API 令牌 进行令牌管理)
基础 URL: https://api.procurize.com

概览#

Procurize.AI REST API 提供对平台关键功能的编程访问。它使您能够将 Procurize.AI 与内部系统集成、自动化知识库管理并构建自定义工作流。

受支持的模块(需令牌认证):

身份验证#

所有需要身份验证的端点都必须在请求头中传递 API 令牌。

HeaderValue
X-API-Key<YOUR_API_TOKEN>

示例:

curl -X GET "https://api.procurize.com/v1/..." \
  -H "X-API-Key: your-api-token-here"

💡 令牌绑定到您的组织——无需在请求中指定组织 ID。

基础 URL#

所有 REST API 端点均位于以下地址下:

https://api.procurize.com

错误处理#

API 使用标准的 HTTP 状态码。

CodeMeaning
200 OK请求成功
201 Created资源创建成功
204 No Content请求成功,无响应体
400 Bad Request参数无效或请求格式错误
401 Unauthorized缺少或无效的 API 令牌
403 Forbidden令牌没有执行此操作的权限
404 Not Found资源不存在
500 Internal Server Error服务器内部错误

错误响应包含机器可读的错误代码和人类可读的错误信息。

模块参考#

RagArticle#

GET /questionnaire/rag/articles/summary#

摘要: 首页摘要

参数:

NameInTypeRequiredDescription
projquerystring (uuid)No项目 ID。

响应 (200):

{
  "active": 5
}

GET /questionnaire/rag/articles/total#

摘要: 文章数量

参数:

NameInTypeRequiredDescription
qquerystringNo按文章名称或代码过滤。
statequeryarrayNo按状态过滤。
projectqueryarrayNo按项目过滤。
typequeryarrayNo按文档类型过滤。

响应 (200):

42

GET /questionnaire/rag/articles/list#

摘要: 获取文章列表

参数:

NameInTypeRequiredDescription
qquerystringNo按文章名称或代码过滤。
statequeryarrayNo按状态过滤。
projectqueryarrayNo按项目过滤。
typequeryarrayNo按文档类型过滤。
squerystringNo排序字段。
ascquerybooleanNo升序排序。
psqueryinteger (int32)No每页大小。
pqueryinteger (int32)No基于 1 的页码。

响应 (200):

{
  "paging": {
    "pageNumber": 1,
    "pageSize": 10,
    "total": 42,
    "totalPages": 5
  },
  "items": [
    {
      "code": "ART-001",
      "org": "00000000-0000-0000-0000-000000000000",
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "Article Title",
      "description": "Article description",
      "documentTypes": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "Type Name",
          "plural": "Type Names",
          "count": 5
        }
      ],
      "size": 150,
      "revision": {
        "id": "00000000-0000-0000-0000-000000000000",
        "collectionId": "00000000-0000-0000-0000-000000000000",
        "rev": 3,
        "date": "2025-01-15T10:30:00Z",
        "author": {
          "id": "user123",
          "name": "John Doe",
          "email": "john.doe@example.com",
          "login": "johndoe",
          "ra": true
        },
        "authorName": "John Doe",
        "analysisSummary": {
          "id": "00000000-0000-0000-0000-000000000000",
          "initiator": {
            "id": "user123",
            "name": "John Doe",
            "email": "john.doe@example.com",
            "login": "johndoe",
            "ra": true
          },
          "created": "2025-01-15T10:30:00Z",
          "state": "Completed",
          "stateDate": "2025-01-15T10:35:00Z",
          "stateDetails": "Analysis completed successfully",
          "operationId": "op-12345"
        }
      },
      "type": "Article",
      "state": "Active",
      "projects": [
        "00000000-0000-0000-0000-000000000000"
      ],
      "items": [
        "00000000-0000-0000-0000-000000000000"
      ],
      "isShared": false
    }
  ]
}

POST /questionnaire/rag/file-to-md#

摘要: 从文件返回 Markdown 内容

请求体 (multipart/form-data):

{
  "url": "https://example.com/file.pdf",
  "file": "binary"
}

响应 (200):

"Markdown content from file"

POST /questionnaire/rag/article/create#

摘要: 创建文章

请求体 (multipart/form-data):

{
  "code": "ART-001",
  "name": "Article Title",
  "description": "Article description",
  "content": "# Article Content\n\nThis is the article content.",
  "url": "https://example.com/file.pdf",
  "file": "binary"
}

响应 (200):

{
  "code": "ART-001",
  "org": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "Article Title",
  "description": "Article description",
  "documentTypes": null,
  "size": 150,
  "revision": null,
  "type": "Article",
  "state": "Active",
  "projects": null,
  "items": null,
  "isShared": false
}

GET /questionnaire/rag/article/check#

摘要: 检查文章是否存在

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

响应 (200):

true

GET /questionnaire/rag/article-info#

摘要: 按代码获取文章信息

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

响应 (200):

{
  "code": "ART-001",
  "org": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "Article Title",
  "description": "Article description",
  "documentTypes": null,
  "size": 150,
  "revision": null,
  "type": "Article",
  "state": "Active",
  "projects": null,
  "items": null,
  "isShared": false
}

GET /questionnaire/rag/article#

摘要: 按代码获取文章内容

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。
formatquerystringNo为 true 时返回 HTML 内容;否则返回 Markdown 格式的文章内容。
splitquerybooleanNo为 true 时返回按 RAG 元素分割的内容。
cssquerybooleanNo为 true 时返回带 CSS 的 HTML/PDF 内容。

响应 (200):

"# Article Title\n\nThis is the article content in Markdown format."

POST /questionnaire/rag/article#

摘要: 更新文章元数据

请求体:

{
  "code": "ART-001",
  "name": "Updated Article Title",
  "description": "Updated description",
  "projects": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "documentTypes": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "Type Name",
      "plural": "Type Names"
    }
  ],
  "isShared": true,
  "state": "Active"
}

响应 (200):

{}

DELETE /questionnaire/rag/article#

摘要: 删除文章

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

GET /questionnaire/rag/article/pdf#

摘要: 按代码获取 PDF 形式的文章

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

响应 (200):

(pdf binary)

GET /questionnaire/rag/article/content#

摘要: 获取文章内容

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

响应 (200):

{
  "content": "# Article Title\n\nContent here."
}

POST /questionnaire/rag/article/content#

摘要: 更新文章内容

请求体 (multipart/form-data):

{
  "code": "ART-001",
  "content": "# Updated Content",
  "file": "binary"
}

POST /questionnaire/rag/plural#

摘要: 获取名词的复数形式

参数:

NameInTypeRequiredDescription
nounquerystringNo需要复数化的名词。

响应 (200):

{
  "plural": "Articles"
}

POST /questionnaire/rag/article/find-types#

摘要: 使用 AI 分析文章并返回其类型

请求体 (multipart/form-data):

{
  "code": "ART-001",
  "content": "# Article Content"
}

响应 (200):

[
  {
    "plural": "Types"
  }
]

POST /questionnaire/rag/article/format-with-ai#

摘要: 使用 AI 格式化文章内容

请求体 (multipart/form-data):

{
  "code": "ART-001",
  "content": "# Article Content"
}

响应 (200):

{
  "formattedContent": "# Formatted Article Content"
}

POST /questionnaire/rag/article/improve-on-suggestions#

摘要: 根据建议改进文档

请求体 (multipart/form-data):

{
  "suggestions": [
    {
      "sectionTitle": "Introduction",
      "suggestion": "Add more details here."
    }
  ],
  "code": "ART-001",
  "content": "# Article Content"
}

响应 (200):

{
  "improvedContent": "# Improved Content"
}

GET /questionnaire/rag/article/parts#

摘要: 返回文章部件列表

参数:

NameInTypeRequiredDescription
idqueryarrayYes文章部件列表。

响应 (200):

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "code": "part-1",
    "title": "Introduction",
    "orderNumber": 1,
    "content": "Introduction content."
  }
]

GET /questionnaire/rag/article/revisions#

摘要: 返回文章修订列表

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。

响应 (200):

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "collectionId": "00000000-0000-0000-0000-000000000000",
    "rev": 1,
    "date": "2025-01-15T10:30:00Z",
    "author": {
      "id": "user123",
      "name": "John Doe",
      "email": "john.doe@example.com",
      "login": "johndoe",
      "ra": true
    },
    "authorName": "John Doe",
    "analysisSummary": {
      "id": "00000000-0000-0000-0000-000000000000",
      "initiator": {
        "id": "user123",
        "name": "John Doe",
        "email": "john.doe@example.com",
        "login": "johndoe",
        "ra": true
      },
      "created": "2025-01-15T10:30:00Z",
      "state": "Completed",
      "stateDate": "2025-01-15T10:35:00Z",
      "stateDetails": "Analysis completed",
      "operationId": "op-12345"
    }
  }
]

GET /questionnaire/rag/article/revisions/info/{id}#

摘要: 获取文章修订信息

参数:

NameInTypeRequiredDescription
idpathstring (uuid)Yes修订 ID。

响应 (200):

{
  "id": "00000000-0000-0000-0000-000000000000",
  "collectionId": "00000000-0000-0000-0000-000000000000",
  "rev": 1,
  "date": "2025-01-15T10:30:00Z",
  "author": {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "login": "johndoe",
    "ra": true
  },
  "authorName": "John Doe",
  "analysisSummary": {
    "id": "00000000-0000-0000-0000-000000000000",
    "initiator": {
      "id": "user123",
      "name": "John Doe",
      "email": "john.doe@example.com",
      "login": "johndoe",
      "ra": true
    },
    "created": "2025-01-15T10:30:00Z",
    "state": "Completed",
    "stateDate": "2025-01-15T10:35:00Z",
    "stateDetails": "Analysis completed",
    "operationId": "op-12345"
  }
}

GET /questionnaire/rag/article/revisions/{id}#

摘要: 获取文章修订内容

参数:

NameInTypeRequiredDescription
idpathstring (uuid)Yes修订 ID。

响应 (200):

"# Article Revision Content\n\nPrevious version."

GET /questionnaire/rag/article/analyze#

摘要: 使用 AI 分析文章内容

参数:

NameInTypeRequiredDescription
codequerystringYes文章代码。
revqueryinteger (int32)No修订号。
forcequerybooleanNo强制创建新分析并删除已有的未完成分析结果。

响应 (200):

{
  "id": "00000000-0000-0000-0000-000000000000",
  "initiator": {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "login": "johndoe",
    "ra": true
  },
  "created": "2025-01-15T10:30:00Z",
  "state": "Completed",
  "stateDate": "2025-01-15T10:35:00Z",
  "stateDetails": "Analysis completed",
  "operationId": "op-12345"
}

GET /questionnaire/rag/article/analyze/{id}#

摘要: 获取文章分析结果

参数:

NameInTypeRequiredDescription
idpathstring (uuid)Yes分析 ID。

响应 (200):

{
  "id": "00000000-0000-0000-0000-000000000000",
  "initiator": {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "login": "johndoe",
    "ra": true
  },
  "created": "2025-01-15T10:30:00Z",
  "state": "Completed",
  "stateDate": "2025-01-15T10:35:00Z",
  "stateDetails": "Analysis completed",
  "operationId": "op-12345",
  "fragments": [
    "fragment-1",
    "fragment-2"
  ],
  "ownInconcies": "Own inconsistencies found",
  "ragInconcies": "RAG inconsistencies found",
  "proposals": "Improvement proposals"
}

GET /questionnaire/rag/messages/list#

摘要: 列出所有消息

参数:

NameInTypeRequiredDescription
idquerystring (uuid)YesRAG 集合 ID。
itemquerystring (uuid)NoRAG 项目 ID。
messagequerystring (uuid)No消息 ID。
ascquerybooleanNo升序排序。
psqueryinteger (int32)No每页大小。
pqueryinteger (int32)No基于 1 的页码。

响应 (200):

{
  "paging": {
    "pageNumber": 1,
    "pageSize": 10,
    "total": 5,
    "totalPages": 1
  },
  "items": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "replyTo": null,
      "questionnaire": null,
      "section": null,
      "question": null,
      "ragCollection": "00000000-0000-0000-0000-000000000000",
      "ragItem": "00000000-0000-0000-0000-000000000000",
      "targetId": "00000000-0000-0000-0000-000000000000",
      "targetType": "Question",
      "targetNum": 1,
      "author": {
        "id": "user123",
        "name": "John Doe",
        "email": "john.doe@example.com",
        "login": "johndoe",
        "ra": true
      },
      "text": "Message content",
      "created": "2025-01-15T10:30:00Z",
      "updated": "2025-01-15T10:30:00Z",
      "replies": 0
    }
  ]
}

POST /questionnaire/rag/messages/add#

摘要: 添加新消息

参数:

NameInTypeRequiredDescription
idquerystring (uuid)YesRAG 集合 ID。
itemquerystring (uuid)NoRAG 项目 ID。
messagequerystring (uuid)No要回复的消息 ID。

请求体:

{
  "text": "New message content"
}

响应 (200):

{
  "id": "00000000-0000-0000-0000-000000000000",
  "replyTo": null,
  "questionnaire": null,
  "section": null,
  "question": null,
  "ragCollection": "00000000-0000-0000-0000-000000000000",
  "ragItem": "00000000-0000-0000-0000-000000000000",
  "targetId": "00000000-0000-0000-0000-000000000000",
  "targetType": "Question",
  "targetNum": 1,
  "author": {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "login": "johndoe",
    "ra": true
  },
  "text": "New message content",
  "created": "2025-01-15T10:30:00Z",
  "updated": "2025-01-15T10:30:00Z",
  "replies": 0
}

POST /questionnaire/rag/message#

摘要: 更新已有消息

参数:

NameInTypeRequiredDescription
cquerystring (uuid)YesRAG 集合 ID。
idquerystring (uuid)Yes消息 ID。

请求体:

{
  "text": "Updated message content"
}

响应 (200):

{
  "id": "00000000-0000-0000-0000-000000000000",
  "replyTo": null,
  "questionnaire": null,
  "section": null,
  "question": null,
  "ragCollection": "00000000-0000-0000-0000-000000000000",
  "ragItem": "00000000-0000-0000-0000-000000000000",
  "targetId": "00000000-0000-0000-0000-000000000000",
  "targetType": "Question",
  "targetNum": 1,
  "author": {
    "id": "user123",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "login": "johndoe",
    "ra": true
  },
  "text": "Updated message content",
  "created": "2025-01-15T10:30:00Z",
  "updated": "2025-01-15T10:45:00Z",
  "replies": 0
}

DELETE /questionnaire/rag/message#

摘要: 删除已有消息

参数:

NameInTypeRequiredDescription
idquerystring (uuid)Yes消息 ID。

响应 (200):

{}

RagFaq#

GET /questionnaire/rag/faq-collections/summary#

摘要: 首页摘要

参数:

NameInTypeRequiredDescription
projquerystring (uuid)No项目 ID。

响应 (200):

{
  "active": 3
}

GET /questionnaire/rag/faq-collections/total#

摘要: FAQ 集合数量

参数:

NameInTypeRequiredDescription
qquerystringNo按集合名称或代码过滤。
statequeryarrayNo按状态过滤。
projectqueryarrayNo按项目过滤。

响应 (200):

3

GET /questionnaire/rag/faq-collections/list#

摘要: 获取 FAQ 集合列表

参数:

NameInTypeRequiredDescription
qquerystringNo按集合名称或代码过滤。
statequeryarrayNo按状态过滤。
projectqueryarrayNo按项目过滤。
squerystringNo排序字段。
ascquerybooleanNo升序排序。
psqueryinteger (int32)No每页大小。
pqueryinteger (int32)No基于 1 的页码。

响应 (200):

{
  "paging": {
    "pageNumber": 1,
    "pageSize": 10,
    "total": 3,
    "totalPages": 1
  },
  "items": [
    {
      "code": "FAQ-001",
      "org": "00000000-0000-0000-0000-000000000000",
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "FAQ Collection",
      "description": "FAQ collection description",
      "documentTypes": null,
      "size": 5,
      "revision": null,
      "type": "Faq",
      "state": "Active",
      "projects": null,
      "items": null,
      "isShared": false
    }
  ]
}

GET /questionnaire/rag/faq-collections/find-items#

摘要: 查找 FAQ 条目

参数:

NameInTypeRequiredDescription
qquerystringYes按问题过滤。
projectquerystring (uuid)No按项目过滤。
psqueryinteger (int32)No每页大小。
pqueryinteger (int32)No基于 1 的页码。

响应 (200):

{
  "paging": {
    "pageNumber": 1,
    "pageSize": 10,
    "total": 5,
    "totalPages": 1
  },
  "items": [
    {
      "index": 0,
      "question": "What is this product?",
      "answer": "This is a great product.",
      "comment": "Product FAQ",
      "state": "Active"
    }
  ]
}

POST /questionnaire/rag/faq-collection/create#

摘要: 创建新的 FAQ 集合

请求体 (multipart/form-data):

{
  "code": "FAQ-001",
  "name": "FAQ Collection",
  "description": "FAQ collection description",
  "content": "Content here",
  "file": "binary"
}

响应 (200):

{
  "code": "FAQ-001",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "FAQ Collection",
  "description": "FAQ collection description",
  "documentTypes": null,
  "size": 5,
  "revision": null,
  "type": "Faq",
  "state": "Active",
  "projects": null,
  "items": null,
  "isShared": false
}

POST /questionnaire/rag/faq-collection#

摘要: 更新 FAQ 集合元数据

请求体:

{
  "code": "FAQ-001",
  "name": "Updated FAQ Collection",
  "description": "Updated description",
  "projects": null,
  "documentTypes": null,
  "isShared": false,
  "state": "Active"
}

DELETE /questionnaire/rag/faq-collection#

摘要: 删除 FAQ 集合

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。

GET /questionnaire/rag/faq-collection#

摘要: 获取 FAQ 集合

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。

响应 (200):

{
  "code": "FAQ-001",
  "org": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "FAQ Collection",
  "description": "FAQ collection description",
  "documentTypes": null,
  "size": 5,
  "revision": null,
  "type": "Faq",
  "state": "Active",
  "projects": null,
  "items": null,
  "isShared": false
}

GET /questionnaire/rag/faq-collection/check#

摘要: 检查 FAQ 集合是否存在

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。

响应 (200):

true

GET /questionnaire/rag/faq-collection/items-total#

摘要: FAQ 条目数量

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。
qquerystringNo按 FAQ 条目内容过滤。

请求体:

["Active", "Default"]

响应 (200):

5

GET /questionnaire/rag/faq-collection/items#

摘要: 获取 FAQ 条目列表

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。
qquerystringNo按 FAQ 条目内容过滤。
statequeryarrayNo按状态过滤。
squerystringNo排序字段。
ascquerybooleanNo升序排序。
psqueryinteger (int32)No每页大小。
pqueryinteger (int32)No基于 1 的页码。

响应 (200):

{
  "paging": {
    "pageNumber": 1,
    "pageSize": 10,
    "total": 5,
    "totalPages": 1
  },
  "items": [
    {
      "index": 0,
      "question": "What is this product?",
      "answer": "This is a great product.",
      "comment": "Product FAQ",
      "state": "Active"
    }
  ]
}

POST /questionnaire/rag/faq-collection/item/create#

摘要: 创建新的 FAQ 条目

请求体:

{
  "code": "FAQ-001",
  "index": 0,
  "question": "What is this product?",
  "answer": "This is a great product.",
  "comment": "Product FAQ",
  "state": "Active"
}

响应 (200):

{
  "index": 0,
  "question": "What is this product?",
  "answer": "This is a great product.",
  "comment": "Product FAQ",
  "state": "Active"
}

GET /questionnaire/rag/faq-collection/item#

摘要: 获取 FAQ 条目

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。
indexqueryinteger (int32)Yes集合中 FAQ 条目的零基索引。

响应 (200):

{
  "index": 0,
  "question": "What is this product?",
  "answer": "This is a great product.",
  "comment": "Product FAQ",
  "state": "Active"
}

POST /questionnaire/rag/faq-collection/item#

摘要: 更新 FAQ 条目

请求体:

{
  "code": "FAQ-001",
  "index": 0,
  "newIndex": 1,
  "question": "Updated question?",
  "answer": "Updated answer.",
  "comment": "Updated comment",
  "state": "Active"
}

DELETE /questionnaire/rag/faq-collection/item#

摘要: 删除 FAQ 条目

参数:

NameInTypeRequiredDescription
codequerystringYes集合代码。
indexqueryinteger (int32)Yes集合中 FAQ 条目的零基索引。

RagQuery#

POST /questionnaire/rag/query#

摘要: 在 RAG 知识库中执行查询

请求体:

{
  "project": "00000000-0000-0000-0000-000000000000",
  "excludeCollections": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "question": "What is this product?",
  "yourCompanyName": "Acme Corp",
  "yourCompanyAlias": "Acme",
  "customerName": "John Doe",
  "options": [
    "option1",
    "option2"
  ],
  "multiselect": false,
  "nArticles": 5,
  "nFaqs": 3,
  "threshold": 0.5,
  "debug": false,
  "withJustification": true,
  "withConfidenceLevel": true,
  "withFragments": true,
  "nAttempts": 3
}

响应 (200):

{
  "attempt": 1,
  "preparedQuery": {
    "original": "What is this product?",
    "enhanced": "What is this product and its features?"
  },
  "ragItems": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "distance": 0.25
    }
  ],
  "question": "What is this product?",
  "generalInstructions": "Based on the knowledge base, here is the answer:",
  "text": "This product is a great solution for your needs.",
  "explanation": "The answer was found in multiple sources with high confidence."
}

POST /questionnaire/rag/query-stream#

摘要: 在 RAG 知识库中执行流式查询

请求体:

{
  "project": "00000000-0000-0000-0000-000000000000",
  "excludeCollections": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "question": "What is this product?",
  "yourCompanyName": "Acme Corp",
  "yourCompanyAlias": "Acme",
  "customerName": "John Doe",
  "options": [
    "option1",
    "option2"
  ],
  "multiselect": false,
  "nArticles": 5,
  "nFaqs": 3,
  "threshold": 0.5,
  "debug": false,
  "withJustification": true,
  "withConfidenceLevel": true,
  "withFragments": true,
  "nAttempts": 3
}

响应 (200):

[
  {
    "text": "This product is a great solution",
    "fragments": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "part": 1,
        "distance": 0.25,
        "type": "Article",
        "code": "ART-001",
        "title": "Product Title",
        "fragment": "Product content fragment"
      }
    ]
  },
  {
    "text": " for your needs.",
    "fragments": []
  }
]

POST /questionnaire/rag/query-fragments#

摘要: 在 RAG 知识库中查询片段

请求体:

{
  "project": "00000000-0000-0000-0000-000000000000",
  "exclude_documents": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "query": "What is this product?",
  "top_k": 5,
  "similarity_threshold": 0.5,
  "prepare_query": true
}

响应 (200):

{
  "results": [
    {
      "document_id": "00000000-0000-0000-0000-000000000000",
      "document_code": "ART-001",
      "document_title": "Product Title",
      "revision": 3,
      "chunk_index": 0,
      "content": "Product content fragment",
      "metadata": {
        "author": "John Doe",
        "created_at": "2025-01-15T10:30:00Z",
        "last_updated_at": "2025-01-15T10:35:00Z",
        "doc_categories": [
          "Product",
          "Information"
        ]
      },
      "similarity_score": 0.85
    }
  ]
}

相关文档#

到顶部
选择语言