@@ -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" : {
@@ -451,7 +465,10 @@ Certain SDK methods accept file objects as part of a request body or multi-part
451465from unstructured_client import UnstructuredClient
452466from unstructured_client.models import shared
453467
454- with UnstructuredClient() as uc_client:
468+
469+ with UnstructuredClient(
470+ server_url = " https://api.example.com" ,
471+ ) as uc_client:
455472
456473 res = uc_client.general.partition(request = {
457474 " partition_parameters" : {
@@ -486,13 +503,19 @@ The `UnstructuredClient` class implements the context manager protocol and regis
486503``` python
487504from unstructured_client import UnstructuredClient
488505def main ():
489- with UnstructuredClient() as uc_client:
506+
507+ with UnstructuredClient(
508+ server_url = " https://api.example.com" ,
509+ ) as uc_client:
490510 # Rest of application here...
491511
492512
493513# Or when using async:
494514async def amain ():
495- async with UnstructuredClient() as uc_client:
515+
516+ async with UnstructuredClient(
517+ server_url = " https://api.example.com" ,
518+ ) as uc_client:
496519 # Rest of application here...
497520```
498521<!-- End Resource Management [resource-management] -->
@@ -508,7 +531,7 @@ from unstructured_client import UnstructuredClient
508531import logging
509532
510533logging.basicConfig(level = logging.DEBUG )
511- s = UnstructuredClient(debug_logger = logging.getLogger(" unstructured_client" ))
534+ s = UnstructuredClient(server_url = " https://example.com " , debug_logger = logging.getLogger(" unstructured_client" ))
512535```
513536<!-- End Debugging [debug] -->
514537
0 commit comments