@@ -113,7 +113,10 @@ from unstructured_client import UnstructuredClient
113113from unstructured_client.models import shared
114114from unstructured_client.utils import BackoffStrategy, RetryConfig
115115
116- with UnstructuredClient() as uc_client:
116+
117+ with UnstructuredClient(
118+ server_url = " https://api.example.com" ,
119+ ) as uc_client:
117120
118121 res = uc_client.destinations.create_destination(request = {
119122 " create_destination_connector" : {
@@ -141,7 +144,9 @@ from unstructured_client import UnstructuredClient
141144from unstructured_client.models import shared
142145from unstructured_client.utils import BackoffStrategy, RetryConfig
143146
147+
144148with UnstructuredClient(
149+ server_url = " https://api.example.com" ,
145150 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
146151) as uc_client:
147152
@@ -193,7 +198,10 @@ When custom error responses are specified for an operation, the SDK may also rai
193198from unstructured_client import UnstructuredClient
194199from unstructured_client.models import errors, shared
195200
196- with UnstructuredClient() as uc_client:
201+
202+ with UnstructuredClient(
203+ server_url = " https://api.example.com" ,
204+ ) as uc_client:
197205 res = None
198206 try :
199207
@@ -325,7 +333,10 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
325333from unstructured_client import UnstructuredClient
326334from unstructured_client.models import shared
327335
328- with UnstructuredClient() as uc_client:
336+
337+ with UnstructuredClient(
338+ server_url = " https://api.example.com" ,
339+ ) as uc_client:
329340
330341 res = uc_client.destinations.create_destination(request = {
331342 " create_destination_connector" : {
@@ -355,7 +366,10 @@ from unstructured_client import UnstructuredClient
355366from unstructured_client.models import shared
356367
357368async def main ():
358- async with UnstructuredClient() as uc_client:
369+
370+ async with UnstructuredClient(
371+ server_url = " https://api.example.com" ,
372+ ) as uc_client:
359373
360374 res = await uc_client.destinations.create_destination_async(request = {
361375 " create_destination_connector" : {
@@ -450,7 +464,10 @@ Certain SDK methods accept file objects as part of a request body or multi-part
450464``` python
451465from unstructured_client import UnstructuredClient
452466
453- with UnstructuredClient() as uc_client:
467+
468+ with UnstructuredClient(
469+ server_url = " https://api.example.com" ,
470+ ) as uc_client:
454471
455472 res = uc_client.general.partition(request = {
456473 " partition_parameters" : {
@@ -483,13 +500,19 @@ The `UnstructuredClient` class implements the context manager protocol and regis
483500``` python
484501from unstructured_client import UnstructuredClient
485502def main ():
486- with UnstructuredClient() as uc_client:
503+
504+ with UnstructuredClient(
505+ server_url = " https://api.example.com" ,
506+ ) as uc_client:
487507 # Rest of application here...
488508
489509
490510# Or when using async:
491511async def amain ():
492- async with UnstructuredClient() as uc_client:
512+
513+ async with UnstructuredClient(
514+ server_url = " https://api.example.com" ,
515+ ) as uc_client:
493516 # Rest of application here...
494517```
495518<!-- End Resource Management [resource-management] -->
@@ -505,7 +528,7 @@ from unstructured_client import UnstructuredClient
505528import logging
506529
507530logging.basicConfig(level = logging.DEBUG )
508- s = UnstructuredClient(debug_logger = logging.getLogger(" unstructured_client" ))
531+ s = UnstructuredClient(server_url = " https://example.com " , debug_logger = logging.getLogger(" unstructured_client" ))
509532```
510533<!-- End Debugging [debug] -->
511534
0 commit comments