From 39825a20b8636f8fc2bd4f9bed9c6ffec83af79d Mon Sep 17 00:00:00 2001 From: box-apimgmt Date: Mon, 3 Feb 2025 09:57:21 -0800 Subject: [PATCH] feat: add hubs support to /ai/ask --- openapi.json | 37 +++++++++++++++++++++++-- openapi/openapi-v2025.0.json | 52 +++++++++++++++++++++++++++++++++++- openapi/openapi.json | 37 +++++++++++++++++++++++-- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/openapi.json b/openapi.json index 0bfc497d..d74e8945 100644 --- a/openapi.json +++ b/openapi.json @@ -14,7 +14,7 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" }, "version": "2024.0", - "x-box-commit-hash": "0346d978be" + "x-box-commit-hash": "0432ad6b27" }, "servers": [ { @@ -24192,6 +24192,9 @@ } } }, + "204": { + "description": "No content is available to answer the question. This is returned when the request item is a hub, but content in the hubs is not indexed. To ensure content in the hub is indexed, make sure Box AI for Hubs in the Admin Console was enabled before hub creation." + }, "500": { "description": "An unexpected server error.", "content": { @@ -24892,7 +24895,7 @@ "description": "The items to be processed by the LLM, often files.\n\n**Note**: Box AI handles documents with text representations up to 1MB in size, or a maximum of 25 files, whichever comes first.\nIf the file size exceeds 1MB, the first 1MB of text representation will be processed.\nIf you set `mode` parameter to `single_item_qa`, the `items` array can have one element only. ", "type": "array", "items": { - "$ref": "#/components/schemas/AiItem--Base" + "$ref": "#/components/schemas/AiItemAsk" }, "maxItems": 25, "minItems": 1, @@ -25189,6 +25192,36 @@ "base" ] }, + "AiItemAsk": { + "description": "The item to be processed by the LLM for ask requests.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the file.", + "type": "string", + "example": "123" + }, + "type": { + "description": "The type of the item. A `hubs` item must be used as a single item.", + "type": "string", + "example": "file", + "enum": [ + "file", + "hubs" + ] + }, + "content": { + "description": "The content of the item, often the text representation.", + "example": "This is file content.", + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "AI Item Ask" + }, "AiLlmEndpointParamsAWS": { "description": "AI LLM endpoint params AWS object", "type": "object", diff --git a/openapi/openapi-v2025.0.json b/openapi/openapi-v2025.0.json index 9cd9f01e..506df732 100644 --- a/openapi/openapi-v2025.0.json +++ b/openapi/openapi-v2025.0.json @@ -14,7 +14,7 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" }, "version": "2025.0", - "x-box-commit-hash": "0346d978be" + "x-box-commit-hash": "0432ad6b27" }, "servers": [ { @@ -143,6 +143,16 @@ } } }, + "400": { + "description": "Returned if the user has passed in a malformed marker or limit value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, "401": { "description": "Returned when the access token provided in the `Authorization` header\nis not recognized or not provided.", "content": { @@ -390,6 +400,16 @@ } } }, + "400": { + "description": "Returned if the user has passed in a malformed marker or limit value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, "403": { "description": "The client does not have access rights to the content or resource requested.", "content": { @@ -558,6 +578,16 @@ } } }, + "400": { + "description": "Returned if the user has passed in a malformed marker or limit value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, "403": { "description": "The client does not have access rights to the content or resource requested.", "content": { @@ -648,6 +678,16 @@ } } }, + "400": { + "description": "Returned if the user has passed in a malformed marker or limit value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, "403": { "description": "The client does not have access rights to the content or resource requested.", "content": { @@ -748,6 +788,16 @@ } } }, + "400": { + "description": "Returned if the user has passed in a malformed marker or limit value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientError" + } + } + } + }, "403": { "description": "The client does not have access rights to the content or resource requested.", "content": { diff --git a/openapi/openapi.json b/openapi/openapi.json index 0bfc497d..d74e8945 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -14,7 +14,7 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" }, "version": "2024.0", - "x-box-commit-hash": "0346d978be" + "x-box-commit-hash": "0432ad6b27" }, "servers": [ { @@ -24192,6 +24192,9 @@ } } }, + "204": { + "description": "No content is available to answer the question. This is returned when the request item is a hub, but content in the hubs is not indexed. To ensure content in the hub is indexed, make sure Box AI for Hubs in the Admin Console was enabled before hub creation." + }, "500": { "description": "An unexpected server error.", "content": { @@ -24892,7 +24895,7 @@ "description": "The items to be processed by the LLM, often files.\n\n**Note**: Box AI handles documents with text representations up to 1MB in size, or a maximum of 25 files, whichever comes first.\nIf the file size exceeds 1MB, the first 1MB of text representation will be processed.\nIf you set `mode` parameter to `single_item_qa`, the `items` array can have one element only. ", "type": "array", "items": { - "$ref": "#/components/schemas/AiItem--Base" + "$ref": "#/components/schemas/AiItemAsk" }, "maxItems": 25, "minItems": 1, @@ -25189,6 +25192,36 @@ "base" ] }, + "AiItemAsk": { + "description": "The item to be processed by the LLM for ask requests.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the file.", + "type": "string", + "example": "123" + }, + "type": { + "description": "The type of the item. A `hubs` item must be used as a single item.", + "type": "string", + "example": "file", + "enum": [ + "file", + "hubs" + ] + }, + "content": { + "description": "The content of the item, often the text representation.", + "example": "This is file content.", + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "AI Item Ask" + }, "AiLlmEndpointParamsAWS": { "description": "AI LLM endpoint params AWS object", "type": "object",