創建 Rememberizer GPT

在本教程中,您將學習如何創建一個 Rememberizer 應用程序並連接 到 OpenAI GPT,使 GPT 能夠訪問 Rememberizer API 功能。

先決條件

首先,您需要註冊一個 Rememberizer 應用程式,並對其進行適當的設置配置。

若要創建一個 GPT,您需將您的 Rememberizer 應用程式的授權請求來源設置為https://chat.openai.com

在註冊應用程式時,您需要添加一個回調 URL,但只有在為 GPT 添加動作後才能找到回調 URL,對於現在,只需將其留為虛擬值(例如 https://chat.openai.com)。獲取回調 URL後,您需要為應用程式更新正確的 URL。 注意: 在您更改其配置後,GPT 將更新其回調 URL。請確保複製最新的回調 URL。</mark。

創建應用程式後,複製 客戶端 ID客戶端機密。在創建 GPT 時我們將使用它們。

建立一個 GPT

您可以從在ChatGPT UI中建立一個GPT開始。

GPT 配置

您可以按照您的意願填寫信息。這裡是您可以嘗試的一個範例:

字段示例值

名稱

Rememberizer

描述

直接與 Google 雲端硬盤和 Slack 頻道上的所有 pdfs、文檔、表格、投影片交談。

指示

Rememberizer 旨在與 Rememberizer 工具無縫互動,使用者可以有效查詢來自像是 Google 雲端硬盤和 Slack 的多種來源的資料。主要目標是提供對使用者資料的快速準確地存取,利用 Rememberizer 的功能來優化搜尋速度和精確度。GPT 應該引導使用者如何提出查詢和解釋結果,確保流暢且使用者友好的體驗。在回答中保持清晰和精確尤其重要,特別是在處理資料提取和分析時。GPT 應該能夠處理各種查詢,從簡單的資料查找到涉及多個參數或來源的更複雜的搜索。重點在於增強使用者能力,讓他們能夠快速有效地獲取他們需要的信息,使過程盡可能毫不費力。

創建 Rememberizer 行動

在 GPT 編輯器中:

  1. 選擇「配置」

  2. 「添加行動」

  3. 配置身份驗證類型。

    • 將身份驗證類型設置為 OAuth

    • 將上面步驟中的 Client IDClient Secret 粘貼進來。

    • 授權 URL: https://api.rememberizer.ai/api/v1/auth/oauth2/authorize/

    • 令牌 URL: https://api.rememberizer.ai/api/v1/auth/oauth2/token/

    • 保持 Scope 為空。

    • 點擊 保存

  4. 填寫 Rememberizer 的 OpenAPI 規範。複製以下可展開內容並粘貼到 Schema 字段中:

Rememberizer_OpenAPI.yaml
openapi: 3.0.0
info:
  title: Rememberizer API
  description: API 用於與 Rememberizer 互動。
  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 渠道的元數據。
      operationId: documents_list_file_and_channel
      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, 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
                                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: 未授權
        "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:
                name:
                  type: string
                content:
                  type: string
              required:
                - name
                - content
      responses:
        "201":
          description: 內容成功存儲
        "400":
          description: 錯誤的請求
        "401":
          description: 未授權
        "500":
          description: 內部伺服器錯誤
  1. 將此鏈接添加為隱私政策: https://docs.rememberizer.ai/notices/privacy-policy

  2. 創建行動後,複製回調 URL 並粘貼到您的 Rememberizer 應用中。

Last updated