> ## 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 resources

A set of endpoints used to interact with supported LLMs.

## AI agent for extract requests

The AI agent to be used for extraction.

<Accordion title="Attributes and example">
  | Property      | Type                       | Required | Description                                                                            |
  | ------------- | -------------------------- | -------- | -------------------------------------------------------------------------------------- |
  | `type`        | `enum<string>`             | Yes      | The type of AI agent to be used for extraction. Available options: `ai_agent_extract`. |
  | `long_text`   | `AI agent long text tool`  | No       |                                                                                        |
  | `basic_text`  | `AI agent basic text tool` | No       |                                                                                        |
  | `basic_image` | `AI agent basic text tool` | No       |                                                                                        |

  ```json Example 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>

## AI agent for question requests

The AI agent used to handle queries.

<Accordion title="Attributes and example">
  | Property            | Type                        | Required | Description                                                                     |
  | ------------------- | --------------------------- | -------- | ------------------------------------------------------------------------------- |
  | `type`              | `enum<string>`              | Yes      | The type of AI agent used to handle queries. Available options: `ai_agent_ask`. |
  | `long_text`         | `AI agent long text tool`   | No       |                                                                                 |
  | `basic_text`        | `AI agent basic text tool`  | No       |                                                                                 |
  | `spreadsheet`       | `AI agent spreadsheet tool` | No       |                                                                                 |
  | `long_text_multi`   | `AI agent long text tool`   | No       |                                                                                 |
  | `basic_text_multi`  | `AI agent basic text tool`  | No       |                                                                                 |
  | `basic_image`       | `AI agent basic text tool`  | No       |                                                                                 |
  | `basic_image_multi` | `AI agent basic text tool`  | No       |                                                                                 |

  ```json Example 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 agent for structured extract request

The AI agent to be used for structured extraction.

<Accordion title="Attributes and example">
  | Property      | Type                       | Required | Description                                                                                       |
  | ------------- | -------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
  | `type`        | `enum<string>`             | Yes      | The type of AI agent to be used for extraction. Available options: `ai_agent_extract_structured`. |
  | `long_text`   | `AI agent long text tool`  | No       |                                                                                                   |
  | `basic_text`  | `AI agent basic text tool` | No       |                                                                                                   |
  | `basic_image` | `AI agent basic text tool` | No       |                                                                                                   |

  ```json Example 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 agent for text generation requests

The AI agent used for generating text.

<Accordion title="Attributes and example">
  | Property    | Type                                  | Required | Description                                                                            |
  | ----------- | ------------------------------------- | -------- | -------------------------------------------------------------------------------------- |
  | `type`      | `enum<string>`                        | Yes      | The type of AI agent used for generating text. Available options: `ai_agent_text_gen`. |
  | `basic_gen` | `AI agent basic text generation tool` | No       |                                                                                        |

  ```json Example 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 agent reference

The AI agent used to handle queries.

<Accordion title="Attributes and example">
  | Property | Type           | Required | Description                                                                                                                                                                                                                                                                                 |
  | -------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `type`   | `enum<string>` | Yes      | The type of AI agent used to handle queries. Available options: `ai_agent_id`.                                                                                                                                                                                                              |
  | `id`     | `string`       | Yes      | The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`) or a unique identifier for pre-built agents (for example, `enhanced_extract_agent` for the [Enhanced Extract Agent](/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)). |

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

## AI extract response

AI extract response. The content of this response may vary depending on the requested configuration.

<Accordion title="Attributes and example">
  ```json Example theme={null}
  {}
  ```
</Accordion>

## AI extract structured response

AI extract structured response.

<Accordion title="Attributes and example">
  | Property            | Type                                                                | Required | Description                                                                                                                                     |
  | ------------------- | ------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
  | `answer`            | [AI extract response](#ai-extract-response)                         | Yes      |                                                                                                                                                 |
  | `created_at`        | `string`                                                            | Yes      | The ISO date formatted timestamp of when the answer to the prompt was created.                                                                  |
  | `completion_reason` | `string`                                                            | No       | The reason the response finishes.                                                                                                               |
  | `confidence_score`  | `object`                                                            | No       | The confidence score levels and numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted. |
  | `reference`         | `object`                                                            | No       | The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.                                  |
  | `ai_agent_info`     | `The information on the models and processors used in the request.` | No       |                                                                                                                                                 |

  ```json Example 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 response

AI response.

<Accordion title="Attributes and example">
  | Property            | Type                                                                | Required | Description                                                                    |
  | ------------------- | ------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------ |
  | `answer`            | `string`                                                            | Yes      | The answer provided by the LLM.                                                |
  | `created_at`        | `string`                                                            | Yes      | The ISO date formatted timestamp of when the answer to the prompt was created. |
  | `completion_reason` | `string`                                                            | No       | The reason the response finishes.                                              |
  | `ai_agent_info`     | `The information on the models and processors used in the request.` | No       |                                                                                |

  ```json Example 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 response (Full)

AI ask response.

<Accordion title="Attributes and example">
  | Property            | Type                                                                | Required | Description                                                                    |
  | ------------------- | ------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------ |
  | `answer`            | `string`                                                            | Yes      | The answer provided by the LLM.                                                |
  | `created_at`        | `string`                                                            | Yes      | The ISO date formatted timestamp of when the answer to the prompt was created. |
  | `completion_reason` | `string`                                                            | No       | The reason the response finishes.                                              |
  | `ai_agent_info`     | `The information on the models and processors used in the request.` | No       |                                                                                |
  | `citations`         | array of `The citation of the LLM's answer reference`               | No       | The citations of the LLM's answer reference.                                   |

  ```json Example 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>
