From ce893c1b221dfea2c1421a5f54dd8159f6fff601 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 22 Feb 2024 15:41:11 +0200 Subject: [PATCH] Downgrade ChatGPT (3.1.5 -> 3.1.4) The new version is very broken. It has at least 2 issues. The first one is: ``` Error: maxPromptTokens + max_tokens (3097 + 1024 = 4121) must be less than or equal to maxContextTokens (4097) at ChatGPTClient.setOptions (file:///usr/src/app/node_modules/@waylaidwanderer/chatgpt-api/src/ChatGPTClient.js:72:19) at new ChatGPTClient (file:///usr/src/app/node_modules/@waylaidwanderer/chatgpt-api/src/ChatGPTClient.js:23:14) at main (file:///usr/src/app/dist/index.js:62:21) at file:///usr/src/app/dist/index.js:94:1 at ModuleJob.run (node:internal/modules/esm/module_job:218:25) at async ModuleLoader.import (node:internal/modules/esm/loader:329:24) at async loadESM (node:internal/process/esm_loader:28:7) at async handleMainPromise (node:internal/modules/run_main:113:12) ``` Likely related to: - https://github.com/matrixgpt/matrix-chatgpt-bot/issues/246 - https://github.com/matrixgpt/matrix-chatgpt-bot/pull/248 It can be tweaked around by overriding some default environment variables (`roles/custom/matrix-bot-chatgpt/templates/env.j2`) in order to tweak them: ``` CHATGPT_MAX_CONTEXT_TOKENS=4097 CHATGPT_MAX_PROMPT_TOKENS=2500 ``` This leads us to another issue: ``` node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */); ^ [Error: Failed to deserialize or serialize a JSON value missing field `version` at line 1 column 6704] { code: 'GenericFailure' } Node.js v20.11.1 error Command failed with exit code 1. ``` ... whatever that means. --- roles/custom/matrix-bot-chatgpt/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-bot-chatgpt/defaults/main.yml b/roles/custom/matrix-bot-chatgpt/defaults/main.yml index 7aa14e34b..957501b01 100644 --- a/roles/custom/matrix-bot-chatgpt/defaults/main.yml +++ b/roles/custom/matrix-bot-chatgpt/defaults/main.yml @@ -5,7 +5,7 @@ matrix_bot_chatgpt_enabled: true # renovate: datasource=docker depName=ghcr.io/matrixgpt/matrix-chatgpt-bot -matrix_bot_chatgpt_version: 3.1.5 +matrix_bot_chatgpt_version: 3.1.4 matrix_bot_chatgpt_container_image_self_build: false matrix_bot_chatgpt_container_image_self_build_repo: "https://github.com/matrixgpt/matrix-chatgpt-bot"