Openhab ChatGPT: HTTP Timeout

Hi,

I am using chatGPT in my openhab 4.1.1 and I want to try to get some (longer) text results.
In 90% of my calls I always get an empty result - resp. no result into my string variable.

I turned on now my logs to TRACE for ChatGPT and now it writes down:

2024-01-20 19:26:35.074 [DEBUG] [ding.chatgpt.internal.ChatGPTHandler] - Request to OpenAI failed: Total timeout 10000 ms elapsed
java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
at org.eclipse.jetty.client.HttpConnection$RequestTimeouts.onExpired(HttpConnection.java:334) ~[?:?]
at org.eclipse.jetty.client.HttpConnection$RequestTimeouts.onExpired(HttpConnection.java:314) ~[?:?]
at org.eclipse.jetty.io.CyclicTimeouts.onTimeoutExpired(CyclicTimeouts.java:110) ~[?:?]
at org.eclipse.jetty.io.CyclicTimeouts.access$100(CyclicTimeouts.java:50) ~[?:?]
at org.eclipse.jetty.io.CyclicTimeouts$Timeouts.onTimeoutExpired(CyclicTimeouts.java:196) ~[?:?]
at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:298) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]

Could it be necessary to increase the timeout in my http.cfg?
I did not configure any timeout there. At least from the standard documentation it says something about 5000msec. So I have no clue where these 10.000msec come from.

Any Ideas? Thx for your support

I made some more tests.

1.) Changes in http.cfg do not change anything. even if I set timeout to 11000msec, the logfile of chatgpt binding says: timeout 10000 => seems that this timeout comes from somewhere else?

2.) If I just “ask” a short question or give chatgpt a short input, then the reply works. for example “Answer in 2-3 sentences”. So the basic functionallity obviously works, but I did not find out yet where I can overwrite the timeout of 10000msec. any Ideas?

I found a temporary workaround:
1.) i am using curl-chatgpt (from github) on my command line (Linux crontab) and create an output-file every x minutes
2.) in my openhab rule I import the textfile and make a postupdate to a String variable

so finally, I do not need the chatgpt Plugin for larger texts which need more than the (wherever configured…?) timeout of 10000msec

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.