@@ -48,6 +48,12 @@ def partition(
4848 else :
4949 base_url = self ._get_url (base_url , url_variables )
5050
51+ # Note(austin): Add a custom check to handle the default server URL
52+ # The SDK globally defaults to the platform URL.
53+ # If that hasn't changed, we need to switch to the partition url here.
54+ if base_url == "https://platform.unstructuredapp.io" :
55+ base_url = "https://api.unstructuredapp.io"
56+
5157 if not isinstance (request , BaseModel ):
5258 request = utils .unmarshal (request , operations .PartitionRequest )
5359 request = cast (operations .PartitionRequest , request )
@@ -175,6 +181,12 @@ async def partition_async(
175181 else :
176182 base_url = self ._get_url (base_url , url_variables )
177183
184+ # Note(austin): Add a custom check to handle the default server URL
185+ # The SDK globally defaults to the platform URL.
186+ # If that hasn't changed, we need to switch to the partition url here.
187+ if base_url == "https://platform.unstructuredapp.io" :
188+ base_url = "https://api.unstructuredapp.io"
189+
178190 if not isinstance (request , BaseModel ):
179191 request = utils .unmarshal (request , operations .PartitionRequest )
180192 request = cast (operations .PartitionRequest , request )
0 commit comments