> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI リソース

サポート対象のLLMの操作に使用される、一連のエンドポイント。

## AIエージェントの参照

クエリの処理に使用されるAIエージェント。

<Accordion title="属性と例">
  | プロパティ  | 型              | 必須 | 説明                                                                                                                                                                                                           |
  | ------ | -------------- | -- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | `type` | `enum<string>` | はい | クエリの処理に使用されるAIエージェントのタイプ。 使用可能なオプション: `ai_agent_id`.                                                                                                                                                         |
  | `id`   | `string`       | はい | エージェントのID。これは、カスタムエージェントの場合は数値ID (例: `14031`)、組み込みのエージェントの場合は一意の識別子 (例: [抽出エージェント (強化)](/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent) の場合は`enhanced_extract_agent`) になります。 |

  ```json 例 theme={null}
  {
    "type": "ai_agent_id",
    "id": "14031"
  }
  ```
</Accordion>

## AIによる抽出 (構造化) のレスポンス

AIによる抽出 (構造化) のレスポンス。

<Accordion title="属性と例">
  | プロパティ               | 型                               | 必須  | 説明                                                            |
  | ------------------- | ------------------------------- | --- | ------------------------------------------------------------- |
  | `answer`            | [AIによる抽出のレスポンス](#ai)            | はい  |                                                               |
  | `created_at`        | `string`                        | はい  | プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。                          |
  | `completion_reason` | `string`                        | いいえ | 応答が終了した理由。                                                    |
  | `confidence_score`  | `object`                        | いいえ | JSON形式の辞書として抽出された各フィールドの信頼度スコアレベルと数値。フィールドが抽出されなかった場合は空になります。 |
  | `reference`         | `object`                        | いいえ | JSON形式の辞書として抽出された各フィールドの参照。フィールドが抽出されなかった場合は空になります。           |
  | `ai_agent_info`     | `リクエストで使用されるモデルおよびプロセッサに関する情報。` | いいえ |                                                               |

  ```json 例 theme={null}
  {
    "answer": {},
    "created_at": "2012-12-12T10:53:43-08:00",
    "completion_reason": "done",
    "confidence_score": {},
    "reference": {},
    "ai_agent_info": {
      "models": [
        {
          "name": "azure__openai__text_embedding_ada_002",
          "provider": "azure",
          "supported_purpose": "embedding"
        }
      ],
      "processor": "basic_text"
    }
  }
  ```
</Accordion>

## AIによる抽出のレスポンス

AIによる抽出のレスポンス。このレスポンスのコンテンツは、リクエストされた構成に応じて異なる場合があります。

<Accordion title="属性と例">
  ```json 例 theme={null}
  {}
  ```
</Accordion>

## AIの応答

AIの応答。

<Accordion title="属性と例">
  | プロパティ               | 型                               | 必須  | 説明                                   |
  | ------------------- | ------------------------------- | --- | ------------------------------------ |
  | `answer`            | `string`                        | はい  | LLMから提供された回答。                        |
  | `created_at`        | `string`                        | はい  | プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。 |
  | `completion_reason` | `string`                        | いいえ | 応答が終了した理由。                           |
  | `ai_agent_info`     | `リクエストで使用されるモデルおよびプロセッサに関する情報。` | いいえ |                                      |

  ```json 例 theme={null}
  {
    "answer": "Public APIs are important because of key and important reasons.",
    "created_at": "2012-12-12T10:53:43-08:00",
    "completion_reason": "done",
    "ai_agent_info": {
      "models": [
        {
          "name": "azure__openai__text_embedding_ada_002",
          "provider": "azure",
          "supported_purpose": "embedding"
        }
      ],
      "processor": "basic_text"
    }
  }
  ```
</Accordion>

## AIの応答 (Full)

AIの質問への応答。

<Accordion title="属性と例">
  | プロパティ               | 型                               | 必須  | 説明                                   |
  | ------------------- | ------------------------------- | --- | ------------------------------------ |
  | `answer`            | `string`                        | はい  | LLMから提供された回答。                        |
  | `created_at`        | `string`                        | はい  | プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。 |
  | `completion_reason` | `string`                        | いいえ | 応答が終了した理由。                           |
  | `ai_agent_info`     | `リクエストで使用されるモデルおよびプロセッサに関する情報。` | いいえ |                                      |
  | `citations`         | array of `LLMの回答で参照された部分の引用情報`  | いいえ | LLMの回答で参照された部分の引用情報。                 |

  ```json 例 theme={null}
  {
    "answer": "Public APIs are important because of key and important reasons.",
    "created_at": "2012-12-12T10:53:43-08:00",
    "completion_reason": "done",
    "ai_agent_info": {
      "models": [
        {
          "name": "azure__openai__text_embedding_ada_002",
          "provider": "azure",
          "supported_purpose": "embedding"
        }
      ],
      "processor": "basic_text"
    },
    "citations": [
      {
        "content": "Public APIs are key drivers of innovation and growth.",
        "id": "123",
        "type": "file",
        "name": "The importance of public APIs.pdf"
      }
    ]
  }
  ```
</Accordion>

## テキスト生成リクエスト用のAIエージェント

テキストの生成に使用されるAIエージェント。

<Accordion title="属性と例">
  | プロパティ       | 型                      | 必須  | 説明                                                          |
  | ----------- | ---------------------- | --- | ----------------------------------------------------------- |
  | `type`      | `enum<string>`         | はい  | テキストの生成に使用されるAIエージェントのタイプ。 使用可能なオプション: `ai_agent_text_gen`. |
  | `basic_gen` | `AIエージェントの基本テキスト生成ツール` | いいえ |                                                             |

  ```json 例 theme={null}
  {
    "type": "ai_agent_text_gen",
    "basic_gen": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`",
      "embeddings": {
        "model": "azure__openai__text_embedding_ada_002",
        "strategy": {
          "id": "basic",
          "num_tokens_per_chunk": 64
        }
      },
      "content_template": "---{content}---"
    }
  }
  ```
</Accordion>

## 質問リクエスト用のAIエージェント

クエリの処理に使用されるAIエージェント。

<Accordion title="属性と例">
  | プロパティ               | 型                      | 必須  | 説明                                                    |
  | ------------------- | ---------------------- | --- | ----------------------------------------------------- |
  | `type`              | `enum<string>`         | はい  | クエリの処理に使用されるAIエージェントのタイプ。 使用可能なオプション: `ai_agent_ask`. |
  | `long_text`         | `AIエージェントの長いテキストツール`   | いいえ |                                                       |
  | `basic_text`        | `AIエージェントの基本テキストツール`   | いいえ |                                                       |
  | `spreadsheet`       | `AIエージェントのスプレッドシートツール` | いいえ |                                                       |
  | `long_text_multi`   | `AIエージェントの長いテキストツール`   | いいえ |                                                       |
  | `basic_text_multi`  | `AIエージェントの基本テキストツール`   | いいえ |                                                       |
  | `basic_image`       | `AIエージェントの基本テキストツール`   | いいえ |                                                       |
  | `basic_image_multi` | `AIエージェントの基本テキストツール`   | いいえ |                                                       |

  ```json 例 theme={null}
  {
    "type": "ai_agent_ask",
    "long_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
      "embeddings": {
        "model": "azure__openai__text_embedding_ada_002",
        "strategy": {
          "id": "basic",
          "num_tokens_per_chunk": 64
        }
      }
    },
    "basic_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    },
    "spreadsheet": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      }
    },
    "long_text_multi": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
      "embeddings": {
        "model": "azure__openai__text_embedding_ada_002",
        "strategy": {
          "id": "basic",
          "num_tokens_per_chunk": 64
        }
      }
    },
    "basic_text_multi": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    },
    "basic_image": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    },
    "basic_image_multi": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    }
  }
  ```
</Accordion>

## 抽出 (構造化) リクエスト用のAIエージェント

抽出 (構造化) に使用されるAIエージェント。

<Accordion title="属性と例">
  | プロパティ         | 型                    | 必須  | 説明                                                               |
  | ------------- | -------------------- | --- | ---------------------------------------------------------------- |
  | `type`        | `enum<string>`       | はい  | 抽出に使用されるAIエージェントのタイプ。 使用可能なオプション: `ai_agent_extract_structured`. |
  | `long_text`   | `AIエージェントの長いテキストツール` | いいえ |                                                                  |
  | `basic_text`  | `AIエージェントの基本テキストツール` | いいえ |                                                                  |
  | `basic_image` | `AIエージェントの基本テキストツール` | いいえ |                                                                  |

  ```json 例 theme={null}
  {
    "type": "ai_agent_extract_structured",
    "long_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
      "embeddings": {
        "model": "azure__openai__text_embedding_ada_002",
        "strategy": {
          "id": "basic",
          "num_tokens_per_chunk": 64
        }
      }
    },
    "basic_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    },
    "basic_image": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    }
  }
  ```
</Accordion>

## 抽出リクエスト用のAIエージェント

抽出に使用されるAIエージェント。

<Accordion title="属性と例">
  | プロパティ         | 型                    | 必須  | 説明                                                    |
  | ------------- | -------------------- | --- | ----------------------------------------------------- |
  | `type`        | `enum<string>`       | はい  | 抽出に使用されるAIエージェントのタイプ。 使用可能なオプション: `ai_agent_extract`. |
  | `long_text`   | `AIエージェントの長いテキストツール` | いいえ |                                                       |
  | `basic_text`  | `AIエージェントの基本テキストツール` | いいえ |                                                       |
  | `basic_image` | `AIエージェントの基本テキストツール` | いいえ |                                                       |

  ```json 例 theme={null}
  {
    "type": "ai_agent_extract",
    "long_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
      "embeddings": {
        "model": "azure__openai__text_embedding_ada_002",
        "strategy": {
          "id": "basic",
          "num_tokens_per_chunk": 64
        }
      }
    },
    "basic_text": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    },
    "basic_image": {
      "model": "azure__openai__gpt_4o_mini",
      "num_tokens_for_completion": 8400,
      "llm_endpoint_params": {
        "type": "openai_params",
        "temperature": 0,
        "top_p": 1,
        "frequency_penalty": 1.5,
        "presence_penalty": 1.5,
        "stop": "<|im_end|>"
      },
      "system_message": "You are a helpful travel assistant specialized in budget travel",
      "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`."
    }
  }
  ```
</Accordion>
