Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "e392e8c", "specHash": "dd7f7a9", "version": "4.12.0" }
{ "engineHash": "6f9492d", "specHash": "131c54a", "version": "4.12.0" }
9 changes: 9 additions & 0 deletions box_sdk_gen/managers/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ def create_ai_ask(
) -> Optional[AiResponseFull]:
"""
Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.

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.


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.

:param mode: Box AI handles text documents with text representations up to 2MB in size, or a maximum of 25 files,
whichever comes first. If the text file size exceeds 2MB, the first 2MB of text representation will be processed.
Box AI handles image documents with a resolution of 1024 x 1024 pixels, with a maximum of 5 images or 5 pages
Expand All @@ -271,6 +277,9 @@ def create_ai_ask(
The prompt's length is limited to 10000 characters.
:type prompt: str
:param items: The items to be processed by the LLM, often files.
To search across and ask questions about the contents of a Box Hub,
pass a single item with `type` set to `hubs`. See the item `type`
property for details.
:type items: List[AiItemAsk]
: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
:type dialogue_history: Optional[List[AiDialogueHistory]], optional
Expand Down
24 changes: 23 additions & 1 deletion box_sdk_gen/managers/hubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ class GetEnterpriseHubsV2025R0Direction(str, Enum):
DESC = 'DESC'


class UpdateHubByIdV2025R0CopyHubAccess(str, Enum):
ALL = 'all'
COMPANY = 'company'
NONE = 'none'


class HubsManager:
def __init__(
self,
Expand Down Expand Up @@ -304,6 +310,7 @@ def update_hub_by_id_v2025_r0(
can_non_owners_invite: Optional[bool] = None,
can_shared_link_be_created: Optional[bool] = None,
can_public_shared_link_be_created: Optional[bool] = None,
copy_hub_access: Optional[UpdateHubByIdV2025R0CopyHubAccess] = None,
box_version: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._2025_0,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> HubV2025R0:
Expand Down Expand Up @@ -332,6 +339,12 @@ def update_hub_by_id_v2025_r0(
:type can_shared_link_be_created: Optional[bool], optional
:param can_public_shared_link_be_created: Indicates if a public shared link can be created for the Box Hub., defaults to None
:type can_public_shared_link_be_created: Optional[bool], optional
:param copy_hub_access: Specifies who is allowed to copy the Box Hub.

* `all` - Any user with access to the Hub can copy it.
* `company` - Only users within the same enterprise as the Hub can copy it.
* `none` - No one can copy the Hub., defaults to None
:type copy_hub_access: Optional[UpdateHubByIdV2025R0CopyHubAccess], optional
:param box_version: Version header., defaults to BoxVersionHeaderV2025R0._2025_0
:type box_version: BoxVersionHeaderV2025R0, optional
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
Expand All @@ -349,6 +362,7 @@ def update_hub_by_id_v2025_r0(
'can_non_owners_invite': can_non_owners_invite,
'can_shared_link_be_created': can_shared_link_be_created,
'can_public_shared_link_be_created': can_public_shared_link_be_created,
'copy_hub_access': copy_hub_access,
}
headers_map: Dict[str, str] = prepare_params(
{'box-version': to_string(box_version), **extra_headers}
Expand Down Expand Up @@ -425,6 +439,7 @@ def copy_hub_v2025_r0(
*,
title: Optional[str] = None,
description: Optional[str] = None,
include_items: Optional[bool] = None,
box_version: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._2025_0,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> HubV2025R0:
Expand All @@ -446,14 +461,21 @@ def copy_hub_v2025_r0(
:type title: Optional[str], optional
:param description: Description of the Box Hub., defaults to None
:type description: Optional[str], optional
: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.
Defaults to false., defaults to None
:type include_items: Optional[bool], optional
:param box_version: Version header., defaults to BoxVersionHeaderV2025R0._2025_0
:type box_version: BoxVersionHeaderV2025R0, optional
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
if extra_headers is None:
extra_headers = {}
request_body: Dict = {'title': title, 'description': description}
request_body: Dict = {
'title': title,
'description': description,
'include_items': include_items,
}
headers_map: Dict[str, str] = prepare_params(
{'box-version': to_string(box_version), **extra_headers}
)
Expand Down
5 changes: 5 additions & 0 deletions box_sdk_gen/managers/sign_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def create_sign_request(
external_id: Union[Optional[str], NullValue] = None,
template_id: Union[Optional[str], NullValue] = None,
external_system_name: Union[Optional[str], NullValue] = None,
request_flow: Union[Optional[str], NullValue] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> SignRequest:
"""
Expand Down Expand Up @@ -314,6 +315,9 @@ def create_sign_request(
:type template_id: Union[Optional[str], NullValue], optional
: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
:type external_system_name: Union[Optional[str], NullValue], optional
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
When not specified during creation, a default is chosen based on admin settings., defaults to None
:type request_flow: Union[Optional[str], NullValue], optional
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
"""
Expand All @@ -337,6 +341,7 @@ def create_sign_request(
'external_id': external_id,
'template_id': template_id,
'external_system_name': external_system_name,
'request_flow': request_flow,
}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
Expand Down
3 changes: 3 additions & 0 deletions box_sdk_gen/schemas/ai_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def __init__(
The prompt's length is limited to 10000 characters.
:type prompt: str
:param items: The items to be processed by the LLM, often files.
To search across and ask questions about the contents of a Box Hub,
pass a single item with `type` set to `hubs`. See the item `type`
property for details.
:type items: List[AiItemAsk]
: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
:type dialogue_history: Optional[List[AiDialogueHistory]], optional
Expand Down
14 changes: 8 additions & 6 deletions box_sdk_gen/schemas/ai_item_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ def __init__(
**kwargs
):
"""
:param id: The ID of the file.
:type id: str
:param type: The type of the item. A `hubs` item must be used as a single item.
:type type: AiItemAskTypeField
:param content: The content of the item, often the text representation., defaults to None
:type content: Optional[str], optional
:param id: The ID of the file, or the ID of the Box Hub when `type` is `hubs`.
:type id: str
:param type: The type of the item. Use `file` to ask a question about a file, or `hubs` to
search across and ask a question about the entire contents of a Box Hub.
A `hubs` item must be the only item in the request.
:type type: AiItemAskTypeField
:param content: The content of the item, often the text representation., defaults to None
:type content: Optional[str], optional
"""
super().__init__(**kwargs)
self.id = id
Expand Down
5 changes: 5 additions & 0 deletions box_sdk_gen/schemas/sign_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def __init__(
external_id: Optional[str] = None,
template_id: Optional[str] = None,
external_system_name: Optional[str] = None,
request_flow: Optional[str] = None,
**kwargs
):
"""
Expand Down Expand Up @@ -170,6 +171,9 @@ def __init__(
:type template_id: Optional[str], optional
: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
:type external_system_name: Optional[str], optional
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
When not specified during creation, a default is chosen based on admin settings., defaults to None
:type request_flow: Optional[str], optional
"""
super().__init__(
is_document_preparation_needed=is_document_preparation_needed,
Expand All @@ -185,6 +189,7 @@ def __init__(
external_id=external_id,
template_id=template_id,
external_system_name=external_system_name,
request_flow=request_flow,
**kwargs
)
self.type = type
Expand Down
57 changes: 31 additions & 26 deletions box_sdk_gen/schemas/sign_request_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,39 @@ def __init__(
external_id: Optional[str] = None,
template_id: Optional[str] = None,
external_system_name: Optional[str] = None,
request_flow: Optional[str] = None,
**kwargs
):
"""
: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
:type is_document_preparation_needed: Optional[bool], optional
:param redirect_url: When specified, the signature request will be redirected to this url when a document is signed., defaults to None
:type redirect_url: Optional[str], optional
:param declined_redirect_url: The uri that a signer will be redirected to after declining to sign a document., defaults to None
:type declined_redirect_url: Optional[str], optional
:param are_text_signatures_enabled: Disables the usage of signatures generated by typing (text)., defaults to None
:type are_text_signatures_enabled: Optional[bool], optional
: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
:type email_subject: Optional[str], optional
: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
:type email_message: Optional[str], optional
: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
:type are_reminders_enabled: Optional[bool], optional
:param name: Name of the signature request., defaults to None
:type name: Optional[str], optional
: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
:type prefill_tags: Optional[List[SignRequestPrefillTag]], optional
: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
:type days_valid: Optional[int], optional
: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
:type external_id: Optional[str], optional
:param template_id: When a signature request is created from a template this field will indicate the id of that template., defaults to None
:type template_id: Optional[str], optional
: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
:type external_system_name: Optional[str], optional
: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
:type is_document_preparation_needed: Optional[bool], optional
:param redirect_url: When specified, the signature request will be redirected to this url when a document is signed., defaults to None
:type redirect_url: Optional[str], optional
:param declined_redirect_url: The uri that a signer will be redirected to after declining to sign a document., defaults to None
:type declined_redirect_url: Optional[str], optional
:param are_text_signatures_enabled: Disables the usage of signatures generated by typing (text)., defaults to None
:type are_text_signatures_enabled: Optional[bool], optional
: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
:type email_subject: Optional[str], optional
: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
:type email_message: Optional[str], optional
: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
:type are_reminders_enabled: Optional[bool], optional
:param name: Name of the signature request., defaults to None
:type name: Optional[str], optional
: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
:type prefill_tags: Optional[List[SignRequestPrefillTag]], optional
: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
:type days_valid: Optional[int], optional
: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
:type external_id: Optional[str], optional
:param template_id: When a signature request is created from a template this field will indicate the id of that template., defaults to None
:type template_id: Optional[str], optional
: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
:type external_system_name: Optional[str], optional
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
When not specified during creation, a default is chosen based on admin settings., defaults to None
:type request_flow: Optional[str], optional
"""
super().__init__(**kwargs)
self.is_document_preparation_needed = is_document_preparation_needed
Expand All @@ -70,3 +74,4 @@ def __init__(
self.external_id = external_id
self.template_id = template_id
self.external_system_name = external_system_name
self.request_flow = request_flow
5 changes: 5 additions & 0 deletions box_sdk_gen/schemas/sign_request_create_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(
external_id: Optional[str] = None,
template_id: Optional[str] = None,
external_system_name: Optional[str] = None,
request_flow: Optional[str] = None,
**kwargs
):
"""
Expand Down Expand Up @@ -86,6 +87,9 @@ def __init__(
:type template_id: Optional[str], optional
: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
:type external_system_name: Optional[str], optional
:param request_flow: The flow type of the sign request. Values can include `standard` or `cfr11`.
When not specified during creation, a default is chosen based on admin settings., defaults to None
:type request_flow: Optional[str], optional
"""
super().__init__(
is_document_preparation_needed=is_document_preparation_needed,
Expand All @@ -101,6 +105,7 @@ def __init__(
external_id=external_id,
template_id=template_id,
external_system_name=external_system_name,
request_flow=request_flow,
**kwargs
)
self.signers = signers
Expand Down
Loading
Loading