diff --git a/src/unstract/sdk/__init__.py b/src/unstract/sdk/__init__.py index a6c3378f..370f4993 100644 --- a/src/unstract/sdk/__init__.py +++ b/src/unstract/sdk/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.45.0" +__version__ = "0.45.1" def get_sdk_version(): diff --git a/src/unstract/sdk/adapter.py b/src/unstract/sdk/adapter.py index 538866a3..8dcf4426 100644 --- a/src/unstract/sdk/adapter.py +++ b/src/unstract/sdk/adapter.py @@ -78,7 +78,7 @@ def _get_adapter_configuration( msg = AdapterUtils.get_msg_from_request_exc( err=e, message_key="error", default_err=default_err ) - raise SdkError(f"Error while retrieving adapter. {msg}") + raise SdkError(f"Error retrieving adapter. {msg}") return adapter_data @staticmethod diff --git a/src/unstract/sdk/embedding.py b/src/unstract/sdk/embedding.py index 1ceee3b1..e3c8f2a1 100644 --- a/src/unstract/sdk/embedding.py +++ b/src/unstract/sdk/embedding.py @@ -1,8 +1,8 @@ from typing import Any, Optional +from deprecated import deprecated from llama_index.core.base.embeddings.base import Embedding from llama_index.core.embeddings import BaseEmbedding -from typing_extensions import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.constants import Common @@ -38,9 +38,7 @@ def _initialise(self): self._length: int = self._get_embedding_length() self._usage_kwargs["adapter_instance_id"] = self._adapter_instance_id - if not SdkHelper.is_public_adapter( - adapter_id=self._adapter_instance_id - ): + if not SdkHelper.is_public_adapter(adapter_id=self._adapter_instance_id): platform_api_key = self._tool.get_env_or_die(ToolEnv.PLATFORM_API_KEY) CallbackManager.set_callback( platform_api_key=platform_api_key, diff --git a/src/unstract/sdk/index.py b/src/unstract/sdk/index.py index 9bf93bde..283e83db 100644 --- a/src/unstract/sdk/index.py +++ b/src/unstract/sdk/index.py @@ -2,6 +2,7 @@ import logging from typing import Any, Callable, Optional +from deprecated import deprecated from llama_index.core import Document from llama_index.core.node_parser import SimpleNodeParser from llama_index.core.vector_stores import ( @@ -11,7 +12,6 @@ VectorStoreQuery, VectorStoreQueryResult, ) -from typing_extensions import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.exceptions import AdapterError diff --git a/src/unstract/sdk/llm.py b/src/unstract/sdk/llm.py index ccfc35fb..f8e903bc 100644 --- a/src/unstract/sdk/llm.py +++ b/src/unstract/sdk/llm.py @@ -2,12 +2,12 @@ import re from typing import Any, Callable, Optional +from deprecated import deprecated from llama_index.core.base.llms.types import CompletionResponseGen from llama_index.core.llms import LLM as LlamaIndexLLM from llama_index.core.llms import CompletionResponse from openai import APIError as OpenAIAPIError from openai import RateLimitError as OpenAIRateLimitError -from typing_extensions import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.constants import Common diff --git a/src/unstract/sdk/ocr.py b/src/unstract/sdk/ocr.py index 63b7c070..3ed3df93 100644 --- a/src/unstract/sdk/ocr.py +++ b/src/unstract/sdk/ocr.py @@ -1,7 +1,7 @@ from abc import ABCMeta from typing import Optional -from typing_extensions import deprecated +from deprecated import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.constants import Common diff --git a/src/unstract/sdk/utils/callback_manager.py b/src/unstract/sdk/utils/callback_manager.py index 3931c452..03fcbd0e 100644 --- a/src/unstract/sdk/utils/callback_manager.py +++ b/src/unstract/sdk/utils/callback_manager.py @@ -2,11 +2,11 @@ from typing import Callable, Optional, Union import tiktoken +from deprecated import deprecated from llama_index.core.callbacks import CallbackManager as LlamaIndexCallbackManager from llama_index.core.callbacks import TokenCountingHandler from llama_index.core.embeddings import BaseEmbedding from llama_index.core.llms import LLM -from typing_extensions import deprecated from unstract.sdk.utils.usage_handler import UsageHandler diff --git a/src/unstract/sdk/vector_db.py b/src/unstract/sdk/vector_db.py index 4c114d34..2c873f2d 100644 --- a/src/unstract/sdk/vector_db.py +++ b/src/unstract/sdk/vector_db.py @@ -2,6 +2,7 @@ from collections.abc import Sequence from typing import Any, Optional, Union +from deprecated import deprecated from llama_index.core import StorageContext, VectorStoreIndex from llama_index.core.indices.base import IndexType from llama_index.core.schema import BaseNode, Document @@ -10,7 +11,6 @@ VectorStore, VectorStoreQueryResult, ) -from typing_extensions import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.constants import Common diff --git a/src/unstract/sdk/x2txt.py b/src/unstract/sdk/x2txt.py index 25645079..ef498fe1 100644 --- a/src/unstract/sdk/x2txt.py +++ b/src/unstract/sdk/x2txt.py @@ -2,7 +2,7 @@ from typing import Any, Optional import pdfplumber -from typing_extensions import deprecated +from deprecated import deprecated from unstract.sdk.adapter import ToolAdapter from unstract.sdk.adapters.constants import Common