Timeout (GPTApiService: GuzzleHttp, curl)

Created on 18 August 2023, about 1 year ago
Updated 8 September 2024, 2 months ago

Problem/Motivation

When I had to translate slightly larger texts or contenttpen with multiple fields, I often got a timeout and the translation via ChatGTP API could not be done (additionally a bit unattractive is that this error message from the timeout was then written directly into the content). With the present patch I have raised the default 30s to 5min (probably 3min would also do). It would be nice if this could be configured.

Additionally, it is not nice that the content is considered translated and the error message is copied into the content:

cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

Steps to reproduce

Have gpt-3.5-turbo-16k or gtp-4 in use, some longer TExt (~2k token) or partly already a content type with multiple fields. Timeout is too tight and translation via ChatGPT cannot be done.

Proposed resolution

1. the built-in timeout should be adjustable in the backend.
2. Error should be caught and displayed as error message. Content should then not be translated

🐛 Bug report
Status

Closed: works as designed

Version

2.1

Component

Code

Created by

🇨🇭Switzerland snsblvd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @snsblvd
  • Status changed to Postponed: needs info 4 months ago
  • 🇮🇳India anup.sinha Bengaluru

    Hi @snsblvd, the curl timeout is adjustable from the Drupal settings file. Please add the below line in settings.php and increase the time if you are still getting the error.

    $settings['http_client_config']['timeout'] =

  • Status changed to Closed: works as designed 2 months ago
  • 🇨🇭Switzerland snsblvd

    that seems to works, thx

Production build 0.71.5 2024