|
2 | 2 | from typing import Any, Optional |
3 | 3 |
|
4 | 4 | import requests |
5 | | -from requests import ConnectionError, RequestException, Response, Timeout |
| 5 | +from requests import ConnectionError, RequestException, Response |
6 | 6 |
|
7 | 7 | from unstract.sdk.constants import LogLevel, PromptStudioKeys, ToolEnv |
8 | 8 | from unstract.sdk.helper import SdkHelper |
@@ -68,21 +68,14 @@ def _post_call(self, url_path: str, payload: dict[str, Any]) -> dict[str, Any]: |
68 | 68 | headers: dict[str, str] = {"Authorization": f"Bearer {self.bearer_token}"} |
69 | 69 | response: Response = Response() |
70 | 70 | try: |
71 | | - response = requests.post(url, json=payload, headers=headers, timeout=600) |
| 71 | + response = requests.post(url, json=payload, headers=headers) |
72 | 72 | response.raise_for_status() |
73 | 73 | result["status"] = "OK" |
74 | 74 | result["structure_output"] = response.text |
75 | 75 | except ConnectionError as connect_err: |
76 | 76 | msg = "Unable to connect to prompt service. Please contact admin." |
77 | 77 | self._stringify_and_stream_err(connect_err, msg) |
78 | 78 | result["error"] = msg |
79 | | - except Timeout as time_out: |
80 | | - msg = ( |
81 | | - "Request to run prompt has timed out. " |
82 | | - "Probable causes might be connectivity issues in LLMs." |
83 | | - ) |
84 | | - self._stringify_and_stream_err(time_out, msg) |
85 | | - result["error"] = msg |
86 | 79 | except RequestException as e: |
87 | 80 | # Extract error information from the response if available |
88 | 81 | error_message = str(e) |
|
0 commit comments