Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/unstract/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.31.0"
__version__ = "0.31.1"


def get_sdk_version():
Expand Down
2 changes: 1 addition & 1 deletion src/unstract/sdk/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def index_file(
)

@deprecated(
"Deprecated class and method. Use Index and query_texy_from_index() instead"
"Deprecated class and method. Use Index and query_index() instead"
)
def get_text_from_index(
self, embedding_type: str, vector_db: str, doc_id: str
Expand Down
11 changes: 2 additions & 9 deletions src/unstract/sdk/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, Optional

import requests
from requests import ConnectionError, RequestException, Response, Timeout
from requests import ConnectionError, RequestException, Response

from unstract.sdk.constants import LogLevel, PromptStudioKeys, ToolEnv
from unstract.sdk.helper import SdkHelper
Expand Down Expand Up @@ -68,21 +68,14 @@ def _post_call(self, url_path: str, payload: dict[str, Any]) -> dict[str, Any]:
headers: dict[str, str] = {"Authorization": f"Bearer {self.bearer_token}"}
response: Response = Response()
try:
response = requests.post(url, json=payload, headers=headers, timeout=600)
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
result["status"] = "OK"
result["structure_output"] = response.text
except ConnectionError as connect_err:
msg = "Unable to connect to prompt service. Please contact admin."
self._stringify_and_stream_err(connect_err, msg)
result["error"] = msg
except Timeout as time_out:
msg = (
"Request to run prompt has timed out. "
"Probable causes might be connectivity issues in LLMs."
)
self._stringify_and_stream_err(time_out, msg)
result["error"] = msg
except RequestException as e:
# Extract error information from the response if available
error_message = str(e)
Expand Down