Skip to content

Commit d362d49

Browse files
docs(boxsdkgen): modify can_view_path description and add confidence scores for structured extract (box/box-openapi#566) (#1223)
1 parent 56a93ac commit d362d49

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "49f3695", "specHash": "7e4908e", "version": "4.1.0" }
1+
{ "engineHash": "49f3695", "specHash": "5183b65", "version": "4.1.0" }

box_sdk_gen/managers/ai.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def create_ai_extract_structured(
425425
*,
426426
metadata_template: Optional[CreateAiExtractStructuredMetadataTemplate] = None,
427427
fields: Optional[List[CreateAiExtractStructuredFields]] = None,
428+
include_confidence_score: Optional[bool] = None,
428429
ai_agent: Optional[AiExtractStructuredAgent] = None,
429430
extra_headers: Optional[Dict[str, Optional[str]]] = None
430431
) -> AiExtractStructuredResponse:
@@ -450,6 +451,8 @@ def create_ai_extract_structured(
450451
:param fields: The fields to be extracted from the provided items.
451452
For your request to work, you must provide either `metadata_template` or `fields`, but not both., defaults to None
452453
:type fields: Optional[List[CreateAiExtractStructuredFields]], optional
454+
:param include_confidence_score: A flag to indicate whether confidence scores for every extracted field should be returned., defaults to None
455+
:type include_confidence_score: Optional[bool], optional
453456
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
454457
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
455458
"""
@@ -459,6 +462,7 @@ def create_ai_extract_structured(
459462
'items': items,
460463
'metadata_template': metadata_template,
461464
'fields': fields,
465+
'include_confidence_score': include_confidence_score,
462466
'ai_agent': ai_agent,
463467
}
464468
headers_map: Dict[str, str] = prepare_params({**extra_headers})

box_sdk_gen/managers/user_collaborations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ def update_collaboration_by_id(
241241
invitee's **All Files** page. We recommend you limit the number of
242242
collaborations with `can_view_path` enabled to 1,000 per user.
243243
244-
Only owner or co-owners can invite collaborators with a `can_view_path` of
245-
`true`.
244+
Only an owner or co-owners can invite collaborators with a `can_view_path` of
245+
`true`. Only an owner can update `can_view_path` on existing collaborations.
246246
247247
`can_view_path` can only be used for folder collaborations., defaults to None
248248
:type can_view_path: Optional[bool], optional
@@ -381,8 +381,8 @@ def create_collaboration(
381381
invitee's **All Files** page. We recommend you limit the number of
382382
collaborations with `can_view_path` enabled to 1,000 per user.
383383
384-
Only owner or co-owners can invite collaborators with a `can_view_path` of
385-
`true`.
384+
Only an owner or co-owners can invite collaborators with a `can_view_path` of
385+
`true`. Only an owner can update `can_view_path` on existing collaborations.
386386
387387
`can_view_path` can only be used for folder collaborations., defaults to None
388388
:type can_view_path: Optional[bool], optional

box_sdk_gen/schemas/ai_extract_structured.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def __init__(
114114
*,
115115
metadata_template: Optional[AiExtractStructuredMetadataTemplateField] = None,
116116
fields: Optional[List[AiExtractStructuredFieldsField]] = None,
117+
include_confidence_score: Optional[bool] = None,
117118
ai_agent: Optional[AiExtractStructuredAgent] = None,
118119
**kwargs
119120
):
@@ -126,9 +127,12 @@ def __init__(
126127
:param fields: The fields to be extracted from the provided items.
127128
For your request to work, you must provide either `metadata_template` or `fields`, but not both., defaults to None
128129
:type fields: Optional[List[AiExtractStructuredFieldsField]], optional
130+
:param include_confidence_score: A flag to indicate whether confidence scores for every extracted field should be returned., defaults to None
131+
:type include_confidence_score: Optional[bool], optional
129132
"""
130133
super().__init__(**kwargs)
131134
self.items = items
132135
self.metadata_template = metadata_template
133136
self.fields = fields
137+
self.include_confidence_score = include_confidence_score
134138
self.ai_agent = ai_agent

box_sdk_gen/schemas/ai_extract_structured_response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(
1818
created_at: DateTime,
1919
*,
2020
completion_reason: Optional[str] = None,
21+
confidence_score: Optional[Dict] = None,
2122
ai_agent_info: Optional[AiAgentInfo] = None,
2223
**kwargs
2324
):
@@ -26,9 +27,12 @@ def __init__(
2627
:type created_at: DateTime
2728
:param completion_reason: The reason the response finishes., defaults to None
2829
:type completion_reason: Optional[str], optional
30+
:param confidence_score: The confidence score numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted., defaults to None
31+
:type confidence_score: Optional[Dict], optional
2932
"""
3033
super().__init__(**kwargs)
3134
self.answer = answer
3235
self.created_at = created_at
3336
self.completion_reason = completion_reason
37+
self.confidence_score = confidence_score
3438
self.ai_agent_info = ai_agent_info

docs/box_sdk_gen/ai.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ client.ai.create_ai_extract_structured([AiItemBase(id=file.id)], fields=[CreateA
178178
- The metadata template containing the fields to extract. For your request to work, you must provide either `metadata_template` or `fields`, but not both.
179179
- fields `Optional[List[CreateAiExtractStructuredFields]]`
180180
- The fields to be extracted from the provided items. For your request to work, you must provide either `metadata_template` or `fields`, but not both.
181+
- include_confidence_score `Optional[bool]`
182+
- A flag to indicate whether confidence scores for every extracted field should be returned.
181183
- ai_agent `Optional[AiExtractStructuredAgent]`
182184
- extra_headers `Optional[Dict[str, Optional[str]]]`
183185
- Extra headers that will be included in the HTTP request.

docs/box_sdk_gen/user_collaborations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ client.user_collaborations.update_collaboration_by_id(collaboration_id, role=Upd
6363
- expires_at `Optional[DateTime]`
6464
- Update the expiration date for the collaboration. At this date, the collaboration will be automatically removed from the item. This feature will only work if the **Automatically remove invited collaborators: Allow folder owners to extend the expiry date** setting has been enabled in the **Enterprise Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not have an expiry date and a value for this field will be result in an error. Additionally, a collaboration can only be given an expiration if it was created after the **Automatically remove invited collaborator** setting was enabled.
6565
- can_view_path `Optional[bool]`
66-
- Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only owner or co-owners can invite collaborators with a `can_view_path` of `true`. `can_view_path` can only be used for folder collaborations.
66+
- Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only an owner or co-owners can invite collaborators with a `can_view_path` of `true`. Only an owner can update `can_view_path` on existing collaborations. `can_view_path` can only be used for folder collaborations.
6767
- extra_headers `Optional[Dict[str, Optional[str]]]`
6868
- Extra headers that will be included in the HTTP request.
6969

@@ -144,7 +144,7 @@ client.user_collaborations.create_collaboration(CreateCollaborationItem(type=Cre
144144
- is_access_only `Optional[bool]`
145145
- If set to `true`, collaborators have access to shared items, but such items won't be visible in the All Files list. Additionally, collaborators won't see the path to the root folder for the shared item.
146146
- can_view_path `Optional[bool]`
147-
- Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only owner or co-owners can invite collaborators with a `can_view_path` of `true`. `can_view_path` can only be used for folder collaborations.
147+
- Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only an owner or co-owners can invite collaborators with a `can_view_path` of `true`. Only an owner can update `can_view_path` on existing collaborations. `can_view_path` can only be used for folder collaborations.
148148
- expires_at `Optional[DateTime]`
149149
- Set the expiration date for the collaboration. At this date, the collaboration will be automatically removed from the item. This feature will only work if the **Automatically remove invited collaborators: Allow folder owners to extend the expiry date** setting has been enabled in the **Enterprise Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not have an expiry date and a value for this field will be result in an error.
150150
- fields `Optional[List[str]]`

0 commit comments

Comments
 (0)