From 74e21fd3afd584b0e19f42c81d1b07fe409044ca Mon Sep 17 00:00:00 2001 From: Barbara Czyz Date: Mon, 30 Sep 2024 17:56:27 +0200 Subject: [PATCH] rendering tests --- openapi.json | 1769 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1718 insertions(+), 51 deletions(-) diff --git a/openapi.json b/openapi.json index 1ed86ac9..b412f81d 100644 --- a/openapi.json +++ b/openapi.json @@ -14,7 +14,7 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" }, "version": "2.0.0", - "x-box-commit-hash": "0e9e8c969a" + "x-box-commit-hash": "" }, "servers": [ { @@ -3415,7 +3415,7 @@ } }, "400": { - "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for a for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", + "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", "content": { "application/json": { "schema": { @@ -3810,7 +3810,7 @@ } }, "400": { - "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for a for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", + "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", "content": { "application/json": { "schema": { @@ -4184,7 +4184,7 @@ } }, "400": { - "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for a for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", + "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", "content": { "application/json": { "schema": { @@ -6593,7 +6593,7 @@ } }, "400": { - "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for a for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", + "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", "content": { "application/json": { "schema": { @@ -17355,7 +17355,7 @@ "description": "Returns an empty response when the card has been successfully updated." }, "400": { - "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for a for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", + "description": "Returns an error when the request body is not valid.\n\n* `schema_validation_failed` - The request body contains a value for\na field that either does not exist, or for which the value or type does\nnot match the expected field type. An example might be an unknown option\nfor an `enum` or `multiSelect` field.", "content": { "application/json": { "schema": { @@ -24039,7 +24039,8 @@ "/ai/ask": { "post": { "operationId": "post_ai_ask", - "summary": "Send AI question request", + "summary": "Ask question", + "x-stability-level": "beta", "tags": [ "AI" ], @@ -24092,13 +24093,14 @@ "/ai/text_gen": { "post": { "operationId": "post_ai_text_gen", - "summary": "Send AI request to generate text", + "summary": "Generate text", + "x-stability-level": "beta", "tags": [ "AI" ], "x-box-tag": "ai", "x-box-enable-explorer": false, - "description": "Sends an AI request to supported LLMs and returns an answer specifically focused on the creation of new text.", + "description": "Sends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.", "requestBody": { "content": { "application/json": { @@ -24146,6 +24148,7 @@ "get": { "operationId": "get_ai_agent_default", "summary": "Get AI agent default configuration", + "x-stability-level": "beta", "tags": [ "AI" ], @@ -24163,7 +24166,9 @@ "type": "string", "enum": [ "ask", - "text_gen" + "text_gen", + "extract", + "extract_structured" ] } }, @@ -24190,7 +24195,7 @@ ], "responses": { "200": { - "description": "A successful response including the default agent configuration.\nThis response can be one of the following two objects:\nAI agent for questions and AI agent for text generation. The response\ndepends on the agent configuration requested in this endpoint.", + "description": "A successful response including the default agent configuration.\nThis response can be one of the following four objects:\n* AI agent for questions\n* AI agent for text generation\n* AI agent for freeform metadata extraction\n* AI agent for structured metadata extraction.\nThe response depends on the agent configuration requested in this endpoint.", "content": { "application/json": { "schema": { @@ -24200,6 +24205,12 @@ }, { "$ref": "#/components/schemas/AiAgentTextGen" + }, + { + "$ref": "#/components/schemas/AiAgentExtract" + }, + { + "$ref": "#/components/schemas/AiAgentExtractStructured" } ] } @@ -24228,6 +24239,803 @@ } } } + }, + "/ai/extract": { + "post": { + "operationId": "post_ai_extract", + "summary": "Extract metadata (freeform)", + "x-stability-level": "beta", + "tags": [ + "AI" + ], + "x-box-tag": "ai", + "x-box-enable-explorer": false, + "description": "Sends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs.\nFreeform metadata extraction does not require any metadata template setup before sending the request.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiExtract" + } + } + } + }, + "responses": { + "200": { + "description": "A response including the answer from the LLM.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiResponse" + } + } + } + }, + "400": { + "description": "An unexpected client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "500": { + "description": "An unexpected server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/ai/extract_structured": { + "post": { + "operationId": "post_ai_extract_structured", + "summary": "Extract metadata (structured)", + "x-stability-level": "beta", + "tags": [ + "AI" + ], + "x-box-tag": "ai", + "x-box-enable-explorer": false, + "description": "Sends an AI request to supported Large Language Models (LLMs) and returns extracted metadata as a set of key-value pairs.\nFor this request, you need to use an already defined metadata template or a define a schema yourself.\nTo learn more about creating templates, see [Creating metadata templates in the Admin Console](https://support.box.com/hc/en-us/articles/360044194033-Customizing-Metadata-Templates)\nor use the [metadata template API](g://metadata/templates/create).", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiExtractStructured" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response including the answer from the LLM.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiExtractResponse" + } + } + } + }, + "400": { + "description": "An unexpected client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "500": { + "description": "An unexpected server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_templates": { + "post": { + "operationId": "post_docgen_templates", + "summary": "Add file with docgen template", + "tags": [ + "Docgen Template" + ], + "x-box-tag": "docgen_template", + "description": "Creates a Docgen template", + "requestBody": { + "description": "Docgen entity object to be marked as Docgen template", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenTemplateCreateRequest" + } + } + } + }, + "responses": { + "201": { + "description": "The file which has now been marked as a Docgen template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenTemplate--Base" + } + } + } + }, + "400": { + "description": "The server cannot or will not process the request due to an apparent client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + }, + "get": { + "operationId": "get_docgen_templates", + "summary": "List docgen templates", + "tags": [ + "Docgen Template" + ], + "x-box-tag": "docgen_template", + "description": "Lists docgen templates created by a user.", + "parameters": [ + { + "name": "marker", + "description": "Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.", + "in": "query", + "required": false, + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "description": "The maximum number of items to return per page.", + "in": "query", + "required": false, + "example": 1000, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 1000 + } + } + ], + "responses": { + "200": { + "description": "Returns a collection of templates.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenTemplates" + } + } + } + }, + "401": { + "description": "Returned when the access token provided in the `Authorization` header\nis not recognized or not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_templates/{template_id}": { + "delete": { + "operationId": "delete_docgen_templates_id", + "summary": "Delete file as docgen template", + "tags": [ + "Docgen Template" + ], + "x-box-tag": "docgen_template", + "description": "Unmarks file as Docgen template", + "parameters": [ + { + "name": "template_id", + "in": "path", + "description": "Id of file which will be unmarked as a docgen template", + "required": true, + "schema": { + "type": "string" + }, + "example": "123" + } + ], + "responses": { + "204": { + "description": "Returns an empty response when the docgen template has been deleted." + }, + "400": { + "description": "The server cannot or will not process the request due to an apparent client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "404": { + "description": "Returned if the template is not found or the user does not\nhave access to the associated template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + }, + "get": { + "operationId": "get_docgen_templates_id", + "summary": "Get docgen template by id.", + "tags": [ + "Docgen Template" + ], + "x-box-tag": "docgen_template", + "description": "Lists details of a specific docgen template.", + "parameters": [ + { + "name": "template_id", + "description": "The ID of a docgen template.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "example": 123 + } + ], + "responses": { + "200": { + "description": "Returns details of a template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenTemplate" + } + } + } + }, + "401": { + "description": "Returned when the access token provided in the `Authorization` header\nis not recognized or not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "404": { + "description": "Returned if the template is not found or the user does not\nhave access to the associated template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected client error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_jobs/{job_id}": { + "get": { + "operationId": "get_docgen_jobs_id", + "summary": "Get docgen job by id", + "tags": [ + "Docgen" + ], + "x-box-tag": "docgen", + "description": "List status of job.", + "parameters": [ + { + "name": "job_id", + "in": "path", + "required": true, + "description": "Document generation job id.", + "schema": { + "type": "string" + }, + "example": 123 + } + ], + "responses": { + "200": { + "description": "Status of the document generation job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenJob" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "404": { + "description": "Returned if the job is not found or the user does not\nhave access to the associated job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_jobs": { + "get": { + "operationId": "get_docgen_jobs", + "summary": "List all docgen jobs", + "tags": [ + "Docgen" + ], + "x-box-tag": "docgen", + "description": "List of all document generation jobs for a user.", + "parameters": [ + { + "name": "marker", + "description": "Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.", + "in": "query", + "required": false, + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "description": "The maximum number of items to return per page.", + "in": "query", + "required": false, + "example": 1000, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 1000 + } + } + ], + "responses": { + "200": { + "description": "A list of document generation jobs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenJobs--Full" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/v2/docgen_template_jobs/{template_id}": { + "get": { + "operationId": "get_docgen_template_jobs_id", + "summary": "Get list of all docgen jobs for template.", + "tags": [ + "Docgen Template" + ], + "x-box-tag": "docgen_template", + "description": "Lists details of a document generation template including associated jobs list for a user", + "parameters": [ + { + "name": "template_id", + "in": "path", + "description": "Id of template to fetch jobs for", + "required": true, + "schema": { + "type": "string" + }, + "example": 123 + }, + { + "name": "marker", + "description": "Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.", + "in": "query", + "required": false, + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "description": "The maximum number of items to return per page.", + "in": "query", + "required": false, + "example": 1000, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 1000 + } + } + ], + "responses": { + "200": { + "description": "A single document generation template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenJobs" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "404": { + "description": "Returned if the template is not found or the user does not\nhave access to the associated template.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_batch_jobs/{batch_id}": { + "get": { + "operationId": "get_docgen_batch_jobs_id", + "summary": "Get docgen jobs for batch id", + "tags": [ + "Docgen" + ], + "x-box-tag": "docgen", + "description": "List docgen jobs in a batch", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Document generation batch id.", + "example": 123 + }, + { + "name": "marker", + "description": "Defines the position marker at which to begin returning results. This is\nused when paginating using marker-based pagination.\n\nThis requires `usemarker` to be set to `true`.", + "in": "query", + "required": false, + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "description": "The maximum number of items to return per page.", + "in": "query", + "required": false, + "example": 1000, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 1000 + } + } + ], + "responses": { + "200": { + "description": "List of docgen jobs in to a docgen batch", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenJobs" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "404": { + "description": "Returned if the batch is not found or the user does not\nhave access to the associated batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } + }, + "/docgen_batches": { + "post": { + "operationId": "post_docgen_batches", + "summary": "Create document using template", + "tags": [ + "Docgen" + ], + "x-box-tag": "docgen", + "description": "API to submit document generation jobs.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenBatchCreateRequest" + } + } + } + }, + "responses": { + "202": { + "description": "The created Batch ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocgenBatch--Base" + } + } + } + }, + "403": { + "description": "The client does not have access rights to the content or resource requested.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "429": { + "description": "The user has sent too many requests in a given amount of time.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, + "default": { + "description": "An unexpected condition was encountered on the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + } + } + } } }, "components": { @@ -24286,32 +25094,7 @@ "maxItems": 25, "uniqueItems": true, "items": { - "type": "object", - "description": "The item to be processed by the LLM.", - "required": [ - "id", - "type" - ], - "properties": { - "id": { - "type": "string", - "description": "The id of the item.", - "example": "123" - }, - "type": { - "type": "string", - "description": "The type of the item.", - "enum": [ - "file" - ], - "example": "file" - }, - "content": { - "type": "string", - "description": "The content of the item, often the text representation.", - "example": "This is file content." - } - } + "$ref": "#/components/schemas/AiItem--Base" } }, "dialogue_history": { @@ -24394,6 +25177,150 @@ }, "description": "AI text gen request object" }, + "AiExtractStructured": { + "title": "AI Extract Structured Request", + "type": "object", + "x-box-tag": "ai", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "The items to be processed by the LLM. Currently you can use files only.", + "minItems": 1, + "maxItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/components/schemas/AiItem--Base" + } + }, + "metadata_template": { + "type": "object", + "description": "The metadata template containing the fields to extract.\nFor your request to work, you must provide either `metadata_template` or `fields`, but not both.", + "properties": { + "template_key": { + "type": "string", + "description": "The name of the metadata template.", + "example": "invoiceTemplate" + }, + "type": { + "type": "string", + "enum": [ + "metadata_template" + ], + "description": "Value is always `metadata_template`.", + "example": "metadata_template" + }, + "scope": { + "type": "string", + "description": "The scope of the metadata template that can either be global or\nenterprise. \n* The **global** scope is used for templates that are\navailable to any Box enterprise. \n* The **enterprise** scope represents templates created within a specific enterprise,\n containing the ID of that enterprise.", + "example": "enterprise_12345", + "maxLength": 40 + } + } + }, + "fields": { + "type": "array", + "description": "The fields to be extracted from the provided items.\nFor your request to work, you must provide either `metadata_template` or `fields`, but not both.", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "description": "The fields to be extracted from the provided items.", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique identifier for the field.", + "example": "name" + }, + "description": { + "type": "string", + "description": "A description of the field.", + "example": "The name of the person." + }, + "displayName": { + "type": "string", + "description": "The display name of the field.", + "example": "Name" + }, + "prompt": { + "type": "string", + "description": "The context about the key that may include how to find and format it.", + "example": "Name is the first and last name from the email address" + }, + "type": { + "type": "string", + "description": "The type of the field. It include but is not limited to string, float, date, enum, and multiSelect.", + "example": "enum" + }, + "options": { + "type": "array", + "description": "A list of options for this field. This is most often used in combination with the enum and multiSelect field types.", + "items": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique identifier for the field.", + "example": "First Name" + } + } + }, + "example": [ + { + "key": "First Name" + }, + { + "key": "Last Name" + } + ] + } + } + } + }, + "ai_agent": { + "$ref": "#/components/schemas/AiAgentExtractStructured" + } + }, + "description": "AI Extract Structured Request object." + }, + "AiExtract": { + "title": "AI metadata freeform extraction request", + "type": "object", + "x-box-tag": "ai", + "required": [ + "prompt", + "items" + ], + "properties": { + "prompt": { + "type": "string", + "description": "The prompt provided to a Large Language Model (LLM) in the request. The prompt can be up to 10000 characters long and it can be an XML or a JSON schema.", + "example": "\\\"fields\\\":[{\\\"type\\\":\\\"string\\\",\\\"key\\\":\\\"name\\\",\\\"displayName\\\":\\\"Name\\\",\\\"description\\\":\\\"The customer name\\\",\\\"prompt\\\":\\\"Name is always the first word in the document\\\"},{\\\"type\\\":\\\"date\\\",\\\"key\\\":\\\"last_contacted_at\\\",\\\"displayName\\\":\\\"Last Contacted At\\\",\\\"description\\\":\\\"When this customer was last contacted at\\\"}]" + }, + "items": { + "type": "array", + "description": "The items that LLM will process. Currently, you can use files only.", + "minItems": 1, + "maxItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/components/schemas/AiItem--Base" + } + }, + "ai_agent": { + "$ref": "#/components/schemas/AiAgentExtract" + } + }, + "description": "AI metadata freeform extraction request object" + }, "PostOAuth2Token": { "title": "Token request", "type": "object", @@ -24840,6 +25767,174 @@ } ] }, + "DocgenTemplateCreateRequest": { + "title": "Marking file as Docgen Template", + "type": "object", + "description": "The schema for marking document as Docgen Template.", + "required": [ + "file" + ], + "properties": { + "file": { + "allOf": [ + { + "title": "File reference", + "type": "object", + "description": "File reference", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "description": "`file`", + "example": "file", + "enum": [ + "file" + ], + "nullable": false + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + { + "description": "Enable the file to create a docgen document from." + } + ] + } + } + }, + "DocgenBatchCreateRequest": { + "title": "Create batch request", + "type": "object", + "description": "The schema for Docgen Document Generation post job request.", + "required": [ + "file", + "input_source", + "destination_folder", + "output_type", + "document_generation_data" + ], + "properties": { + "file": { + "allOf": [ + { + "title": "File reference", + "type": "object", + "description": "File reference", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "description": "`file`", + "example": "file", + "enum": [ + "file" + ], + "nullable": false + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + { + "description": "Template file." + } + ] + }, + "file_version": { + "allOf": [ + { + "$ref": "#/components/schemas/FileVersion--Base" + }, + { + "description": "File version of a template." + } + ] + }, + "input_source": { + "type": "string", + "description": "source of input.", + "example": "api" + }, + "destination_folder": { + "allOf": [ + { + "title": "Folder reference", + "type": "object", + "description": "Folder reference", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "description": "`folder`", + "example": "folder", + "enum": [ + "folder" + ], + "nullable": false + }, + "id": { + "description": "ID of the folder", + "type": "string", + "example": "42037322" + } + } + }, + { + "description": "Destination folder for generated files." + } + ] + }, + "output_type": { + "type": "string", + "description": "Type of the output file.", + "example": "docx" + }, + "document_generation_data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DocgenDocumentGenerationData" + } + } + } + }, + "DocgenDocumentGenerationData": { + "title": "Document generation data", + "type": "object", + "description": "The schema for Docgen Document Generation post job request.", + "required": [ + "generated_file_name", + "user_input" + ], + "properties": { + "generated_file_name": { + "type": "string", + "example": "New_Template", + "description": "File name of the output file" + }, + "user_input": { + "type": "object", + "example": { + "name": "Aaron Levie" + } + } + } + }, "IntegrationMappingSlackCreateRequest": { "title": "Create Slack integration mapping request", "type": "object", @@ -25479,6 +26574,13 @@ ], "description": "AI ask response" }, + "AiExtractResponse": { + "title": "AI extract response", + "type": "object", + "x-box-resource-id": "ai_extract_response", + "x-box-tag": "ai", + "description": "AI extract response.\nThe content of this response may vary depending on\nthe requested configuration." + }, "AiAgentAsk": { "title": "AI agent for question requests", "type": "object", @@ -25536,11 +26638,65 @@ }, "description": "The AI agent used for generating text." }, + "AiAgentExtract": { + "title": "AI agent for extract requests", + "type": "object", + "x-box-tag": "ai", + "x-box-resource-id": "ai_agent_extract", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ai_agent_extract" + ], + "description": "The type of AI agent to be used for extraction.", + "example": "ai_agent_extract", + "nullable": false + }, + "long_text": { + "$ref": "#/components/schemas/AiAgentLongTextTool" + }, + "basic_text": { + "$ref": "#/components/schemas/AiAgentBasicTextTool" + } + }, + "description": "The AI agent to be used for extraction." + }, + "AiAgentExtractStructured": { + "title": "AI agent for structured extract request", + "type": "object", + "x-box-tag": "ai", + "x-box-resource-id": "ai_agent_extract_structured", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ai_agent_extract_structured" + ], + "description": "The type of AI agent to be used for extraction.", + "example": "ai_agent_extract_structured", + "nullable": false + }, + "long_text": { + "$ref": "#/components/schemas/AiAgentLongTextTool" + }, + "basic_text": { + "$ref": "#/components/schemas/AiAgentBasicTextTool" + } + }, + "description": "The AI agent to be used for structured extraction." + }, "AppItem": { "title": "App item", "type": "object", "x-box-tag": "app_item_associations", - "x-box-resource-id": "app_item_associations", + "x-box-resource-id": "app_item", "description": "An app item represents an content object owned by an application. It can\ngroup files and folders together from different paths. That set can be shared\nvia a collaboration.", "required": [ "id", @@ -37474,6 +38630,507 @@ } ] }, + "DocgenBatch--Base": { + "title": "Docgen Batch (Base)", + "type": "object", + "x-box-resource-id": "docgen_batch--base", + "x-box-tag": "files", + "x-box-variants": [ + "base", + "standard" + ], + "x-box-variant": "base", + "description": "The bare basic representation of a docgen batch", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "nullable": false, + "description": "The unique identifier that represent a batch.", + "example": "12345" + }, + "type": { + "type": "string", + "description": "`docgen_batch`", + "example": "docgen_batch", + "enum": [ + "docgen_batch" + ], + "nullable": false + } + } + }, + "DocgenJob": { + "title": "Docgen batch job", + "type": "object", + "description": "The schema is used in get Document Generation Batch jobs", + "x-box-resource-id": "docgen_job", + "x-box-tag": "docgen", + "required": [ + "id", + "batch", + "template_file", + "template_file_version", + "status", + "output_type" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DocgenJob--Base" + }, + { + "properties": { + "batch": { + "allOf": [ + { + "$ref": "#/components/schemas/DocgenBatch--Base" + }, + { + "description": "Docgen Batch that job belongs to." + } + ] + }, + "template_file": { + "allOf": [ + { + "title": "File reference", + "type": "object", + "description": "File reference", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "description": "`file`", + "example": "file", + "enum": [ + "file" + ], + "nullable": false + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + { + "description": "Docgen template used in the job." + } + ] + }, + "template_file_version": { + "allOf": [ + { + "$ref": "#/components/schemas/FileVersion--Base" + }, + { + "description": "File version of a template." + } + ] + }, + "output_file": { + "nullable": true, + "description": "The output file of the job.", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "`file`", + "example": "file", + "enum": [ + "file" + ] + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + "output_file_version": { + "nullable": true, + "description": "File version of generated file.", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "`file_version`", + "example": "file_version", + "enum": [ + "file_version" + ] + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + "status": { + "type": "string", + "description": "Status of the job.", + "enum": [ + "submitted", + "completed", + "failed", + "completed_with_error", + "pending" + ], + "example": "completed" + }, + "output_type": { + "type": "string", + "description": "Type of the generated file.", + "example": "docx" + } + } + } + ] + }, + "DocgenJob--Base": { + "title": "Docgen batch job (Base)", + "type": "object", + "x-box-resource-id": "docgen_job--base", + "x-box-tag": "docgen", + "x-box-variants": [ + "base", + "standard", + "full" + ], + "x-box-variant": "base", + "description": "The bare basic representation of a docgen job", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "nullable": false, + "description": "The unique identifier that represent a docgen job.", + "example": "12345" + }, + "type": { + "type": "string", + "description": "`docgen_job`", + "example": "docgen_job", + "enum": [ + "docgen_job" + ], + "nullable": false + } + } + }, + "DocgenJob--Full": { + "title": "Docgen batch job (Full)", + "description": "The schema is to get a job", + "type": "object", + "x-box-resource-id": "docgen_job--full", + "x-box-tag": "docgen", + "required": [ + "id", + "batch", + "created_by", + "enterprise", + "template_file", + "template_file_version", + "output_type", + "source", + "user_input", + "status" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DocgenJob" + }, + { + "properties": { + "created_at": { + "type": "string", + "readOnly": true, + "description": "Time of creation.", + "example": "2022-05-11T10:56:11-07:00" + }, + "created_by": { + "allOf": [ + { + "$ref": "#/components/schemas/User--Base" + }, + { + "description": "User who created the job" + } + ] + }, + "enterprise": { + "allOf": [ + { + "$ref": "#/components/schemas/Enterprise--Base" + }, + { + "description": "Id of enterprise" + } + ] + }, + "source": { + "type": "string", + "readOnly": true, + "description": "Source of the request.", + "example": "api" + }, + "user_input": { + "type": "object", + "description": "User details to fill tags.", + "readOnly": true, + "example": { + "name": "Aaron Levie" + } + } + } + } + ] + }, + "DocgenJobs": { + "title": "Docgen batch jobs", + "type": "object", + "description": "The schema for a list of jobs, used for get template jobs and get batch jobs", + "x-box-tag": "docgen", + "x-box-resource-id": "docgen_jobs", + "allOf": [ + { + "type": "object", + "description": "The part of an API response that describes marker\nbased pagination", + "properties": { + "limit": { + "description": "The limit that was used for these entries. This will be the same as the\n`limit` query parameter unless that value exceeded the maximum value\nallowed. The maximum value varies by API.", + "example": 1000, + "type": "integer", + "format": "int64" + }, + "next_marker": { + "description": "The marker for the start of the next page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "type": "string", + "nullable": true + }, + "prev_marker": { + "description": "The marker for the start of the previous page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih", + "type": "string", + "nullable": true + } + } + }, + { + "properties": { + "entries": { + "type": "array", + "description": "List of jobs.", + "items": { + "$ref": "#/components/schemas/DocgenJob" + } + } + } + } + ] + }, + "DocgenJobs--Full": { + "title": "Docgen jobs", + "type": "object", + "description": "The schema is for a more details list of jobs used for get Jobs for user", + "x-box-tag": "docgen", + "x-box-resource-id": "docgen_jobs--full", + "allOf": [ + { + "type": "object", + "description": "The part of an API response that describes marker\nbased pagination", + "properties": { + "limit": { + "description": "The limit that was used for these entries. This will be the same as the\n`limit` query parameter unless that value exceeded the maximum value\nallowed. The maximum value varies by API.", + "example": 1000, + "type": "integer", + "format": "int64" + }, + "next_marker": { + "description": "The marker for the start of the next page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "type": "string", + "nullable": true + }, + "prev_marker": { + "description": "The marker for the start of the previous page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih", + "type": "string", + "nullable": true + } + } + }, + { + "properties": { + "entries": { + "type": "array", + "description": "List of jobs.", + "items": { + "$ref": "#/components/schemas/DocgenJob--Full" + } + } + } + } + ] + }, + "DocgenTemplate--Base": { + "title": "Docgen Template (Base)", + "type": "object", + "x-box-resource-id": "docgen_template--base", + "x-box-variants": [ + "base", + "standard" + ], + "x-box-variant": "base", + "description": "A base representation of a docgen template, used when\nnested within another resource.", + "properties": { + "file": { + "allOf": [ + { + "title": "File reference", + "type": "object", + "description": "File reference", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "description": "`file`", + "example": "file", + "enum": [ + "file" + ], + "nullable": false + }, + "id": { + "description": "ID of the object", + "type": "string", + "example": "42037322" + } + } + }, + { + "description": "Enable the file to generate a document from." + } + ] + } + } + }, + "DocgenTemplate": { + "title": "Docgen template", + "type": "object", + "description": "A docgen template object", + "x-box-tag": "docgen_template", + "x-box-resource-id": "docgen_template", + "x-box-variant": "standard", + "allOf": [ + { + "$ref": "#/components/schemas/DocgenTemplate--Base" + }, + { + "properties": { + "file_name": { + "type": "string", + "nullable": true, + "example": "Official contract", + "description": "The name of the template" + } + } + } + ] + }, + "DocgenTemplates": { + "title": "Docgen templates", + "type": "object", + "description": "List of docgen templates.", + "x-box-tag": "docgen_template", + "x-box-resource-id": "docgen_templates", + "allOf": [ + { + "type": "object", + "description": "The part of an API response that describes marker\nbased pagination", + "properties": { + "limit": { + "description": "The limit that was used for these entries. This will be the same as the\n`limit` query parameter unless that value exceeded the maximum value\nallowed. The maximum value varies by API.", + "example": 1000, + "type": "integer", + "format": "int64" + }, + "next_marker": { + "description": "The marker for the start of the next page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii", + "type": "string", + "nullable": true + }, + "prev_marker": { + "description": "The marker for the start of the previous page of results.", + "example": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih", + "type": "string", + "nullable": true + } + } + }, + { + "properties": { + "entries": { + "type": "array", + "description": "A list of templates.", + "items": { + "$ref": "#/components/schemas/DocgenTemplate" + } + } + } + } + ] + }, + "AiItem--Base": { + "title": "AI Item (Base)", + "type": "object", + "required": [ + "id", + "type" + ], + "x-box-variants": [ + "base" + ], + "x-box-variant": "base", + "description": "The item to be processed by the LLM.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the file.", + "example": "123" + }, + "type": { + "type": "string", + "description": "The type of the item. Currently the value can be `file` only.", + "enum": [ + "file" + ], + "example": "file" + }, + "content": { + "type": "string", + "description": "The content of the item, often the text representation.", + "example": "This is file content." + } + } + }, "AiAgentBasicTextToolBase": { "title": "AI agent basic text tool", "type": "object", @@ -37481,7 +39138,7 @@ "properties": { "model": { "type": "string", - "description": "The model used for the AI Agent for basic text. For specific model values, see the [available models list](g://box-ai/supported-models).", + "description": "The model used for the AI agent for basic text. For specific model values, see the [available models list](g://box-ai/supported-models).", "example": "azure__openai__gpt_3_5_turbo_16k" }, "num_tokens_for_completion": { @@ -37521,8 +39178,8 @@ }, "prompt_template": { "type": "string", - "description": "The prompt template contains contextual information of the request and the user prompt.\n\nWhen passing `prompt_template` parameters, you **must include** inputs for `{user_question}` and `{content}`.\n\nInput for `{current_date}` is optional, depending on the use.", - "example": "It is `{current_date}`, consider these travel options `{content}` and answer `{user_question}`", + "description": "The prompt template contains contextual information of the request and the user prompt.\nWhen passing `prompt_template` parameters, you **must include** inputs for `{user_question}` and `{content}`.\n`{current_date}` is optional, depending on the use.", + "example": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.", "maxLength": 10000, "pattern": "(\\{user_question\\}[\\s\\S]*?\\{content\\}|\\{content\\}[\\s\\S]*?\\{user_question\\})" } @@ -37543,7 +39200,7 @@ "properties": { "system_message": { "type": "string", - "description": "System messages try to help the LLM \"understand\" its role and what it is supposed to do.\nInput for `{current_date}` is optional, depending on the use.", + "description": "System messages aim at helping the LLM understand its role and what it is supposed to do.\nThe input for `{current_date}` is optional, depending on the use.", "example": "You are a helpful travel assistant specialized in budget travel" }, "prompt_template": { @@ -37575,14 +39232,14 @@ "model": { "type": "string", "example": "openai__text_embedding_ada_002", - "description": "The model used for the AI Agent for calculating embeddings." + "description": "The model used for the AI agent for calculating embeddings." }, "strategy": { "type": "object", "properties": { "id": { "type": "string", - "description": "The strategy used for the AI Agent for calculating embeddings.", + "description": "The strategy used for the AI agent for calculating embeddings.", "example": "basic" }, "num_tokens_per_chunk": { @@ -37616,14 +39273,14 @@ "model": { "type": "string", "example": "openai__text_embedding_ada_002", - "description": "The model used for the AI Agent for calculating embeddings." + "description": "The model used for the AI agent for calculating embeddings." }, "strategy": { "type": "object", "properties": { "id": { "type": "string", - "description": "The strategy used for the AI Agent for calculating embeddings.", + "description": "The strategy used for the AI agent for calculating embeddings.", "example": "basic" }, "num_tokens_per_chunk": { @@ -37658,7 +39315,7 @@ } } ], - "description": "AI agent basic tool used to generate text." + "description": "AI agent basic tool used to generate text. " }, "AiLlmEndpointParamsGoogle": { "title": "AI LLM endpoint params Google", @@ -37679,7 +39336,7 @@ }, "temperature": { "type": "number", - "description": "The temperature is used for sampling during response generation, which occurs when `top-P` and `top-K` are applied. \nTemperature controls the degree of randomness in token selection.", + "description": "The temperature is used for sampling during response generation, which occurs when `top-P` and `top-K` are applied. Temperature controls the degree of randomness in the token selection.", "example": 0, "minimum": 0, "maximum": 2, @@ -37687,7 +39344,7 @@ }, "top_p": { "type": "number", - "description": "`Top-P` changes how the model selects tokens for output. Tokens are selected from the most (see `top-K`) to least probable\nuntil the sum of their probabilities equals the `top-P` value.", + "description": "`Top-P` changes how the model selects tokens for output. Tokens are selected from the most (see `top-K`) to least probable until the sum of their probabilities equals the `top-P` value.", "example": 1, "minimum": 0.1, "maximum": 2, @@ -37739,7 +39396,7 @@ }, "frequency_penalty": { "type": "number", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the \ntext so far, decreasing the model's likelihood to repeat the same line verbatim.", + "description": "A number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the \ntext so far, decreasing the model's likelihood to repeat the same line verbatim.", "minimum": -2, "maximum": 2, "example": 1.5, @@ -37747,7 +39404,7 @@ }, "presence_penalty": { "type": "number", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, \nincreasing the model's likelihood to talk about new topics.", + "description": "A number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.", "minimum": -2, "maximum": 2, "example": 1.5, @@ -39284,6 +40941,16 @@ "description": "Device pinners allow enterprises to\ncontrol what devices can use\nnative Box applications.", "x-box-tag": "device_pinners" }, + { + "name": "Docgen", + "description": "Docgen are used to generate documents\nusing a template.", + "x-box-tag": "docgen" + }, + { + "name": "Docgen template", + "description": "Docgen are used to generate documents\nusing a template.", + "x-box-tag": "docgen_template" + }, { "name": "Domain restrictions (User exemptions)", "description": "A set of endpoints that allow exempting users\nfrom restrictions imposed by the list of\nallowed collaboration domains for a specific enterprise.",