feat(openai): add chat streaming and model commands

- add /openai (/chatgpt) chat command using OpenAI Responses API (streaming + incremental edits)
- add /openAIListModels, /openAIGetModel, /openAISetModel
- introduce base Command class and migrate non-chat commands to it
- wire OpenAI client + env vars (OPENAI_API_KEY, OPENAI_MODEL)
- bump deps (@google/genai, systeminformation, @types/node) and add openai
This commit is contained in:
2026-02-03 13:39:01 +03:00
parent 810151263d
commit a736f786c2
58 changed files with 512 additions and 211 deletions
+34 -12
View File
@@ -8,7 +8,7 @@
"name": "tg-chat-bot",
"version": "1.0.0",
"dependencies": {
"@google/genai": "^1.38.0",
"@google/genai": "^1.39.0",
"@libsql/client": "^0.17.0",
"@mistralai/mistralai": "^1.13.0",
"@napi-rs/canvas": "^0.1.89",
@@ -17,19 +17,20 @@
"drizzle-orm": "^1.0.0-beta.12-5845444",
"emoji-regex": "^10.6.0",
"ollama": "^0.6.3",
"openai": "^6.17.0",
"puppeteer": "^24.36.1",
"puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2",
"qrcode": "^1.5.4",
"sharp": "^0.34.5",
"systeminformation": "^5.30.6",
"systeminformation": "^5.30.7",
"twemoji": "^14.0.2",
"typescript-telegram-bot-api": "^0.11.0",
"youtubei.js": "^16.0.1"
},
"devDependencies": {
"@types/bun": "^1.3.8",
"@types/node": "^25.1.0",
"@types/node": "^25.2.0",
"@types/qrcode": "^1.5.6",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
@@ -975,9 +976,9 @@
}
},
"node_modules/@google/genai": {
"version": "1.38.0",
"resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.38.0.tgz",
"integrity": "sha512-V/4CQVQGovvGHuS73lwJwHKR9x33kCij3zz/ReEQ4A7RJaV0U7m4k1mvYhFk55cGZdF5JLKu2S9BTaFuEs5xTA==",
"version": "1.39.0",
"resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.39.0.tgz",
"integrity": "sha512-Vz7AQsOdBeiIcxmXIQNy/hzDvyAOE1lSpWA10itUQza7h3aQFF6QSGaQ7o1GYsjMD3XslK4Ee/Ol0eLhRXb7gA==",
"license": "Apache-2.0",
"dependencies": {
"google-auth-library": "^10.3.0",
@@ -2242,9 +2243,9 @@
}
},
"node_modules/@types/node": {
"version": "25.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.1.0.tgz",
"integrity": "sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.0.tgz",
"integrity": "sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==",
"license": "MIT",
"dependencies": {
"undici-types": "~7.16.0"
@@ -5303,6 +5304,27 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/openai": {
"version": "6.17.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-6.17.0.tgz",
"integrity": "sha512-NHRpPEUPzAvFOAFs9+9pC6+HCw/iWsYsKCMPXH5Kw7BpMxqd8g/A07/1o7Gx2TWtCnzevVRyKMRFqyiHyAlqcA==",
"license": "Apache-2.0",
"bin": {
"openai": "bin/cli"
},
"peerDependencies": {
"ws": "^8.18.0",
"zod": "^3.25 || ^4.0"
},
"peerDependenciesMeta": {
"ws": {
"optional": true
},
"zod": {
"optional": true
}
}
},
"node_modules/optionator": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@@ -6351,9 +6373,9 @@
}
},
"node_modules/systeminformation": {
"version": "5.30.6",
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.30.6.tgz",
"integrity": "sha512-LEIyK1aEv5P3BhAPW3swdlIyCihxwEq/Gki+kcONieU4PIeRCSLDuGkk0Va/56PSBgjVgEksOM88dmY6YqOyfQ==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.30.7.tgz",
"integrity": "sha512-33B/cftpaWdpvH+Ho9U1b08ss8GQuLxrWHelbJT1yw4M48Taj8W3ezcPuaLoIHZz5V6tVHuQPr5BprEfnBLBMw==",
"license": "MIT",
"os": [
"darwin",