-
Notifications
You must be signed in to change notification settings - Fork 54
Comparing changes
Open a pull request
base repository: yGuy/chatgpt-mattermost-bot
base: master
head repository: takuya-o/chatgpt-mattermost-bot
compare: master
Commits on May 29, 2023
-
✨ Feature(src/openai-thread-completion.js): add support for Azure Op…
…enAI Service If setting Azure OpenAI API key instead of OpenAI API key, it uses Azure OpenAI Service. The instance name, deployment name and API version are now configurable via environment variables. The API request base path and headers are set upped accordingly to use the Azure OpenAI Service API.
Configuration menu - View commit details
-
Copy full SHA for 7caaeb3 - Browse repository at this point
Copy the full SHA 7caaeb3View commit details
Commits on Jun 19, 2023
-
🆕 feat Migrated to TypeScript.
- Formatted by Prettier - Lint by eslint - Build by esbuild ✨ Token-count-based conversation thread management ✨ Splitting message that are too long ✨ Support GitLab AutoDevOps by test dummy
Configuration menu - View commit details
-
Copy full SHA for 537d514 - Browse repository at this point
Copy the full SHA 537d514View commit details
Commits on Jul 19, 2023
-
✨ feat(botservice.ts): Changed to respond to system notifications col…
…lectively Because of splitting messages results in slow response. ✨ feat(package.json): add bugs and homepage URLs for issue reporting and project homepage 🐛 fix(package.json): add npm dedup to upgrade script 🔧 chore(package.json): update versions of dev dependencies 🔧 fix(botservice.ts): filter and modify messages to remove system messages and their lines 🐛 fix(botservice.ts): change variable name case from lowercase limit_tokes to uppercase LIMIT_TOKENS to improve semantics ✨ feat(botservice.ts): add expireMessages function to remove old messages ✨ feat: added functionality to add completion and modify last line when continuing a thread 🐛 fix: removed unnecessary function call and added debug information to log 🔧 fix(mm-client.ts): fix import order of packages 🔧 fix(openai-thread-completion.ts): change variable name to uppercase MAX_TOKENS ✨ feat(openai-thread-completion.ts): add usage statistics for the response 🔧 fix(process-graph-response.ts): fix import order Added bugs and homepage URLs to package.json for issue reporting and accessing the project homepage, allowing users to report issues and access the project's homepage. Added npm dedup to the upgrade script, which resolves dependency duplication and keeps package versions up to date. Updated versions of dev dependencies, allowing the use of the latest versions of tools such as TypeScript and ESLint. Filtered and modified the messages to remove system messages and their lines. This results in a cleaner display of messages within threads. By changing the variable name to LIMIT_TOKENS, the limit value for tokens becomes more clear. The addition of the expireMessages function allows for the removal of old messages. This ensures that the total token count of the messages does not exceed the limit. When continuing a thread, the continueThread function is used to add completion to the reply message. The modifyLastLine function is used to modify the last line. The modified answer is then passed to the newPost function to be posted, allowing the thread to continue. Additionally, debug information is added to the log.
Configuration menu - View commit details
-
Copy full SHA for 13bfe96 - Browse repository at this point
Copy the full SHA 13bfe96View commit details
Commits on Aug 13, 2023
-
Merge branch 'yGuy/master' into release
✨ Upgrade 2.1.2 from upstream
Configuration menu - View commit details
-
Copy full SHA for be8e4bf - Browse repository at this point
Copy the full SHA be8e4bfView commit details -
🧰 Made upstream 2.1.2 features work fine
✨ feat(openai-wrapper.ts): Added a function to use the original OpenAI for image generation even if you are using Azure OpenAI 🔧 fix(Dockerfile, compose.yaml): downgrade Node version from 20 to 16 and add new environment variables 🐛 fix(botservice.ts): correct update of answer variable in postMessage function to prevent duplication of error messages 🔧 Refactoring: Converted plugin and types files to ES modules and performed code formatting 🔧 fix(tsconfig.json): update module resolution settings 🔧 fix(tsconfig.json): change TypeScript module resolution strategy from "node" to "bundler", set baseUrl and paths 🔧 chore(esbuild.config.js): change output directory from 'out' to 'dist' ✨ feat(build.sh): add build script 🔧 chore(.gitignore): update .gitignore to ignore .env extensions 📝 docs(README.md): Update project details to reflect new features and changes 🔥 remove(openai-thread-completion.ts): deleted openai-thread-completion.ts file
Configuration menu - View commit details
-
Copy full SHA for fde42d4 - Browse repository at this point
Copy the full SHA fde42d4View commit details
Commits on Aug 16, 2023
-
🔧 refactor(Dockerfile, package.json, botservice.ts, mm-client.ts, Ima…
…gePlugin.ts, PluginBase.ts, vite.config.ts): package updates and code improvements In Dockerfile, updated the node version from 16 to 20. This allows us to use the latest features and security patches. In package.json, updated several packages and added "node-fetch". This allows us to use the latest features and improves the stability and performance of the code. In botservice.ts, mm-client.ts, ImagePlugin.ts, PluginBase.ts, made several improvements to improve the readability and maintainability of the code.
Configuration menu - View commit details
-
Copy full SHA for faf00a1 - Browse repository at this point
Copy the full SHA faf00a1View commit details
Commits on Nov 7, 2023
-
🔧 refactoring: Updated openai-node to v4 and updated environment vari…
…able samples Updated the OpenAI API from v3 to v4. This allows us to take advantage of the new API features and improves the readability and maintainability of the code. Also, added new environment variable samples to the .env-sample file. This makes it easier for users to configure the use of the new API. 🔄 update(botservice.ts): Updated to OpenAI API v4 The OpenAI API has been updated to v4, and changes have been made to accommodate this. This allows the use of the new API features, improving the performance and functionality of the application. Also, unnecessary code has been removed to improve code readability and maintainability. 🔧 refactor(ImagePlugin.ts, types.d.ts): use string literals instead of directly using OpenAI types Using OpenAI types directly can lead to unexpected type changes due to library updates. Therefore, we used string literals to ensure type stability. Also, in types.d.ts, we imported the entire OpenAI instead of directly importing OpenAI types. This allows us to reference the necessary types directly, improving the readability of the code.
Configuration menu - View commit details
-
Copy full SHA for 6c5599b - Browse repository at this point
Copy the full SHA 6c5599bView commit details -
🔥 remove(compose.yaml, botservice.mjs, botservice.ts): remove unneces…
…sary code and add new environment variable Added a new environment variable OPENAI_IMAGE_MODEL_NAME in compose.yaml. This allows setting the image model name for OpenAI on docker image. Also, removed the duplicate check for global.FormData in botservice.mjs and botservice.ts. This reduces code redundancy and improves readability.
Configuration menu - View commit details
-
Copy full SHA for 953872d - Browse repository at this point
Copy the full SHA 953872dView commit details
Commits on Nov 15, 2023
-
✨Support gpt-4-vision-preview model
✨ feat(compose.yaml): add OPENAI_VISION_MODEL_NAME environment variable ✨ feat(botservice.ts): add image support and separate user and assistant messages 🔀 refactor(botservice.ts): make isMessageIgnored function asynchronous and add DM check 🔧 refactor(package.json, botservice.ts, openai-wrapper.ts): update package versions and improve code organization 🔧 refactor(types.ts, botservice.ts, openai-wrapper.ts, plugins): rename MessageData to MattermostMessageData
Configuration menu - View commit details
-
Copy full SHA for 8f5b7d1 - Browse repository at this point
Copy the full SHA 8f5b7d1View commit details
Commits on Nov 16, 2023
-
📦 feat(package.json, botservice.ts): added image processing library s…
…harp and implemented image resizing and format conversion To conform to the image formats and sizes supported by the OpenAI vision model, we use the sharp library to resize and convert the format of images. This ensures that images uploaded by users meet the requirements of the vision model, preventing errors.
Configuration menu - View commit details
-
Copy full SHA for 67c190f - Browse repository at this point
Copy the full SHA 67c190fView commit details
Commits on Nov 22, 2023
-
✨ feet(openai-wrapper.ts, .env-sample, README.md, MEMO.md): Separate …
…Azure OpenAI API keys and endpoints for text, vision, and image Separated Azure OpenAI API keys and endpoints into three: text, vision, and image. This allows for individual configuration of each API's version and deployment name, providing more flexible settings. Also improved error messages to make it easier to identify the cause when a problem occurs. ✨ feat(botservice.ts, ExitPlugin.ts, UnuseImagesPlugin.ts): added ability to ignore images Added a new plugin `UnuseImagesPlugin`. This plugin instructs the bot to ignore images when the user asks to "ignore images". Also, a new function `isUnuseImages` was added to `botservice.ts` to determine whether to ignore images or not. This allows the bot to ignore images according to the user's request. 📝 fix(README.md, openai-wrapper.ts): Update documentation and default values Fixed some descriptions and default values in README.md that were incorrect. Specifically, corrected the default value for OPENAI_MODEL_NAME to be `gpt-3.5-turbo`, updated the version for AZURE_OPENAI_API_VERSION to `2023-12-01-preview`, and added to the description for AZURE_OPENAI_API_IMAGE_DEPLOYMENT_NAME that DALL-E 3 requires at least the 2023-12-01-preview API version. 📝 docs(README.md): Add support for GPT-4V Vision API and update Azure OpenAI API version By adding support for the GPT-4V Vision API, we have enabled the realization of multimodal text and images. Updating the Azure OpenAI API version allows us to use the latest features. Additionally, we added a new screenshot to visually demonstrate how users can interact with the bot. 🔧 refactor(botservice.ts): improve image fetching method and enhance error handling To improve the image fetching method, the getBase64Image function has been modified to include a token parameter. This makes the function more versatile and allows it to fetch images with different authentication tokens. Additionally, to enhance error handling, a check has been added to ensure the fetch response is successful. This ensures that the application functions correctly even if image fetching fails. 🔧 refactor(openai-wrapper.ts): completed transition from function_call to tool_calls The OpenAI API has been updated to use tool_calls instead of function_call. This change makes the code compatible with the new API and prevents future incompatibility issues. Additionally, this change improves the ability to handle multiple tool calls simultaneously.
Configuration menu - View commit details
-
Copy full SHA for 798e880 - Browse repository at this point
Copy the full SHA 798e880View commit details -
Configuration menu - View commit details
-
Copy full SHA for 941b8a9 - Browse repository at this point
Copy the full SHA 941b8a9View commit details
Commits on Apr 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8cf103b - Browse repository at this point
Copy the full SHA 8cf103bView commit details -
✨feat(src/AIProvider.ts): Support Cohere Command R+
Support Cohere Command R+ and Anthropic Claude 3 by AI provider interface. Implemented a series of changes related to the development environment, code quality management, and project configuration. This includes updating the development container settings, adding samples for environment variables, introducing Textlint settings, updating VSCode workspace settings, improving Docker Compose configuration, refactoring source code, updating packages, adding a synchronization script, and adjusting TypeScript settings. These changes aim to streamline the development process, improve code readability and maintainability, and enhance the flexibility of project configuration. Updated the development environment settings to use a new Docker image. Added new variables to the environment variable sample file and introduced Textlint to improve document quality. Updated VSCode workspace settings with added debug configurations. Improved Docker Compose configuration for more flexible environment variable management. The source code includes abstraction of AI providers, refactoring, and addition of new features. Updated package dependencies and added a script to facilitate project synchronization. Finally, adjusted TypeScript settings to improve the development experience.
Configuration menu - View commit details
-
Copy full SHA for c2f8bc0 - Browse repository at this point
Copy the full SHA c2f8bc0View commit details
Commits on Apr 13, 2024
-
🚀 feat: Add support for integration with Google Gemini API
Added support for Google Gemini API by updating environment variables, README, adding a new GoogleGeminiAdapter class, and adjusting existing code. This enables the use of Google's latest AI models to provide more diverse responses and functionalities. 🚀 feat(Dockerfile, eslint.config.js, package.json): Support ESLint V9 Added an ESLint configuration file `eslint.config.js` and included a step in the Dockerfile to copy this file. Also, removed the unnecessary `--ext ts` option from the `lint` script in `package.json` and streamlined dependencies. These changes aim to maintain consistency in the code and make it easier for developers to uphold code quality. 🔥 remove(.eslintrc.json): Remove old ESLint configuration file from the project To simplify the project setup and reduce maintenance efforts, the old ESLint configuration file has been removed. This opens up opportunities to explore alternative ways to maintain code quality. 🚚 change(Dockerfile): Remove reference to .eslintrc.json from Dockerfile Following the removal of the ESLint configuration file from the project, its reference has been removed from the Dockerfile. This updates the build process and avoids copying unnecessary files. 🔥 refactor(AIProvider.ts): Improve code for safely accessing inputTokens and outputTokens in NonStreamedChatResponse Previously, the implementation used the `any` type to access `inputTokens` and `outputTokens`, which was not type-safe. The new implementation uses optional chaining and the nullish coalescing operator to safely access these values, defaulting to -1 if they are not present. This enhances the readability and safety of the code. 📦 package update(package.json): updated versions of dependencies and devDependencies Updating the versions of dependencies and devDependencies to their latest ensures that security vulnerabilities are addressed and the latest features are available. Notably, versions of "@anthropic-ai/sdk", "openai", "@swc/core", "@types/node", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", "eslint", "tsx", and "typescript" have been updated, which is expected to improve performance and resolve compatibility issues. @anthropic-ai/sdk ^0.19.0 → ^0.20.2 @swc/core ^1.4.11 → ^1.4.13 @types/node ^20.11.30 → ^20.12.6 @typescript-eslint/eslint-plugin ^7.4.0 → ^7.6.0 @typescript-eslint/parser ^7.4.0 → ^7.6.0 eslint ^8.57.0 → ^9.0.0 openai ^4.29.2 → ^4.33.0 tsx ^4.7.1 → ^4.7.2 typescript ^5.4.3 → ^5.4.4
Configuration menu - View commit details
-
Copy full SHA for a7d3848 - Browse repository at this point
Copy the full SHA a7d3848View commit details
Commits on Apr 15, 2024
-
♻️Refactoring: The classes contained in AIProvider.ts were made into …
…separate files. 🔧 chore(.codeclimate.yml): Update Code Climate configuration to enhance quality checks Several changes have been made to the Code Climate configuration file. These include adding new checks, enabling CSSLint, removing unnecessary languages, and adding Markdownlint. These changes aim to strengthen code quality checks and ensure a more consistent codebase. Additionally, the settings for excluding certain files and folders have been updated to ensure auto-generated files and folders are excluded from checks. 🔤 docs(README.md): Correct "GOGGLE_API_KEY" to "GOOGLE_API_KEY" for accurate spelling Correcting the typo improves the accuracy of the documentation. This ensures that the correct environment variable name for the API key is clearly communicated to users, avoiding confusion when configuring.
Configuration menu - View commit details
-
Copy full SHA for 96370a7 - Browse repository at this point
Copy the full SHA 96370a7View commit details
Commits on Apr 19, 2024
-
✨ New feature (src/adapters/GoogleGeminiAdapter.ts): Support tools by…
… v1beta version of Google Gemini API GoogleGeminiAdapter.ts uses the v1beta version of the Google Gemini API. and added support for tools. This allows us to take advantage of new features in the API and provide more advanced functionality. We also improved the way responses are handled and implemented logic to format them to match OpenAI's format.
Configuration menu - View commit details
-
Copy full SHA for c94eb9d - Browse repository at this point
Copy the full SHA c94eb9dView commit details
Commits on May 25, 2024
-
♻️ 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.
Configuration menu - View commit details
-
Copy full SHA for f50687b - Browse repository at this point
Copy the full SHA f50687bView commit details
Commits on Dec 12, 2024
-
🔧 chore(devcontainer.json, README.md, package.json, CohereAdapter.ts,…
… GoogleGeminiAdapter.ts, botservice.ts, openai-wrapper.ts, postMessage.ts): update dependencies and improve code Updated the development environment Docker image to the latest 1-22-bookworm and upgraded dependency packages to their latest versions, enhancing security and performance. Added comments and function descriptions to improve code readability and maintainability. Improved token management in OpenAI API calls and organized log outputs. @anthropic-ai/sdk ^0.21.1 → ^0.32.1 @eslint/js ^9.3.0 → ^9.16.0 @google/generative-ai ^0.7.1 → ^0.21.0 @mattermost/client ^9.6.0 → ^10.2.0 @mattermost/types ^9.6.0 → ^10.2.0 @swc/core ^1.4.14 → ^1.10.1 @swc/helpers ^0.5.10 → ^0.5.15 @types/node ^20.12.7 → ^22.10.2 @types/node-fetch ^2.6.11 → ^2.6.12 @types/ws ^8.5.11 → ^8.5.13 cohere-ai ^7.9.4 → ^7.15.0 debug-level 3.1.4 → 3.2.1 esbuild ^0.20.2 → ^0.24.0 eslint ^9.0.0 → ^9.16.0 form-data ^4.0.0 → ^4.0.1 openai ^4.35.0 → ^4.76.1 prettier ^3.3.3 → ^3.4.2 sharp ^0.33.3 → ^0.33.5 textlint ^14.0.4 → ^14.4.0 textlint-rule-preset-jtf-style ^2.3.14 → ^3.0.0 tsx ^4.7.2 → ^4.19.2 typescript ^5.5.3 → ^5.7.2 typescript-eslint ^7.7.0 → ^8.18.0 vitest ^1.5.2 → ^2.1.8
Configuration menu - View commit details
-
Copy full SHA for 029231c - Browse repository at this point
Copy the full SHA 029231cView commit details
Commits on Dec 20, 2024
-
🔧 chore(Dockerfile, compose.yaml): use distroless, update Node.js ver…
…sion and enhance security Updated Node.js version from 20 to 22 in the Dockerfile and switched to using a distroless image to improve container security by removing unnecessary packages and reducing the attack surface. Changed the user to nonroot and specified ownership in the COPY command to avoid running with root privileges. In compose.yaml, added the cap_drop option to remove container capabilities, further enhancing security.
Configuration menu - View commit details
-
Copy full SHA for 008cfbb - Browse repository at this point
Copy the full SHA 008cfbbView commit details
Commits on Dec 29, 2024
-
🚀 feat: support for multiple instances and introduction of configurat…
…ion file Version 3.0.0 introduces support for multiple bots in a single process, eliminating the need to run multiple Docker containers to use multiple LLMs. Additionally, configuration management has shifted from environment variables to a `config.yaml` file, enhancing flexibility and removing the need for manual environment variable settings. These changes were made to improve the scalability and ease of management of the application.
Configuration menu - View commit details
-
Copy full SHA for 9575c4b - Browse repository at this point
Copy the full SHA 9575c4bView commit details -
📦 chore(package.json): update dependencies and devDependencies versio…
…ns, add new screenshot image file Dependencies such as `@anthropic-ai/sdk`, `openai`, `@eslint/js`, and others have been updated to their latest versions to benefit from bug fixes and new features. Additionally, a new image file `multiBotInstance.png` has been added, which may be used as a visual element in project documentation or UI.
Configuration menu - View commit details
-
Copy full SHA for 0380742 - Browse repository at this point
Copy the full SHA 0380742View commit details
Commits on Dec 30, 2024
-
✨New feature: Support for environment variables to ensure compatibili…
…ty with past settings Possible to use environment variables to config settings, again. This makes it possible to reuse past settings. Improved code readability by organizing variable names and comments. However, flexible configuration requires config.yaml.
Configuration menu - View commit details
-
Copy full SHA for eb33e61 - Browse repository at this point
Copy the full SHA eb33e61View commit details -
🔧 Documentation and Code Improvement: Add compatibility for environme…
…nt variables and implement token hiding In README.md, added explanations about backword compatibility with environment variables in version 3.0.1. For multi-instance setups, manual configuration in config.yaml is recommended. Also, added an environment variables column to clarify configuration options. In MultiInstance.mjs and MultiInstance.ts, added a hideTokens function to prevent tokens from being displayed in log outputs, enhancing security. Improved error messages when duplicate bot names are detected. Updated the version in package.json to 3.1.0 to reflect the addition of new features.
Configuration menu - View commit details
-
Copy full SHA for a02221d - Browse repository at this point
Copy the full SHA a02221dView commit details
Commits on Dec 31, 2024
-
🔧 refactor: improve environment variable support and bot configuration
Added sample API keys and tokens to .env-sample for enhanced security. Fixed version information in README.md. Improved asynchronous handling of bot configurations in MultiInstance.ts using Promise.all, and added error messages for when no bots are configured. Also, fixed the function to hide tokens to return a new object without altering the original configuration.
Configuration menu - View commit details
-
Copy full SHA for d300de7 - Browse repository at this point
Copy the full SHA d300de7View commit details -
📝 docs(README.md): clarify changes in configuration methods to suppor…
…t multiple bots Clarified that the changes in configuration methods in version 3 are to support multiple bots. Additionally, added a heading to the table to emphasize the section for individual bot settings. This makes the guidelines clearer for users when configuring multiple bots. Fixed table collapse on GitHub.
Configuration menu - View commit details
-
Copy full SHA for 41d241a - Browse repository at this point
Copy the full SHA 41d241aView commit details
Commits on Feb 3, 2025
-
♻️ Refactoring and Feature Enhancements (.devcontainer/devcontainer.j…
…son, chatgpt-mattermost-bot.code-workspace, dist/MultiInstance.mjs, eslint.config.js, package.json, src/BotService.ts, src/MattermostClient.ts, src/MultiInstance.ts, src/OpenAIWrapper.ts, src/postMessage.ts): Improved development environment, strengthened error handling, o3-mini support, detailed token usage display, and enhanced support for multiple bots. This commit improves the development environment's Dockerfile configuration, adjusts ESLint settings to improve code quality, strengthens error handling, adds detailed token usage information to log output, adds support for multiple bots, and makes the Mattermost client configuration more flexible. These changes are expected to improve development efficiency, enable earlier error detection, and enhance application robustness.
Configuration menu - View commit details
-
Copy full SHA for d1a3b62 - Browse repository at this point
Copy the full SHA d1a3b62View commit details
There are no files selected for viewing