You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/box_sdk_gen/ai.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ See the endpoint docs at
167
167
<!-- sample post_ai_extract_structured -->
168
168
169
169
```python
170
-
client.ai.create_ai_extract_structured([AiItemBase(id=file.id)], fields=[CreateAiExtractStructuredFields(key='firstName', display_name='First name', description='Person first name', prompt='What is the your first name?', type='string'), CreateAiExtractStructuredFields(key='lastName', display_name='Last name', description='Person last name', prompt='What is the your last name?', type='string'), CreateAiExtractStructuredFields(key='dateOfBirth', display_name='Birth date', description='Person date of birth', prompt='What is the date of your birth?', type='date'), CreateAiExtractStructuredFields(key='age', display_name='Age', description='Person age', prompt='How old are you?', type='float'), CreateAiExtractStructuredFields(key='hobby', display_name='Hobby', description='Person hobby', prompt='What is your hobby?', type='multiSelect', options=[CreateAiExtractStructuredFieldsOptionsField(key='guitar'), CreateAiExtractStructuredFieldsOptionsField(key='books')])], ai_agent=ai_extract_structured_agent_basic_text_config)
170
+
client.ai.create_ai_extract_structured([AiItemBase(id=file.id)], fields=[CreateAiExtractStructuredFields(key='firstName', display_name='First name', description='Person first name', prompt='What is the your first name?', type='string'), CreateAiExtractStructuredFields(key='lastName', display_name='Last name', description='Person last name', prompt='What is the your last name?', type='string'), CreateAiExtractStructuredFields(key='dateOfBirth', display_name='Birth date', description='Person date of birth', prompt='What is the date of your birth?', type='date'), CreateAiExtractStructuredFields(key='age', display_name='Age', description='Person age', prompt='How old are you?', type='float'), CreateAiExtractStructuredFields(key='hobby', display_name='Hobby', description='Person hobby', prompt='What is your hobby?', type='multiSelect', options=[CreateAiExtractStructuredFieldsOptionsField(key='guitar'), CreateAiExtractStructuredFieldsOptionsField(key='books')])], include_confidence_score=True, ai_agent=ai_extract_structured_agent_basic_text_config)
Copy file name to clipboardExpand all lines: docs/config-sharing-implementation.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,6 @@ This document describes the implementation of configuration sharing between the
26
26
27
27
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
28
28
29
-
30
29
## Overview
31
30
32
31
The configuration sharing feature allows developers to seamlessly migrate from the legacy SDK to the generated SDK by automatically extracting and converting authentication and network configuration from a legacy client to a generated client.
@@ -38,11 +37,13 @@ The configuration sharing feature allows developers to seamlessly migrate from t
38
37
The `LegacyTokenStorageAdapter` class bridges the gap between legacy OAuth2 token storage mechanisms (callbacks) and the generated SDK's `TokenStorage` interface.
39
38
40
39
**Key Features:**
40
+
41
41
- Converts legacy token format (access_token, refresh_token tuple) to generated SDK `AccessToken` objects
42
42
- Supports both read and write operations
43
43
- Handles token storage callbacks from legacy OAuth2 implementations
44
44
45
45
**Example:**
46
+
46
47
```python
47
48
from boxsdk.auth.oauth2 import OAuth2
48
49
from boxsdk.util.token_storage_adapter import LegacyTokenStorageAdapter
@@ -86,6 +87,7 @@ Three new methods have been added to the `Client` class in `boxsdk/client/client
86
87
Creates a fully configured generated SDK client from the legacy client. This is the main convenience method that combines `get_sdk_gen_authentication()` and `get_sdk_gen_network_session()`.
87
88
88
89
**Parameters:**
90
+
89
91
-`auth_options` (optional): Dictionary with authentication options
90
92
-`token_storage`: Custom `TokenStorage` instance
91
93
-`network_options` (optional): Dictionary with network options
@@ -95,9 +97,11 @@ Creates a fully configured generated SDK client from the legacy client. This is
95
97
-`additional_headers`: Dictionary of additional HTTP headers
96
98
97
99
**Returns:**
100
+
98
101
-`BoxClient` instance from `box_sdk_gen`, fully configured with shared settings
0 commit comments