Skip to content

Commit f50687b

Browse files
committed
♻️ refactor: package upgrade and refactor code
1. **devcontainer.json**: - Commend detailed steps for new image setup. 2. **chatgpt-mattermost-bot.code-workspace**: - Added Docker extension recommendation. 3. **compose.yaml**: - Fixed typo in service name. 4. **botservice.mjs**: - Added function to shorten long strings. - Added names to message roles. - Improved image resizing and format conversion logic. 5. **package.json**: - Updated dependency versions. @anthropic-ai/sdk ^0.20.5 → ^0.21.1 @eslint/js ^9.0.0 → ^9.3.0 @google/generative-ai ^0.7.0 → ^0.11.4 @mattermost/client ^9.6.0 → ^9.7.0 @mattermost/types ^9.6.0 → ^9.7.0 @swc/core ^1.4.14 → ^1.5.7 @swc/helpers ^0.5.10 → ^0.5.11 @types/node ^20.12.7 → ^20.12.12 cohere-ai ^7.9.4 → ^7.10.1 esbuild ^0.20.2 → ^0.21.3 eslint ^9.0.0 → ^9.3.0 openai ^4.35.0 → ^4.47.1 rimraf ^5.0.5 → ^5.0.7 sharp ^0.33.3 → ^0.33.4 textlint-rule-preset-ja-spacing ^2.3.1 → ^2.4.3 tsx ^4.7.2 → ^4.11.0 typescript-eslint ^7.7.0 → ^7.10.0 vitest ^1.5.0 → ^1.6.0 ws ^8.16.0 → ^8.17.0 6. **CohereAdapter.ts**: - Refactored code. 7. **GoogleGeminiAdapter.ts**: - Added function to shorten long strings. - Added names to message roles. 8. **botservice.ts**: - Added user names to messages. 9. **openai-wrapper.ts**: - Added logging for chat completions. - Added names to message roles. 10. **postMessage.ts**: - Added user names to messages. - Added support for environment variables to enhance application flexibility. - Refactored code to improve readability and maintainability. - Updated dependencies to apply the latest features and security patches.
1 parent c94eb9d commit f50687b

11 files changed

+1668
-923
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
2121
// "remoteUser": "root"
2222
}
23-
// 新しいイメージを持ってきたらsudo -E "apt update && apt install git-secrets connect-proxy"や~/.ssh/configが必要
23+
// 新しいイメージを持ってきたら
24+
// ID=$(docker ps |awk '$2~/^vsc-/{print $1}')
25+
// docker exec -u=root $ID sh -c "apt update && apt install git-secrets connect-proxy"
26+
// docker cp ~/.ssh/config $ID:/home/node/.ssh/
27+
// が必要
2428
// 鍵についてはssh-add -l で確認
2529
// 環境変数http_proxyや~/.gitconfigは、コンテナ作成時の値が自動的に登録されている。

chatgpt-mattermost-bot.code-workspace

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@
155155
"recommendations": [
156156
"dbaeumer.vscode-eslint",
157157
"esbenp.prettier-vscode",
158-
"taichi.vscode-textlint"
158+
"taichi.vscode-textlint",
159+
"ms-azuretools.vscode-docker"
159160
]
160161
}
161162
}

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
services:
3-
chatcpt:
3+
chatgpt:
44
image: ${CI_REGISTRY_IMAGE:-gitlab.example.com/user/chatgpt-mattermost-bot}:${CI_COMMIT_REF_NAME:-local}
55
build:
66
context: .

0 commit comments

Comments
 (0)