Skip to content

Commit 622c6eb

Browse files
committed
Increase timeout for all other backends to 120 secs
1 parent f87e6f5 commit 622c6eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/calibre/ai/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def _read_response(buffer: str) -> Iterator[dict[str, Any]]:
8282
yield json.loads(buffer)
8383

8484

85-
def read_streaming_response(rq: Request, provider_name: str = 'AI provider') -> Iterator[dict[str, Any]]:
86-
with opener().open(rq) as response:
85+
def read_streaming_response(rq: Request, provider_name: str = 'AI provider', timeout: int = 120) -> Iterator[dict[str, Any]]:
86+
with opener().open(rq, timeout=timeout) as response:
8787
if response.status != http.HTTPStatus.OK:
8888
details = ''
8989
with suppress(Exception):

0 commit comments

Comments
 (0)