xitiomet / irc-gpt-bot

An IRC chat bot that uses chatGPT
Other
11 stars 1 forks source link

Run via systemd #1

Open Strykar opened 1 year ago

Strykar commented 1 year ago

If I start the bot pointing it to a config and not specifying gui mode, it still starts in ncurses mode, where I have to manually configure and start the bot. How does one start / manage the bot via systemd?

May 16 10:59:35 phragyaan systemd[1]: Started OpenAI Assistant (ChatGPT) IRC bot.
May 16 10:59:35 phragyaan irc-gpt-bot[11273]: 2023-05-16 10:59:35.715:INFO::main: Logging initialized @9ms to org.eclipse.jetty.util.log.StdErrLog
May 16 10:59:35 phragyaan irc-gpt-bot[11273]: java.lang.NullPointerException
May 16 10:59:35 phragyaan irc-gpt-bot[11273]:         at org.openstatic.IRCGPTBotMain.run(IRCGPTBotMain.java:342)
May 16 10:59:35 phragyaan irc-gpt-bot[11273]:         at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
May 16 10:59:35 phragyaan irc-gpt-bot[11273]:         at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
May 16 10:59:35 phragyaan irc-gpt-bot[11273]:         at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
May 16 10:59:35 phragyaan systemd[1]: chatgpt.service: Deactivated successfully.
Strykar commented 1 year ago

Also doesn't seem to work even in ncurses mode:

16:37 --> ChatGPT (OpenAI-Assistant) (~u@zywb4ieri6pdu.Lair) has joined #wakka
16:37 <Strykar> ChatGPT: who are you
16:37 <ChatGPT> I'm sorry, I'm having trouble thinking right now. Give me a few minutes and try again.
16:38 <Strykar> ChatGPT: who are you
16:38 <ChatGPT> I'm sorry, I'm having trouble thinking right now. Give me a few minutes and try again.
$ tail -f irc-gpt-bot-logs/exceptions.log 
    at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
    at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

[11:08:33 2023-05-16] Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
    at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
    at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
    at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
    at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

[11:08:41 2023-05-16] Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
    at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
    at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
    at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
    at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
    at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
Cabji commented 1 year ago

re: it not working, i found it doesn't really respond conversationally, it has to respond informationally. so asking it how it is, or what it is it doesn't know how to respond to that. ask it where you can find a cheap hard drive and it does better.

xitiomet commented 1 year ago

re: it not working, i found it doesn't really respond conversationally, it has to respond informationally. so asking it how it is, or what it is it doesn't know how to respond to that. ask it where you can find a cheap hard drive and it does better.

Sorry this one slipped by me, You can define its behavior using the "systemPreamble" field in the config file. For instance my example bot is emulating Charlie Kelly from always sunny in philidelphia, and will not answer technical questions

Try it here: http://irc.openstatic.org/

xitiomet commented 1 year ago

Also doesn't seem to work even in ncurses mode:

16:37 --> ChatGPT (OpenAI-Assistant) (~u@zywb4ieri6pdu.Lair) has joined #wakka
16:37 <Strykar> ChatGPT: who are you
16:37 <ChatGPT> I'm sorry, I'm having trouble thinking right now. Give me a few minutes and try again.
16:38 <Strykar> ChatGPT: who are you
16:38 <ChatGPT> I'm sorry, I'm having trouble thinking right now. Give me a few minutes and try again.
$ tail -f irc-gpt-bot-logs/exceptions.log 
  at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
  at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

[11:08:33 2023-05-16] Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
  at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
  at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
  at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
  at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

[11:08:41 2023-05-16] Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.openai.com/v1/chat/completions
  at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
  at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
  at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:77)
  at org.openstatic.ChatGPT$2.call(ChatGPT.java:58)
  at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

It looks like your system cannot connect to OpenAI's API. Perhaps a DNS issue or they had a temporary outage.

kath666 commented 9 months ago

I'm using Debian and your latest native deb.

hey BotGPT I'm sorry, I'm having trouble thinking right now. Give me a few minutes and try again. I have set new API key at https://platform.openai.com/api-keys (premium account) for bot and I get this: " Server returned HTTP response code: 429 for URL: https://api.openai.com/v1/chat/completions java.io.IOException: Server returned HTTP response code: 429 for URL: https://api.openai.com/v1/chat/completions at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993) at java.base@19.0.1/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585) at java.base@19.0.1/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) at org.openstatic.ChatGPT$2.call(ChatGPT.java:77) at org.openstatic.ChatGPT$2.call(ChatGPT.java:58) at java.base@19.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base@19.0.1/java.lang.Thread.run(Thread.java:1589) at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)"
xitiomet commented 9 months ago

Please see: https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests

Seems your bot was too active for their request limits. Was there a ton of people talking to it at once? Keep in mind free accounts also have a low rate limit.

kath666 commented 9 months ago

Please see: https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests

Seems your bot was too active for their request limits. Was there a ton of people talking to it at once? Keep in mind free accounts also have a low rate limit.

I'm using premium account + gives me that answer for first run (even if i don't use it via webpage for myself for a long time ( f. ex. a day)). I write command: hey botGPT

xitiomet commented 8 months ago

I would double check your OpenAI key to make sure its correct, this error is from OpenAI not irc-gpt-bot. Take a look at /var/log/irc-gpt-bot/openai.log I believe the monthly subscription is different then the pay as you go api service.

kath666 commented 8 months ago

I would double check your OpenAI key to make sure its correct, this error is from OpenAI not irc-gpt-bot. Take a look at /var/log/irc-gpt-bot/openai.log I believe the monthly subscription is different then the pay as you go api service.

API key is correct. Starts with sk-...........Sk39 (random) and the same line is added to bot.