Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

[ERROR] Processing message (139318381620712) by ai failed #4

Closed
p6002 opened this issue May 10, 2023 · 10 comments
Closed

[ERROR] Processing message (139318381620712) by ai failed #4

p6002 opened this issue May 10, 2023 · 10 comments

Comments

@p6002
Copy link

p6002 commented May 10, 2023

I managed to install the bot.
It was necessary to change the user in docker-compose from 1000:1000 to 0:0.
I added the phone number, connected via qr code.
In .env I added api openai and default_model to gpt.
When I send a message from the same phone number on the group, the console shows:

signal-aichat-signald  | 18:03:25.187 [[redacted 33]9c4-receiver] INFO  manager-[redacted 33]9c4 - received sent message transcript from device 1

But no response appears in the chat.
When I text from another phone number, I get a message in the console:

signal-aichat-bot      | 2023-05-10 18:04:51,988 bot: [INFO] Chat context created for 0g7Ruz0qsQdUFDDUBP5dyVRhodjhmtgK2HX9U/hXyo=+17c52f31-605f-4fe2-862e-5f10e2a6f27e
signal-aichat-bot      | 2023-05-10 18:04:51,988 bot: [ERROR] Processing message (139858331620142) by ai failed
signal-aichat-bot      | Traceback (most recent call last):
signal-aichat-bot      |   File "/home/signal-aichat/.local/lib/python3.10/site-packages/semaphore/bot.py", line 128, in _handle_message
signal-aichat-bot      |     await func(context)
signal-aichat-bot      |   File "/home/signal-aichat/signal-aichat.py", line 52, in ai
signal-aichat-bot      |     ctx.data["bing"] = Chatbot(cookie_path="./cookies.json")
signal-aichat-bot      |   File "/home/signal-aichat/.local/lib/python3.10/site-packages/EdgeGPT.py", line 590, in __init__
signal-aichat-bot      |     self.cookies = json.load(f)
signal-aichat-bot      |   File "/usr/local/lib/python3.10/json/__init__.py", line 293, in load
signal-aichat-bot      |     return loads(fp.read(),
signal-aichat-bot      |   File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
signal-aichat-bot      |     return _default_decoder.decode(s)
signal-aichat-bot      |   File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
signal-aichat-bot      |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
signal-aichat-bot      |   File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
signal-aichat-bot      |     raise JSONDecodeError("Expecting value", s, err.value) from None
signal-aichat-bot      | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@cycneuramus
Copy link
Owner

It seems like you haven't set up Bing with the necessary cookies.

@p6002
Copy link
Author

p6002 commented May 10, 2023

I added a bing cookie, it shows:

signal-aichat-bot      | 2023-05-10 18:46:29,212 bot: [INFO] Chat context created for 0n2Ruz0qsQdRFDMlUBP5dyVRhojhmmtgK3HX3U/hXyo=+17c62f31-605f-4fe2-862e-9l10e2a6f27e
signal-aichat-bot      | 2023-05-10 18:46:29,465 bot: [INFO] HTTP Request: GET https://edgeservices.bing.com/edgesvc/turing/conversation/create "HTTP/1.1 200 OK"
signal-aichat-bot      | 2023-05-10 18:46:29,466 bot: [ERROR] Processing message (139811234150880) by ai failed
signal-aichat-bot      | Traceback (most recent call last):
signal-aichat-bot      |   File "/home/signal-aichat/.local/lib/python3.10/site-packages/semaphore/bot.py", line 128, in _handle_message
signal-aichat-bot      |     await func(context)
signal-aichat-bot      |   File "/home/signal-aichat/signal-aichat.py", line 81, in ai
signal-aichat-bot      |     response = await triggers[default_model](text, ctx)
signal-aichat-bot      | KeyError: 'gpt'

My .env file:

# Signal
SIGNAL_PHONE_NUMBER=+3--------98

# ChatGPT
OPENAI_API_KEY=sk-yPl4---------

# Llama
#CACHE=1
#HOST=0.0.0.0
#PORT=8000
#MODEL=/llama.cpp/models/GPT4xAlpaca.bin
#LLAMA_API_BASE=http://signal-aichat-llama:8000/v1

# Default model options are bing, gpt, or llama
DEFAULT_MODEL=gpt

@cycneuramus
Copy link
Owner

The KeyError was a bug that I have hopefully fixed now.

About the Bing cookie, it's not great that currently you have to set it up even if you don't intend to use Bing or else the bot will crash. I'll try to make it possible to configure what models to enable/disable sometime in the coming days.

@p6002
Copy link
Author

p6002 commented May 10, 2023

I'll try to make it possible to configure what models to enable/disable sometime in the coming days.

That would be cool, I'll be waiting.

@cycneuramus
Copy link
Owner

cycneuramus commented May 11, 2023

@p6002 This should now be possible with the latest release.

@p6002
Copy link
Author

p6002 commented May 11, 2023

Thanks, Bing started working and giving answers from internet (with a limit I guess) after couple messages:
I encountered an error: sent 1000 (OK); then received 1000 (OK)
This is free api limit?

Sometimes:
I encountered an error: 'adaptiveCards'

And maybe can I change Bing language in answered messages? Should be possible i think.

GPT quotes and sends a message but only with an error:

I encountered an error: Error communicating with OpenAI: Invalid URL 'None/chat/completions': No scheme supplied. Perhaps you meant https://None/chat/completions?

@cycneuramus
Copy link
Owner

About Bing API limits, I actually don't know. The GPT error though is a bug that should be fixed now with v0.3.1.

@p6002
Copy link
Author

p6002 commented May 11, 2023

l'll be waiting, it would also be nice to see the ability to change the language, or the ability to direct the bot with text like in the web version.

@cycneuramus
Copy link
Owner

Features like those would have to be implemented in the library I'm using. Though the bot will reply in whatever language your write to it, no?

@p6002
Copy link
Author

p6002 commented May 11, 2023

Ok I'll take a peek at what you posted, because in addition to gpt bing can also be a useful assistant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants