# Rememberizer GPTの作成

### 前提条件

まず、[Rememberizerアプリを登録](/ja/rissu/integration-options/registering-rememberizer-apps.md)し、適切な設定で構成する必要があります。

{% hint style="info" %}
代替の統合方法に興味がある場合は、[LangChain統合](/ja/rissu/integration-options/langchain-integration.md)をチェックして、Rememberizerのセマンティック検索機能にプログラム的にアクセスしてください。
{% endhint %}

GPTを作成するには、Rememberizerアプリの承認されたリクエスト元を`https://chat.openai.com`に設定する必要があります。

> アプリを登録するにはコールバックURLを追加する必要がありますが、GPTにアクションを追加した後でしかコールバックURLを見つけることができませんので、今のところはダミー値（例: <https://chat.openai.com）としておいてください。コールバックURLを取得したら、アプリの正しいものに更新する必要があります。\\>
> \ <mark style="color:red;">**注意:**</mark> <mark style="color:red;">GPTは設定を変更した後にコールバックURLを更新します。最新のコールバックURLをコピーすることを忘れないでください。</mark>

アプリを作成したら、**クライアントID**と**クライアントシークレット**をコピーします。これらはGPTを作成する際に使用します。これらの情報を取得する方法については、[Rememberizerアプリの承認](https://docs.rememberizer.ai/developer/authorizing-rememberizer-apps)を訪れてください。

<figure><img src="/files/oZoRHbvecDbpVjsNcmT6" alt="登録されたアプリの資格情報"><figcaption></figcaption></figure>

### GPTを作成する

[ChatGPT UIでGPTを作成する](https://chat.openai.com/gpts/editor)ことから始めることができます。

{% hint style="warning" %}
注意: カスタムGPTアプリの作成は、料金プランアカウントのみで利用可能です。
{% endhint %}

近日公開: GPT統合アーキテクチャ図

この包括的なシステム図は以下を示します:

* OpenAI GPT、Rememberizer API、およびユーザーデータソース間の完全なアーキテクチャ
* OAuthコンポーネントを使用した認証フロー
* ユーザーのクエリフロー GPT → Rememberizer → データソース → ユーザーへの戻り
* セキュリティ境界とアクセス制御
* この統合環境におけるメメントフィルタリングの動作
* 典型的なインタラクション中にアクセスされるさまざまなエンドポイント

#### GPTの設定

必要に応じて情報を入力できます。こちらは試してみることができる例です：

<table><thead><tr><th width="156">フィールド</th><th>例の値</th></tr></thead><tbody><tr><td>名前</td><td>RememberizerGPT</td></tr><tr><td>説明</td><td>Google DriveやSlackチャンネル上のすべてのPDF、ドキュメント、シート、スライドに直接話しかけます。</td></tr><tr><td>指示</td><td>Rememberizerは、Rememberizerツールとシームレスに対話するように設計されており、ユーザーがGoogle DriveやSlackなどの複数のソースからデータを効率的に照会できるようにします。主な目標は、Rememberizerの機能を活用して、ユーザーのデータへの迅速かつ正確なアクセスを提供することです。GPTは、ユーザーがクエリを形成し、結果を解釈する際にガイドし、スムーズでユーザーフレンドリーな体験を保証する必要があります。特にデータの取得や分析に関しては、回答の明確さと正確さを維持することが重要です。GPTは、単純なデータ検索から、複数のパラメータやソースを含むより複雑な検索まで、幅広いクエリを処理できる必要があります。焦点は、ユーザーが必要な情報に迅速かつ効果的にアクセスできる能力を向上させ、プロセスをできるだけ簡単にすることです。</td></tr></tbody></table>

#### Rememberizerアクションの作成

GPTエディタから：

1. 「設定」を選択
2. 「アクションを追加」
3. 認証タイプを設定します。

   * 認証タイプを**OAuth**に設定します。
   * 上記の手順から**クライアントID**と**クライアントシークレット**を貼り付けます。
   * 認可URL: `https://api.rememberizer.ai/api/v1/auth/oauth2/authorize/`
   * トークンURL: `https://api.rememberizer.ai/api/v1/auth/oauth2/token/`
   * **スコープ**は空白のままにします。
   * **保存**をクリックします。

   <figure><img src="/files/O5OInAzUmLLSBsqO7kr0" alt="gpt auth type config"><figcaption></figcaption></figure>
4. RememberizerのOpenAPI仕様を記入します。以下の展開可能な内容をコピーして**スキーマ**フィールドに貼り付けます：

<details>

<summary>Rememberizer_OpenAPI.yaml</summary>

```yaml
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: 返すセマンティックに類似したテキストのチャンクの数。最大5の場合は'n=3'、それ以上の情報の場合は'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のチャットです。レスポンスには、discussion_contentとthread_contentsの2つのフィールドが含まれます。前者はチャットの主要なメッセージを含み、後者はディスカッションのスレッドです。
      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: 内部サーバーエラー。
```

</details>

5. このリンクをプライバシーポリシーとして追加します: `https://docs.rememberizer.ai/notices/privacy-policy`。
6. アクションを作成した後、コールバックURLをコピーしてRememberizerアプリに貼り付けます。

<figure><img src="/files/7xYcl5EAz1jVkJjU5YPg" alt="rememberizer app callback url"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rememberizer.ai/ja/rissu/integration-options/creating-a-rememberizer-gpt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
