@@ -113,7 +113,9 @@ 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+ with UnstructuredClient(
117+ server_url = " https://api.example.com" ,
118+ ) as uc_client:
117119
118120 res = uc_client.destinations.create_destination(request = {
119121 " create_destination_connector" : {
@@ -142,6 +144,7 @@ from unstructured_client.models import shared
142144from unstructured_client.utils import BackoffStrategy, RetryConfig
143145
144146with UnstructuredClient(
147+ server_url = " https://api.example.com" ,
145148 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
146149) as uc_client:
147150
@@ -193,7 +196,9 @@ When custom error responses are specified for an operation, the SDK may also rai
193196from unstructured_client import UnstructuredClient
194197from unstructured_client.models import errors, shared
195198
196- with UnstructuredClient() as uc_client:
199+ with UnstructuredClient(
200+ server_url = " https://api.example.com" ,
201+ ) as uc_client:
197202 res = None
198203 try :
199204
@@ -325,7 +330,9 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
325330from unstructured_client import UnstructuredClient
326331from unstructured_client.models import shared
327332
328- with UnstructuredClient() as uc_client:
333+ with UnstructuredClient(
334+ server_url = " https://api.example.com" ,
335+ ) as uc_client:
329336
330337 res = uc_client.destinations.create_destination(request = {
331338 " create_destination_connector" : {
@@ -355,7 +362,9 @@ from unstructured_client import UnstructuredClient
355362from unstructured_client.models import shared
356363
357364async def main ():
358- async with UnstructuredClient() as uc_client:
365+ async with UnstructuredClient(
366+ server_url = " https://api.example.com" ,
367+ ) as uc_client:
359368
360369 res = await uc_client.destinations.create_destination_async(request = {
361370 " create_destination_connector" : {
@@ -450,7 +459,9 @@ Certain SDK methods accept file objects as part of a request body or multi-part
450459``` python
451460from unstructured_client import UnstructuredClient
452461
453- with UnstructuredClient() as uc_client:
462+ with UnstructuredClient(
463+ server_url = " https://api.example.com" ,
464+ ) as uc_client:
454465
455466 res = uc_client.general.partition(request = {
456467 " partition_parameters" : {
@@ -483,13 +494,17 @@ The `UnstructuredClient` class implements the context manager protocol and regis
483494``` python
484495from unstructured_client import UnstructuredClient
485496def main ():
486- with UnstructuredClient() as uc_client:
497+ with UnstructuredClient(
498+ server_url = " https://api.example.com" ,
499+ ) as uc_client:
487500 # Rest of application here...
488501
489502
490503# Or when using async:
491504async def amain ():
492- async with UnstructuredClient() as uc_client:
505+ async with UnstructuredClient(
506+ server_url = " https://api.example.com" ,
507+ ) as uc_client:
493508 # Rest of application here...
494509```
495510<!-- End Resource Management [resource-management] -->
@@ -505,7 +520,7 @@ from unstructured_client import UnstructuredClient
505520import logging
506521
507522logging.basicConfig(level = logging.DEBUG )
508- s = UnstructuredClient(debug_logger = logging.getLogger(" unstructured_client" ))
523+ s = UnstructuredClient(server_url = " https://example.com " , debug_logger = logging.getLogger(" unstructured_client" ))
509524```
510525<!-- End Debugging [debug] -->
511526
0 commit comments