Closed jaodei closed 1 year ago
With this pr https://github.com/waylaidwanderer/node-chatgpt-api/pull/312, you can use following image that supports arm64.
change
hibobmaster/node-chatgpt-api
to ghcr.io/waylaidwanderer/node-chatgpt-api
hibobmaster/node-chatgpt-api
now supports arm64 too.
Great. Thank you.
I've encountered error of "Error, please retry" when I interacted with Bing Chat. It was OK. Then I tried to start from almost scratch. Then I got below error from docker logs node-chatgpt-api: @waylaidwanderer/chatgpt-api@1.37.0 start node bin/server.js Error: the settings.js file does not exist.
Is that because of the recent updates of both matrixchatgptbot and ghcr.io/waylaidwanderer/node-chatgpt-api?
For your info, I give the contents of key files below. Please could you give me some insights? Thank you. file compose.yaml _services: app: image: hibobmaster/matrixchatgptbot:latest container_name: matrix-bot-bingai1 restart: always volumes:
File config.json: I only run Bing Chat in this instance _{ "homeserver": "http://matrix-nginx-proxy:12080", "user_id": "@bingai:mydomain.com", "password": "999999999999999999999999999", "device_id": "bingai-docker", "bing_api_endpoint": "http://node-chatgpt-api:3000/conversation", "jailbreakEnabled": true, "markdownformatted": true }
File settings.js: _export default { cacheOptions: {}, storageFilePath: process.env.STORAGE_FILE_PATH || './cache.json', bingAiClient: { // Necessary for some people in different countries, e.g. China (https://cn.bing.com) host: '', userToken: 'mytoken-here', debug: true, }, // Options for the API server apiOptions: { port: process.env.API_PORT || 3000, host: process.env.APIHOST || 'localhost', debug: true, clientToUse: 'bing', perMessageClientOptionsWhitelist: { validClientsToUse: ['bing'], }, }, // Options for the CLI app cliOptions: { // (Optional) Possible options: chatgpt, bing. // clientToUse: 'bing', }, }
Your config.json
has one error:
- "bing_api_endpoint": "http://node-chatgpt-api:3000/conversation",
+ "bing_api_endpoint": "http://api:3000/conversation",
compose.yaml
services:
app:
image: hibobmaster/matrixchatgptbot:latest
container_name: matrix-bot-bingai1
restart: always
volumes:
- ./config.json:/app/config.json
- ./db:/app/db
networks:
- matrix
api:
image: ghcr.io/waylaidwanderer/node-chatgpt-api:latest
container_name: node-chatgpt-api
restart: always
volumes:
- ./settings.js:/var/chatgpt-api/settings.js
networks:
- matrix
networks:
matrix:
external: true
Make sure there is a settings.js
in the current working directory.
It seems both http://node-chatgpt-api:3000/conversation and http://api:3000/conversation work. Anyway, I take your advice.
I have the setttings.js file in the right place.
However, the error of "Error: the settings.js file does not exist." is still there. If I change the latest version of ghcr.io/waylaidwanderer/node-chatgpt-api to a previous one v1.36.0, which luckily I have a copy in the server, the error is gone. But still I have the error of "Error, please retry" when I interact with bing chat. Another look at the log file, it says Bing service unavailable. Do you have the same issue? I can confirm I put the right bing token.
update compose.yaml
- ./settings.js:/var/chatgpt-api/settings.js
+ ./settings.js:/app/settings.js
services:
app:
image: hibobmaster/matrixchatgptbot:latest
container_name: matrix-bot-bingai1
restart: always
volumes:
- ./config.json:/app/config.json
- ./db:/app/db
networks:
- matrix
api:
image: ghcr.io/waylaidwanderer/node-chatgpt-api:latest
container_name: node-chatgpt-api
restart: always
volumes:
- ./settings.js:/app/settings.js
networks:
- matrix
networks:
matrix:
external: true
There are some bugs in the official https://github.com/waylaidwanderer/node-chatgpt-api dockerfile, i will try to fix it
cool. updated compose.yaml. it works. however, still got an error: _matrix-bot-bingai1 | await execute_callback(cb.func, room, event) matrix-bot-bingai1 | File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 254, in execute_callback matrix-bot-bingai1 | return await func(*args) matrix-bot-bingai1 | ^^^^^^^^^^^^^^^^^ matrix-bot-bingai1 | File "/app/bot.py", line 232, in message_callback matrix-bot-bingai1 | if sender_id not in self.pandora_data: matrix-bot-bingai1 | ^^^^^^^^^^^^^^^^^ matrix-bot-bingai1 | AttributeError: 'Bot' object has no attribute 'pandora_data'. Did you mean: 'pandora_init'? matrix-bot-bingai1 | Unclosed client session matrix-bot-bingai1 | client_session: <aiohttp.client.ClientSession object at 0xffff97ebb910> matrix-bot-bingai1 | Unclosed connector matrix-bot-bingai1 | connections: ['[(<aiohttp.clientproto.ResponseHandler object at 0xffff97e9d160>, 5412.762922734)]'] matrix-bot-bingai1 | connector: <aiohttp.connector.TCPConnector object at 0xffff97ebb950> matrix-bot-bingai1 exited with code 0 matrix-bot-bingai1 | 2023-06-01 01:06:35,706 - INFO - matrix chatgpt bot start..... matrix-bot-bingai1 | 2023-06-01 01:06:35,707 - INFO - Login via password
I dont have any pandora key, is that the cause? Thank you.
cool. updated compose.yaml. it works. however, still got an error: _matrix-bot-bingai1 | await execute_callback(cb.func, room, event) matrix-bot-bingai1 | File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 254, in execute_callback matrix-bot-bingai1 | return await func(*args) matrix-bot-bingai1 | ^^^^^^^^^^^^^^^^^ matrix-bot-bingai1 | File "/app/bot.py", line 232, in message_callback matrix-bot-bingai1 | if sender_id not in self.pandora_data: matrix-bot-bingai1 | ^^^^^^^^^^^^^^^^^ matrix-bot-bingai1 | AttributeError: 'Bot' object has no attribute 'pandora_data'. Did you mean: 'pandora_init'? matrix-bot-bingai1 | Unclosed client session matrix-bot-bingai1 | client_session: <aiohttp.client.ClientSession object at 0xffff97ebb910> matrix-bot-bingai1 | Unclosed connector matrix-bot-bingai1 | connections: ['[(<aiohttp.clientproto.ResponseHandler object at 0xffff97e9d160>, 5412.762922734)]'] matrix-bot-bingai1 | connector: <aiohttp.connector.TCPConnector object at 0xffff97ebb950> matrix-bot-bingai1 exited with code 0 matrix-bot-bingai1 | 2023-06-01 01:06:35,706 - INFO - matrix chatgpt bot start..... matrix-bot-bingai1 | 2023-06-01 01:06:35,707 - INFO - Login via password
I dont have any pandora key, is that the cause? Thank you.
https://github.com/hibobmaster/matrix_chatgpt_bot/wiki/ChatGPT-Web
@jaodei
https://github.com/waylaidwanderer/node-chatgpt-api/pull/399
change ghcr.io/waylaidwanderer/node-chatgpt-api:latest
to hibobmaster/node-chatgpt-api:latest
Verify if it is working.
changed.
but got similar or same error as below.
: matrix-bot-bingai1 | 2023-06-01 01:35:14,436 - INFO - matrix chatgpt bot start.....
: matrix-bot-bingai1 | 2023-06-01 01:35:14,438 - INFO - Login via password
: matrix-bot-bingai1 | Traceback (most recent call last):
: matrix-bot-bingai1 | File "/app/main.py", line 83, in
AttributeError: 'Bot' object has no attribute 'pandora_data'. Did you mean: 'pandora_init'?
Do you provide accessToken
as mentioned in https://github.com/hibobmaster/matrix_chatgpt_bot/wiki/ChatGPT-Web
Pandora is used to ChatGPT web and it is not related to bing ai.
No. I have no such token in configuration. I don't need chatgpt web at least for now.
Well. I don't have such configuration at all.
BTW, if I provide this token, I don't need openai API key?
Well. I don't have such configuration at all.
BTW, if I provide this token, I don't need openai API key?
Sorry, my fault. I found a bug in program.
Yes, if you provide access_token, there is no need to use openai API key.
!talk
, !goon
, !new
commands will use ChatGPT web which is free.
https://github.com/hibobmaster/matrix_chatgpt_bot/commit/985db37be2e037136b8baab2159a43b99ad28897 Can you pull the latest docker image again and verify if it work?
It works. Thank you for your great work.
Bing Chat is just quite slow. Takes a minute or so to get a reply. Are you experiencing the same?
@jaodei Thank you for your bug report.
I have the same feeling as you, Bing Chat is really slow. As you may see https://github.com/waylaidwanderer/node-chatgpt-api/commit/90300946bc33c208007346cbecce4b37219cd5ea increase timeout value to 300 seconds.
Hi, I got error below while running on an amd64 based machine.
# got error: ✔ Container node-chatgpt-api Started0.4s image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was re[+] Running 3/3trix-bot-bingai1 ✔ Container node-chatgpt-api Started0.4s image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was re ✔ Container matrix-bot-bingai1 Started0.4s ! api The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
But it appears the two containers are running though if I ask bing, it will have lots of errors with the most recent ones as below from docker logs command. _Traceback (most recent call last): File "/app/bing.py", line 28, in ask_bing resp = await self.session.post(url=self.bing_api_endpoint, json=self.data, timeout=120) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection raise ClientConnectorError(req.connection_key, exc) from exc aiohttp.clientexceptions.ClientConnectorError: Cannot connect to host node-chatgpt-api:3000 ssl:default [Try again]
Is this due to the lack support of arm64? Cheers.