diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e2b1e073..4dd2cbfba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ -## 0.5.2-dev0 +## 0.5.2-dev1 ### Enhancements * **Only embed elements with text** - Only embed elements with text to avoid errors from embedders and optimize calls to APIs. +### Fixes + +* **Address forward compatibility issue in unstructured-client** - As of unstructured-client==0.30.0, the `server_url` is passed to the method rather than the client instance. + ## 0.5.1 ### Fixes diff --git a/unstructured_ingest/__version__.py b/unstructured_ingest/__version__.py index f617ee1a1..e42bb33db 100644 --- a/unstructured_ingest/__version__.py +++ b/unstructured_ingest/__version__.py @@ -1 +1 @@ -__version__ = "0.5.2-dev0" # pragma: no cover +__version__ = "0.5.2-dev1" # pragma: no cover diff --git a/unstructured_ingest/v2/unstructured_api.py b/unstructured_ingest/v2/unstructured_api.py index 47b56f3db..1d27573c4 100644 --- a/unstructured_ingest/v2/unstructured_api.py +++ b/unstructured_ingest/v2/unstructured_api.py @@ -87,13 +87,16 @@ async def call_api_async( """ from unstructured_client import UnstructuredClient + # Note(austin) - the sdk takes the base url, but users may pass the full endpoint + # For consistency, strip off the path when it's given + base_url = server_url[:-19] if "/general/v0/general" in server_url else server_url + client = UnstructuredClient( - server_url=server_url, api_key_auth=api_key, ) partition_request = create_partition_request(filename=filename, parameters_dict=api_parameters) try: - res = await client.general.partition_async(request=partition_request) + res = await client.general.partition_async(server_url=base_url, request=partition_request) except Exception as e: raise wrap_error(e) @@ -115,13 +118,16 @@ def call_api( """ from unstructured_client import UnstructuredClient + # Note(austin) - the sdk takes the base url, but users may pass the full endpoint + # For consistency, strip off the path when it's given + base_url = server_url[:-19] if "/general/v0/general" in server_url else server_url + client = UnstructuredClient( - server_url=server_url, api_key_auth=api_key, ) partition_request = create_partition_request(filename=filename, parameters_dict=api_parameters) try: - res = client.general.partition(request=partition_request) + res = client.general.partition(server_url=base_url, request=partition_request) except Exception as e: raise wrap_error(e)