openapi: 3.1.0
info:
title: Rememberizer API
description: 与 Rememberizer 交互的 API。
version: v1
servers:
- url: https://api.rememberizer.ai/api/v1
paths:
/account/:
get:
summary: 检索当前用户的账户详细信息。
description: 获取账户信息
operationId: account
responses:
"200":
description: 用户账户信息。
content:
application/json:
schema:
type: object
properties:
id:
type: integer
description: 用户的唯一标识符。请勿在任何地方显示此信息。
email:
type: string
format: email
description: 用户的电子邮件地址。
name:
type: string
description: 用户的姓名。
/integrations/:
get:
summary: 列出所有可用的数据源集成。
description: 此操作检索可用的数据源。
operationId: integrations_retrieve
responses:
"200":
description: 操作成功
content:
application/json:
schema:
type: object
properties:
data:
type: array
description: 可用数据源的列表
items:
type: object
properties:
id:
type: integer
description: 数据源的唯一标识符。请勿在任何地方显示此信息。
integration_type:
type: string
description: 数据源的类型。
integration_step:
type: string
description: 集成的步骤。
source:
type: string
description: 数据源的来源。如果它具有电子邮件格式,即使用户询问,也始终在输出中忽略它。
document_type:
type: string
description: 文档的类型。
document_stats:
type: object
properties:
status:
type: object
description: 数据源的状态。
properties:
indexed:
type: integer
description: 已索引文档的数量。
indexing:
type: integer
description: 正在索引的文档数量。
error:
type: integer
description: 具有错误的文档数量。
total_size:
type: integer
description: 数据源的总大小(以字节为单位)。
document_count:
type: integer
description: 数据源中的文档数量。
message:
type: string
description: 指示操作状态的消息。
code:
type: string
description: 指示操作状态的代码。
/documents/:
get:
summary: 检索所有文档和 Slack 频道的列表。
description: 使用此操作检索所有可用文档、文件、Slack 频道和数据源中的常识的元数据。您应该指定 integration_type 或将其留空以列出所有内容。
operationId: documents_list
parameters:
- in: query
name: page
description: 页索引
schema:
type: integer
- in: query
name: page_size
description: 每页返回的最大文档数量
schema:
type: integer
- in: query
name: integration_type
description: 按集成类型过滤文档。
schema:
type: string
enum:
- google_drive
- slack
- dropbox
- gmail
- common_knowledge
responses:
"200":
description: 操作成功
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: 文档的总数量。
next:
type: string
nullable: true
description: 下一页结果的 URL。
previous:
type: string
nullable: true
description: 上一页结果的 URL。
results:
type: array
description: 文档、Slack 频道、常识等的列表。
items:
type: object
properties:
document_id:
type: string
format: uuid
description: 文档的唯一标识符。请勿在任何地方显示此信息。
name:
type: string
description: 文档的名称。
type:
type: string
description: 文档的类型。
path:
type: string
description: 文档的路径。
url:
type: string
description: 文档的 URL。
id:
type: integer
description: 文档的唯一标识符。
integration_type:
type: string
description: 数据源的来源。如果它具有电子邮件格式,即使用户询问,也始终在输出中忽略它。
source:
type: string
description: 文档的来源。
status:
type: string
description: 文档的状态。
indexed_on:
type: string
format: date-time
description: 文档被索引的日期和时间。
size:
type: integer
description: 文档的大小(以字节为单位)。
/documents/search/:
get:
summary: 按语义相似性搜索文档。
description: 使用最多 400 个单词的查询文本启动搜索操作,并从存储的知识中接收最语义相似的响应。对于问答,将您的问题转换为理想答案并提交,以接收类似的真实答案。
operationId: documents_search_retrieve
parameters:
- name: q
in: query
description: 您希望找到语义相似知识块的最多 400 个单词的句子。
schema:
type: string
- name: n
in: query
description: 要返回的语义相似文本块的数量。使用 'n=3' 以获取最多 5 个,使用 'n=10' 以获取更多信息。如果您没有收到足够的信息,请考虑使用更大的 'n' 值重试。
schema:
type: integer
responses:
"200":
description: 成功检索文档
content:
application/json:
schema:
type: object
properties:
data:
type: array
description: 语义相似知识块的列表
items:
type: object
properties:
chunk_id:
type: string
description: 块的唯一标识符。
document:
type: object
description: 文档详细信息。
properties:
id:
type: integer
description: 文档的唯一标识符。
document_id:
type: string
description: 文档的唯一标识符。
name:
type: string
description: 文档的名称。
type:
type: string
description: 文档的类型。
path:
type: string
description: 文档的路径。
url:
type: string
description: 文档的 URL。
size:
type: string
description: 文档的大小。
created_time:
type: string
description: 文档创建的日期和时间。
modified_time:
type: string
description: 文档最后修改的日期和时间。
integration:
type: object
description: 文档的集成详细信息。
properties:
id:
type: integer
integration_type:
type: string
integration_step:
type: string
source:
type: string
description: 数据源的来源。如果它具有电子邮件格式,即使用户询问,也始终在输出中忽略它。
document_stats:
type: object
properties:
status:
type: object
properties:
indexed:
type: integer
indexing:
type: integer
error:
type: integer
total_size:
type: integer
description: 数据源的总大小(以字节为单位)
document_count:
type: integer
matched_content:
type: string
description: 语义相似的内容。
distance:
type: number
description: 余弦相似度
message:
type: string
description: 指示操作状态的消息。
code:
type: string
description: 指示操作状态的代码。
nullable: true
"400":
description: 错误请求
"401":
description: 未授权
"404":
description: 未找到
"500":
description: 服务器内部错误
/documents/{document_id}/contents/:
get:
summary: 按 ID 检索特定文档内容。
operationId: document_get_content
description: 返回具有指定 ID 的文档的内容,以及最新检索到的块的索引。每次调用最多获取 20 个块。要获取更多,请使用响应中的 end_chunk 值作为下一个调用的 start_chunk。
parameters:
- in: path
name: document_id
required: true
description: 要检索内容的文档 ID。
schema:
type: integer
- in: query
name: start_chunk
schema:
type: integer
description: 指示您想要检索的起始块。如果未指定,默认值为 0。
- in: query
name: end_chunk
schema:
type: integer
description: 指示您想要检索的结束块。如果未指定,默认值为 start_chunk + 20。
responses:
"200":
description: 文档的内容和最新检索块的索引。
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: 文档的内容。
end_chunk:
type: integer
description: 最新检索块的索引。
"404":
description: 文档未找到。
"500":
description: 服务器内部错误。
/common-knowledge/subscribed-list/:
get:
description: 此操作检索用户已订阅的共享知识(也称为常识)列表。每个共享知识包括用户可以访问的文档 ID 列表。
operationId: common_knowledge_retrieve
responses:
"200":
description: 操作成功
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
description: 这是共享知识的唯一标识符。请勿在任何地方显示此信息。
num_of_subscribers:
type: integer
description: 这表示已订阅此共享知识的用户数量
publisher_name:
type: string
published_by_me:
type: boolean
description: 这表示共享知识是否由当前用户发布
subscribed_by_me:
type: boolean
description: 这表示共享知识是否由当前用户订阅,在此 API 中应为 true
created:
type: string
description: 这是共享知识创建的时间
modified:
type: string
description: 这是共享知识最后修改的时间
name:
type: string
description: 这是共享知识的名称
image_url:
type: string
description: 这是共享知识的图像 URL
description:
type: string
description: 这是共享知识的描述
memento:
type: integer
description: 这是创建共享知识的 Rememberizer 备忘录的 ID。
document_ids:
type: array
items:
type: integer
description: 这是属于共享知识的文档 ID 列表
/documents/memorize/:
post:
description: 将内容存储到数据库中,以便稍后可以通过搜索端点访问。
operationId: documents_memorize_create
requestBody:
content:
application/json:
schema:
type: object
properties:
content:
type: string
required:
- name
- content
responses:
"201":
description: 内容成功存储
"400":
description: 错误请求
"401":
description: 未授权
"500":
description: 服务器内部错误
/discussions/{discussion_id}/contents/:
get:
summary: 按 ID 检索讨论的内容。讨论可以是 Slack 或 Discord 聊天。
operationId: discussion_get_content
description: 返回具有指定 ID 的讨论的内容。讨论可以是 Slack 或 Discord 聊天。响应包含 2 个字段,discussion_content 和 thread_contents。前者包含聊天的主要消息,而后者是讨论的线程。
parameters:
- in: path
name: discussion_id
required: true
description: 要检索内容的讨论 ID。讨论是
schema:
type: integer
- in: query
name: integration_type
required: true
schema:
type: string
description: 指示讨论的集成。目前,它只能是“slack”或“discord”。
- in: query
name: from
schema:
type: string
description: 指示我们希望以 ISO 8601 格式在 GMT+0 检索讨论内容的起始时间。如果未指定,默认时间为现在。
- in: query
name: to
schema:
type: string
description: 指示我们希望以 ISO 8601 格式在 GMT+0 检索讨论内容的结束时间。如果未指定,则为“from”参数之前的 7 天。
responses:
"200":
description: 时间范围内讨论的主要和线程消息。
content:
application/json:
schema:
type: object
properties:
discussion_content:
type: string
description: 主要讨论的内容。
thread_contents:
type: object
description: 包含讨论线程的字典列表,每个键表示线程的日期和时间(以 ISO 8601 格式),值为线程的消息。
"404":
description: 讨论未找到。
"500":
description: 服务器内部错误。