@@ -113,16 +113,16 @@ from unstructured_client import UnstructuredClient
113
113
from unstructured_client.models import shared
114
114
from unstructured_client.utils import BackoffStrategy, RetryConfig
115
115
116
- with UnstructuredClient() as uc_client:
116
+ with UnstructuredClient(
117
+ server_url = " https://api.example.com" ,
118
+ ) as uc_client:
117
119
118
120
res = uc_client.destinations.create_destination(request = {
119
121
" create_destination_connector" : {
120
122
" config" : {
121
- " account_key" : " azure_account_key" ,
122
- " account_name" : " azure_account_name" ,
123
- " anonymous" : False ,
124
- " recursive" : True ,
125
- " remote_url" : " az://<path></path></container-name>" ,
123
+ " endpoint" : " <value>" ,
124
+ " index" : " <value>" ,
125
+ " key" : " <key>" ,
126
126
},
127
127
" name" : " <value>" ,
128
128
" type" : shared.DestinationConnectorType.ASTRADB ,
@@ -144,17 +144,16 @@ from unstructured_client.models import shared
144
144
from unstructured_client.utils import BackoffStrategy, RetryConfig
145
145
146
146
with UnstructuredClient(
147
+ server_url = " https://api.example.com" ,
147
148
retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
148
149
) as uc_client:
149
150
150
151
res = uc_client.destinations.create_destination(request = {
151
152
" create_destination_connector" : {
152
153
" config" : {
153
- " account_key" : " azure_account_key" ,
154
- " account_name" : " azure_account_name" ,
155
- " anonymous" : False ,
156
- " recursive" : True ,
157
- " remote_url" : " az://<path></path></container-name>" ,
154
+ " endpoint" : " <value>" ,
155
+ " index" : " <value>" ,
156
+ " key" : " <key>" ,
158
157
},
159
158
" name" : " <value>" ,
160
159
" type" : shared.DestinationConnectorType.ASTRADB ,
@@ -197,18 +196,18 @@ When custom error responses are specified for an operation, the SDK may also rai
197
196
from unstructured_client import UnstructuredClient
198
197
from unstructured_client.models import errors, shared
199
198
200
- with UnstructuredClient() as uc_client:
199
+ with UnstructuredClient(
200
+ server_url = " https://api.example.com" ,
201
+ ) as uc_client:
201
202
res = None
202
203
try :
203
204
204
205
res = uc_client.destinations.create_destination(request = {
205
206
" create_destination_connector" : {
206
207
" config" : {
207
- " account_key" : " azure_account_key" ,
208
- " account_name" : " azure_account_name" ,
209
- " anonymous" : False ,
210
- " recursive" : True ,
211
- " remote_url" : " az://<path></path></container-name>" ,
208
+ " endpoint" : " <value>" ,
209
+ " index" : " <value>" ,
210
+ " key" : " <key>" ,
212
211
},
213
212
" name" : " <value>" ,
214
213
" type" : shared.DestinationConnectorType.ASTRADB ,
@@ -331,16 +330,16 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
331
330
from unstructured_client import UnstructuredClient
332
331
from unstructured_client.models import shared
333
332
334
- with UnstructuredClient() as uc_client:
333
+ with UnstructuredClient(
334
+ server_url = " https://api.example.com" ,
335
+ ) as uc_client:
335
336
336
337
res = uc_client.destinations.create_destination(request = {
337
338
" create_destination_connector" : {
338
339
" config" : {
339
- " account_key" : " azure_account_key" ,
340
- " account_name" : " azure_account_name" ,
341
- " anonymous" : False ,
342
- " recursive" : True ,
343
- " remote_url" : " az://<path></path></container-name>" ,
340
+ " endpoint" : " <value>" ,
341
+ " index" : " <value>" ,
342
+ " key" : " <key>" ,
344
343
},
345
344
" name" : " <value>" ,
346
345
" type" : shared.DestinationConnectorType.ASTRADB ,
@@ -363,16 +362,16 @@ from unstructured_client import UnstructuredClient
363
362
from unstructured_client.models import shared
364
363
365
364
async def main ():
366
- async with UnstructuredClient() as uc_client:
365
+ async with UnstructuredClient(
366
+ server_url = " https://api.example.com" ,
367
+ ) as uc_client:
367
368
368
369
res = await uc_client.destinations.create_destination_async(request = {
369
370
" create_destination_connector" : {
370
371
" config" : {
371
- " account_key" : " azure_account_key" ,
372
- " account_name" : " azure_account_name" ,
373
- " anonymous" : False ,
374
- " recursive" : True ,
375
- " remote_url" : " az://<path></path></container-name>" ,
372
+ " endpoint" : " <value>" ,
373
+ " index" : " <value>" ,
374
+ " key" : " <key>" ,
376
375
},
377
376
" name" : " <value>" ,
378
377
" type" : shared.DestinationConnectorType.ASTRADB ,
@@ -460,7 +459,9 @@ Certain SDK methods accept file objects as part of a request body or multi-part
460
459
``` python
461
460
from unstructured_client import UnstructuredClient
462
461
463
- with UnstructuredClient() as uc_client:
462
+ with UnstructuredClient(
463
+ server_url = " https://api.example.com" ,
464
+ ) as uc_client:
464
465
465
466
res = uc_client.general.partition(request = {
466
467
" partition_parameters" : {
@@ -493,13 +494,17 @@ The `UnstructuredClient` class implements the context manager protocol and regis
493
494
``` python
494
495
from unstructured_client import UnstructuredClient
495
496
def main ():
496
- with UnstructuredClient() as uc_client:
497
+ with UnstructuredClient(
498
+ server_url = " https://api.example.com" ,
499
+ ) as uc_client:
497
500
# Rest of application here...
498
501
499
502
500
503
# Or when using async:
501
504
async def amain ():
502
- async with UnstructuredClient() as uc_client:
505
+ async with UnstructuredClient(
506
+ server_url = " https://api.example.com" ,
507
+ ) as uc_client:
503
508
# Rest of application here...
504
509
```
505
510
<!-- End Resource Management [resource-management] -->
@@ -515,7 +520,7 @@ from unstructured_client import UnstructuredClient
515
520
import logging
516
521
517
522
logging.basicConfig(level = logging.DEBUG )
518
- s = UnstructuredClient(debug_logger = logging.getLogger(" unstructured_client" ))
523
+ s = UnstructuredClient(server_url = " https://example.com " , debug_logger = logging.getLogger(" unstructured_client" ))
519
524
```
520
525
<!-- End Debugging [debug] -->
521
526
0 commit comments