Skip to content

Commit 2cc4477

Browse files
committed
docs: (DDOC-1751) Surfaced AI Hubs functionality (box/box-openapi#606)
1 parent a4abcc3 commit 2cc4477

44 files changed

Lines changed: 248 additions & 77 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "6f9492d", "specHash": "dd7f7a9", "version": "10.12.0" }
1+
{ "engineHash": "6f9492d", "specHash": "131c54a", "version": "10.12.0" }

box_sdk_gen/managers/ai.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ def create_ai_ask(
259259
) -> Optional[AiResponseFull]:
260260
"""
261261
Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.
262+
263+
You can ask a question about a single file, several files, or the entire contents of a Box Hub. To search across and ask questions about everything in a Box Hub, send a single item with `type` set to `hubs` and the Hub's ID as the `id`. Box AI answers the question using the indexed content of all files in that Hub.
264+
265+
266+
Asking questions about a Box Hub requires Box AI for Hubs to be enabled in the Admin Console before the Hub is created, so that its content is indexed.
267+
262268
:param mode: Box AI handles text documents with text representations up to 2MB in size, or a maximum of 25 files,
263269
whichever comes first. If the text file size exceeds 2MB, the first 2MB of text representation will be processed.
264270
Box AI handles image documents with a resolution of 1024 x 1024 pixels, with a maximum of 5 images or 5 pages
@@ -271,6 +277,9 @@ def create_ai_ask(
271277
The prompt's length is limited to 10000 characters.
272278
:type prompt: str
273279
:param items: The items to be processed by the LLM, often files.
280+
To search across and ask questions about the contents of a Box Hub,
281+
pass a single item with `type` set to `hubs`. See the item `type`
282+
property for details.
274283
:type items: List[AiItemAsk]
275284
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response., defaults to None
276285
:type dialogue_history: Optional[List[AiDialogueHistory]], optional

box_sdk_gen/managers/hubs.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ class GetEnterpriseHubsV2025R0Direction(str, Enum):
6363
DESC = 'DESC'
6464

6565

66+
class UpdateHubByIdV2025R0CopyHubAccess(str, Enum):
67+
ALL = 'all'
68+
COMPANY = 'company'
69+
NONE = 'none'
70+
71+
6672
class HubsManager:
6773
def __init__(
6874
self,
@@ -304,6 +310,7 @@ def update_hub_by_id_v2025_r0(
304310
can_non_owners_invite: Optional[bool] = None,
305311
can_shared_link_be_created: Optional[bool] = None,
306312
can_public_shared_link_be_created: Optional[bool] = None,
313+
copy_hub_access: Optional[UpdateHubByIdV2025R0CopyHubAccess] = None,
307314
box_version: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._2025_0,
308315
extra_headers: Optional[Dict[str, Optional[str]]] = None
309316
) -> HubV2025R0:
@@ -332,6 +339,12 @@ def update_hub_by_id_v2025_r0(
332339
:type can_shared_link_be_created: Optional[bool], optional
333340
:param can_public_shared_link_be_created: Indicates if a public shared link can be created for the Box Hub., defaults to None
334341
:type can_public_shared_link_be_created: Optional[bool], optional
342+
:param copy_hub_access: Specifies who is allowed to copy the Box Hub.
343+
344+
* `all` - Any user with access to the Hub can copy it.
345+
* `company` - Only users within the same enterprise as the Hub can copy it.
346+
* `none` - No one can copy the Hub., defaults to None
347+
:type copy_hub_access: Optional[UpdateHubByIdV2025R0CopyHubAccess], optional
335348
:param box_version: Version header., defaults to BoxVersionHeaderV2025R0._2025_0
336349
:type box_version: BoxVersionHeaderV2025R0, optional
337350
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
@@ -349,6 +362,7 @@ def update_hub_by_id_v2025_r0(
349362
'can_non_owners_invite': can_non_owners_invite,
350363
'can_shared_link_be_created': can_shared_link_be_created,
351364
'can_public_shared_link_be_created': can_public_shared_link_be_created,
365+
'copy_hub_access': copy_hub_access,
352366
}
353367
headers_map: Dict[str, str] = prepare_params(
354368
{'box-version': to_string(box_version), **extra_headers}
@@ -425,6 +439,7 @@ def copy_hub_v2025_r0(
425439
*,
426440
title: Optional[str] = None,
427441
description: Optional[str] = None,
442+
include_items: Optional[bool] = None,
428443
box_version: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._2025_0,
429444
extra_headers: Optional[Dict[str, Optional[str]]] = None
430445
) -> HubV2025R0:
@@ -446,14 +461,21 @@ def copy_hub_v2025_r0(
446461
:type title: Optional[str], optional
447462
:param description: Description of the Box Hub., defaults to None
448463
:type description: Optional[str], optional
464+
:param include_items: If true, the items which the user has Editor or Owner access to in the original Box Hub will be copied to the new Box Hub.
465+
Defaults to false., defaults to None
466+
:type include_items: Optional[bool], optional
449467
:param box_version: Version header., defaults to BoxVersionHeaderV2025R0._2025_0
450468
:type box_version: BoxVersionHeaderV2025R0, optional
451469
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
452470
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
453471
"""
454472
if extra_headers is None:
455473
extra_headers = {}
456-
request_body: Dict = {'title': title, 'description': description}
474+
request_body: Dict = {
475+
'title': title,
476+
'description': description,
477+
'include_items': include_items,
478+
}
457479
headers_map: Dict[str, str] = prepare_params(
458480
{'box-version': to_string(box_version), **extra_headers}
459481
)

