Skip to content

Commit

Permalink
feat: add hubs support to /ai/ask
Browse files Browse the repository at this point in the history
  • Loading branch information
box-apimgmt committed Feb 3, 2025
1 parent 6598ee4 commit 39825a2
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 5 deletions.
37 changes: 35 additions & 2 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down
52 changes: 51 additions & 1 deletion openapi/openapi-v2025.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
37 changes: 35 additions & 2 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 39825a2

Please sign in to comment.