box_sdk_gen/managers/sign_requests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def create_sign_request(
268268
external_id: Union[Optional[str], NullValue] = None,
269269
template_id: Union[Optional[str], NullValue] = None,
270270
external_system_name: Union[Optional[str], NullValue] = None,
271+
request_flow: Union[Optional[str], NullValue] = None,
271272
extra_headers: Optional[Dict[str, Optional[str]]] = None
272273
) -> SignRequest:
273274
"""
@@ -314,6 +315,9 @@ def create_sign_request(
314315
:type template_id: Union[Optional[str], NullValue], optional
315316
:param external_system_name: Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`., defaults to None
316317
:type external_system_name: Union[Optional[str], NullValue], optional
318+
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
319+
When not specified during creation, a default is chosen based on admin settings., defaults to None
320+
:type request_flow: Union[Optional[str], NullValue], optional
317321
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
318322
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
319323
"""
@@ -337,6 +341,7 @@ def create_sign_request(
337341
'external_id': external_id,
338342
'template_id': template_id,
339343
'external_system_name': external_system_name,
344+
'request_flow': request_flow,
340345
}
341346
headers_map: Dict[str, str] = prepare_params({**extra_headers})
342347
response: FetchResponse = self.network_session.network_client.fetch(

box_sdk_gen/schemas/ai_ask.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def __init__(
4949
The prompt's length is limited to 10000 characters.
5050
:type prompt: str
5151
:param items: The items to be processed by the LLM, often files.
52+
To search across and ask questions about the contents of a Box Hub,
53+
pass a single item with `type` set to `hubs`. See the item `type`
54+
property for details.
5255
:type items: List[AiItemAsk]
5356
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response., defaults to None
5457
:type dialogue_history: Optional[List[AiDialogueHistory]], optional

box_sdk_gen/schemas/ai_item_ask.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ def __init__(
2424
**kwargs
2525
):
2626
"""
27-
:param id: The ID of the file.
28-
:type id: str
29-
:param type: The type of the item. A `hubs` item must be used as a single item.
30-
:type type: AiItemAskTypeField
31-
:param content: The content of the item, often the text representation., defaults to None
32-
:type content: Optional[str], optional
27+
:param id: The ID of the file, or the ID of the Box Hub when `type` is `hubs`.
28+
:type id: str
29+
:param type: The type of the item. Use `file` to ask a question about a file, or `hubs` to
30+
search across and ask a question about the entire contents of a Box Hub.
31+
A `hubs` item must be the only item in the request.
32+
:type type: AiItemAskTypeField
33+
:param content: The content of the item, often the text representation., defaults to None
34+
:type content: Optional[str], optional
3335
"""
3436
super().__init__(**kwargs)
3537
self.id = id

box_sdk_gen/schemas/sign_request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def __init__(
101101
external_id: Optional[str] = None,
102102
template_id: Optional[str] = None,
103103
external_system_name: Optional[str] = None,
104+
request_flow: Optional[str] = None,
104105
**kwargs
105106
):
106107
"""
@@ -170,6 +171,9 @@ def __init__(
170171
:type template_id: Optional[str], optional
171172
:param external_system_name: Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`., defaults to None
172173
:type external_system_name: Optional[str], optional
174+
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
175+
When not specified during creation, a default is chosen based on admin settings., defaults to None
176+
:type request_flow: Optional[str], optional
173177
"""
174178
super().__init__(
175179
is_document_preparation_needed=is_document_preparation_needed,
@@ -185,6 +189,7 @@ def __init__(
185189
external_id=external_id,
186190
template_id=template_id,
187191
external_system_name=external_system_name,
192+
request_flow=request_flow,
188193
**kwargs
189194
)
190195
self.type = type

box_sdk_gen/schemas/sign_request_base.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,39 @@ def __init__(
2626
external_id: Optional[str] = None,
2727
template_id: Optional[str] = None,
2828
external_system_name: Optional[str] = None,
29+
request_flow: Optional[str] = None,
2930
**kwargs
3031
):
3132
"""
32-
:param is_document_preparation_needed: Indicates if the sender should receive a `prepare_url` in the response to complete document preparation using the UI., defaults to None
33-
:type is_document_preparation_needed: Optional[bool], optional
34-
:param redirect_url: When specified, the signature request will be redirected to this url when a document is signed., defaults to None
35-
:type redirect_url: Optional[str], optional
36-
:param declined_redirect_url: The uri that a signer will be redirected to after declining to sign a document., defaults to None
37-
:type declined_redirect_url: Optional[str], optional
38-
:param are_text_signatures_enabled: Disables the usage of signatures generated by typing (text)., defaults to None
39-
:type are_text_signatures_enabled: Optional[bool], optional
40-
:param email_subject: Subject of sign request email. This is cleaned by sign request. If this field is not passed, a default subject will be used., defaults to None
41-
:type email_subject: Optional[str], optional
42-
:param email_message: Message to include in sign request email. The field is cleaned through sanitization of specific characters. However, some html tags are allowed. Links included in the message are also converted to hyperlinks in the email. The message may contain the following html tags including `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. If this field is not passed, a default message will be used., defaults to None
43-
:type email_message: Optional[str], optional
44-
:param are_reminders_enabled: Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to outstanding signers., defaults to None
45-
:type are_reminders_enabled: Optional[bool], optional
46-
:param name: Name of the signature request., defaults to None
47-
:type name: Optional[str], optional
48-
:param prefill_tags: When a document contains sign-related tags in the content, you can prefill them using this `prefill_tags` by referencing the 'id' of the tag as the `external_id` field of the prefill tag., defaults to None
49-
:type prefill_tags: Optional[List[SignRequestPrefillTag]], optional
50-
:param days_valid: Set the number of days after which the created signature request will automatically expire if not completed. By default, we do not apply any expiration date on signature requests, and the signature request does not expire., defaults to None
51-
:type days_valid: Optional[int], optional
52-
:param external_id: This can be used to reference an ID in an external system that the sign request is related to., defaults to None
53-
:type external_id: Optional[str], optional
54-
:param template_id: When a signature request is created from a template this field will indicate the id of that template., defaults to None
55-
:type template_id: Optional[str], optional
56-
:param external_system_name: Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`., defaults to None
57-
:type external_system_name: Optional[str], optional
33+
:param is_document_preparation_needed: Indicates if the sender should receive a `prepare_url` in the response to complete document preparation using the UI., defaults to None
34+
:type is_document_preparation_needed: Optional[bool], optional
35+
:param redirect_url: When specified, the signature request will be redirected to this url when a document is signed., defaults to None
36+
:type redirect_url: Optional[str], optional
37+
:param declined_redirect_url: The uri that a signer will be redirected to after declining to sign a document., defaults to None
38+
:type declined_redirect_url: Optional[str], optional
39+
:param are_text_signatures_enabled: Disables the usage of signatures generated by typing (text)., defaults to None
40+
:type are_text_signatures_enabled: Optional[bool], optional
41+
:param email_subject: Subject of sign request email. This is cleaned by sign request. If this field is not passed, a default subject will be used., defaults to None
42+
:type email_subject: Optional[str], optional
43+
:param email_message: Message to include in sign request email. The field is cleaned through sanitization of specific characters. However, some html tags are allowed. Links included in the message are also converted to hyperlinks in the email. The message may contain the following html tags including `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. If this field is not passed, a default message will be used., defaults to None
44+
:type email_message: Optional[str], optional
45+
:param are_reminders_enabled: Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to outstanding signers., defaults to None
46+
:type are_reminders_enabled: Optional[bool], optional
47+
:param name: Name of the signature request., defaults to None
48+
:type name: Optional[str], optional
49+
:param prefill_tags: When a document contains sign-related tags in the content, you can prefill them using this `prefill_tags` by referencing the 'id' of the tag as the `external_id` field of the prefill tag., defaults to None
50+
:type prefill_tags: Optional[List[SignRequestPrefillTag]], optional
51+
:param days_valid: Set the number of days after which the created signature request will automatically expire if not completed. By default, we do not apply any expiration date on signature requests, and the signature request does not expire., defaults to None
52+
:type days_valid: Optional[int], optional
53+
:param external_id: This can be used to reference an ID in an external system that the sign request is related to., defaults to None
54+
:type external_id: Optional[str], optional
55+
:param template_id: When a signature request is created from a template this field will indicate the id of that template., defaults to None
56+
:type template_id: Optional[str], optional
57+
:param external_system_name: Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`., defaults to None
58+
:type external_system_name: Optional[str], optional
59+
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
60+
When not specified during creation, a default is chosen based on admin settings., defaults to None
61+
:type request_flow: Optional[str], optional
5862
"""
5963
super().__init__(**kwargs)
6064
self.is_document_preparation_needed = is_document_preparation_needed
@@ -70,3 +74,4 @@ def __init__(
7074
self.external_id = external_id
7175
self.template_id = template_id
7276
self.external_system_name = external_system_name
77+
self.request_flow = request_flow

box_sdk_gen/schemas/sign_request_create_request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __init__(
4444
external_id: Optional[str] = None,
4545
template_id: Optional[str] = None,
4646
external_system_name: Optional[str] = None,
47+
request_flow: Optional[str] = None,
4748
**kwargs
4849
):
4950
"""
@@ -86,6 +87,9 @@ def __init__(
8687
:type template_id: Optional[str], optional
8788
:param external_system_name: Used as an optional system name to appear in the signature log next to the signers who have been assigned the `embed_url_external_id`., defaults to None
8889
:type external_system_name: Optional[str], optional
90+
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
91+
When not specified during creation, a default is chosen based on admin settings., defaults to None
92+
:type request_flow: Optional[str], optional
8993
"""
9094
super().__init__(
9195
is_document_preparation_needed=is_document_preparation_needed,
@@ -101,6 +105,7 @@ def __init__(
101105
external_id=external_id,
102106
template_id=template_id,
103107
external_system_name=external_system_name,
108+
request_flow=request_flow,
104109
**kwargs
105110
)
106111
self.signers = signers

0 commit comments

Comments
 (0)