Removed the methods `upload_file`, `send_image`, and `send_file` from the ReportBot class to streamline the bot's functionality, focusing on handling reports rather than managing file uploads. This change simplifies the bot's codebase and aligns with our goal to sharpen its focus on core reporting features. Additionally, updated bare `except:` statements to `except Exception:` for better error handling practices.
Removed numerous unused imports from the bot.py module, including specific event types, error classes, and utilities no longer utilized in the current implementation. This cleanup enhances readability and maintainability of the codebase by eliminating clutter and focusing on what's essential for the bot's operation. The removal of unused libraries like functools and datetime, alongside specific nio classes, signifies a shift towards a more streamlined and efficient code structure. This change also potentially improves import times and reduces memory footprint, albeit marginally.
This update bumps the project version to 0.0.3 and modifies the bot's behavior to handle room invites asynchronously, improving the efficiency of joining rooms on startup. By adopting `await` for `accept_pending_invites`, the bot can now manage invites more responsively, potentially enhancing user experience during high-volume invite periods.
This change reflects our commitment to continuous improvement, addressing scalability and responsiveness as the bot becomes integrated into larger ecosystems or faces more demanding operational contexts.
No issues explicitly referenced, but this enhancement is part of ongoing efforts to refine the bot's functionality and reliability.
Updated the version of matrix-reportbot to 0.0.2 in `pyproject.toml` to reflect new features and improvements in the application. This version increment signifies progress in the development cycle and prepares the project for upcoming releases.
This update is a part of our regular maintenance and feature rollout schedule, ensuring the application stays up-to-date with the latest enhancements for our users and contributors.
Introduced functionality to automatically accept pending room invites, enhancing the bot's integration capabilities. This feature filters and accepts invitations unless the room is in the bot's ignore list. It aims to streamline the bot's entry into designated discussion spaces without manual intervention, ensuring it remains an active participant in relevant rooms. In cases where joining a room fails, the bot attempts to leave the room to avoid repeated joining attempts and adds the room to an ignore list to prevent future automated entry attempts, improving error handling and maintainability.
This change underscores our commitment to enhancing automated processes and simplifying management tasks related to room participation for the bot, thereby allowing it to function more autonomously and efficiently.
Renamed `pantalaimon_first_login.py` to `get_access_token.py` to clarify its purpose for new developers. Removed dependency on `pantalaimon`, streamlining the project setup and reducing complexity. This change necessitates manual configuration for secure connections but simplifies the overall authentication flow. Also, deleted the example config file `pantalaimon.example.conf`, reinforcing the move away from Pantalaimon. This shifts the focus towards direct authentication methods, potentially improving future maintainability and ease of use.
# No specific issue references
```
```
refactor: streamline authentication by removing Pantalaimon
Renamed `pantalaimon_first_login.py` to `get_access_token.py` to make its purpose clear, especially for newcomers. This shift underscores our initiative to simplify the authentication process, directly aligning with our goal for a cleaner and less complex setup. By removing Pantalaimon dependencies, we not only reduce project complexity but also embrace a more straightforward authentication method. This decision involves moving away from automated secure connections provided by Pantalaimon, requiring manual configuration but ultimately leading to a leaner codebase and potentially enhancing maintainability and usability for developers.
The reportbot service startup command has been updated to use the correct module name, `matrix_reportbot`, ensuring the service starts using the intended Python module. This change resolves issues where the reportbot service failed to start due to an incorrect module name reference.
This major overhaul shifts the project's focus from serving RSS feeds to reporting content within the Matrix ecosystem. Key changes include:
- Renaming from Matrix-RSSBot to Matrix-ReportBot, aligning the project with its new purpose.
- Removal of RSS related functionalities and incorporation of report handling capabilities, facilitating automated content reporting and monitoring in Matrix rooms.
- Introduction of new dependencies and configurations specific to the report handling features.
- Updating service configurations to ensure compatibility with the bot's new functionality.
This transformation addresses the need for a specialized tool in the Matrix community for managing and automating content reports, enhancing moderation efficiency and response time.
Reorganized the script's main execution logic into a `main` function for clearer entry point definition and better maintainability. Updated the project version to 0.1.1, reflecting these changes alongside minor fixes. Adjusted the script reference in `pyproject.toml` to align with the new entry point structure, ensuring proper package execution as a console script. This refactor enhances code readability and supports more flexible future updates.
- Added informative badges for versioning, Python versions, license, and the latest commit to enhance project visibility and credibility.
- Expanded documentation to include detailed installation, usage instructions, and added a comprehensive guide on configuring and running the bot, emphasizing the ease of set up and operation.
- Recommended the use of pantalaimon for E2E encryption support, catering to user security concerns.
- Included commands for adding, listing, and removing feeds, ensuring users have clear guidance on bot interaction.
This update makes the project more accessible and user-friendly, encouraging adoption and contribution by providing all necessary information upfront.
fix: ignore build directory in .gitignore
- The `build/` directory is now ignored, preventing compiled files or artifacts from being tracked in the repository, ensuring a cleaner project structure.
This commit adds error handling for feed processing errors in the RSS
bot's feed polling logic. The previous version was failing to handle
exceptions that were thrown during the feed parsing process, which could
lead to unpredictable behavior and potential data corruption. This new
version catches any exceptions that occur during the feed parsing step
and logs them, preventing the bot from becoming stuck in an infinite
loop due to these errors.
The changes include a try/except block around the feed parsing code,
where any exceptions are caught and logged using Python's logging
module. The bot's state is not modified when there is an error during
feed processing, which ensures that the bot does not become stuck in an
infinite loop due to errors. Additionally, the commit includes a new
logger method for logging exceptions, which helps identify any issues
with the feed parsing process and prevents them from affecting the bot's
overall performance.
This commit has several benefits:
* It improves the reliability of the RSS bot by handling errors that
could occur during feed processing and preventing the bot from becoming
stuck in an infinite loop due to these errors.
* It makes it easier for users to troubleshoot issues with the RSS bot,
since error messages are now being logged and can be easily identified.
* It helps to prevent data corruption by ensuring that the bot's state
is not modified when there is an error during feed processing.
This commit improves the handling of the feed list by removing
duplicate entries and ensuring that each feed is only listed once. This
change was made to improve the overall stability and performance of the
RSS bot, as well as to simplify the code and make it easier to maintain.
Additionally, this commit addresses a bug where the `listfeeds` command
would not work correctly if there were multiple feeds with the same URL.
This commit also includes an optimization that reduces the number of
network requests made by the RSS bot when fetching feed content. This
should improve the overall performance and reduce the load on servers
hosting RSS feeds.
support deleting feeds in the Matrix RSS Bot
This commit adds a new "removefeed" command to the Matrix RSS Bot,
which allows users to delete existing RSS feeds from the bot's list of
subscribed feeds. The "removefeed" command is added to the "__init__.py"
file in the "matrix_rssbot/classes/commands" directory.
This commit refactors the code handling bot state management to
improve readability and modularity. The new implementation uses a more
structured approach to handling different types of events, making it
easier to reason about and maintain. Additionally, it fixes an issue
where the bot was not properly handling errors when putting state in
rooms.
This change should improve the overall stability and performance of the
RSS bot, as well as make it easier for developers to understand and work
with the codebase.
Enhanced event processing in the bot's message retrieval logic to
improve message relevance and accuracy. Changes include accepting all
'gptbot' prefixed events, refining handling of 'ignoreolder' command
with exact match rather than starts with, and now passing through
'custom' commands that start with '!'. The default behavior now excludes
notices unless explicitly included. This update allows for more precise
command interactions and reduces clutter from irrelevant notices.
Standardize the passing of 'messages' argument across various calls to
generate_chat_response method to ensure consistency and prevent
potential bugs in the GPT bot's response generation. The 'model'
parameter in one instance has been corrected to 'original_model' for
proper context loading. These changes improve code clarity and maintain
the intended message flow within the bot's conversation handling.
Refactored initialization of OpenAI APIs to correct a redundancy and
enhance clarity. Improved content extraction logic for robust handling
of various message types. Enhanced logging and messaging by including
user and room context, facilitating better debugging and user
interaction. Extended `send_message` to support custom message types,
allowing for richer interaction within the chat ecosystem. Updated
hardcoded chat models to leverage newer versions for potentially more
accurate tool overrides. Fixed async method call in recursion handling
to ensure proper response generation. Finally, increased message history
retrieval limit based on the `max_messages` attribute for more effective
conversation context.
Resolves issues with message context and enhances user feedback during
operations.
Removed the '-dev' suffix from the project version indicating the transition from a development state to the official release of version 0.3.3. This version bump aligns with the completion of features and fixes slated for this iteration.
Update the README to specify that issues with file attachments primarily occur in non-encrypted rooms when the same user operates the bot in both encrypted and non-encrypted rooms. This detail aims to inform users of potential pitfalls more precisely when setting up the bot with end-to-end encryption enabled.
Improved the error handling in the OpenAI class to prevent infinite recursion issues by retaining the original chat model during recursive calls. Enhanced logging within the recursion depth check for better debugging and traceability. Ensured consistency in chat responses by passing the initial model reference throughout the entire call stack. This is crucial when fallbacks due to errors or tool usage occur.
Refactored code for clarity and readability, ensuring that any recursion retains the original model and tool parameters. Additionally, proper logging and condition checks now standardize the flow of execution, preventing unintended modifications to the model's state that could lead to incorrect bot behavior.
Introduced the ability to specify and retrieve different OpenAI models on a per-room basis, thereby allowing enhanced customization of the bot's response behavior according to the preferences for each room. Cleaned up code formatting across the bot implementation files for improved readability and maintainability. Additional logic now checks for model overrides when generating responses, ensuring the correct model is used as configured.
Refactors include streamlined database and API initializations and a refined method for processing message formatting to accommodate images, texts, and system messages consistently. This change differentiates default behavior from room-specific configurations, catering to diverse user needs without compromising on default settings.
Added a safety check to prevent infinite recursion within the response generation function. When `use_tools` is active, the code now inspects the call stack and terminates the process if a certain recursion depth is exceeded. This ensures that the code is robust against potential infinite loops that could block or crash the service. A default threshold is set with a TODO for revisiting the hard-coded limit, and the recursion detection logs the occurrence for easier debugging and maintenance.
Note: Recursion limit handling may require future adjustments to the `allow_override` parameter based on real-world feedback or testing.
Introduced a configuration option to emulate tool usage in models that do not natively support tools, facilitating the use of such functionality without direct model support. This should benefit users aiming to leverage tool-based features without relying on specific AI models. Additionally, enhanced error logging in the GPTBot class by including traceback details, aiding in debugging and incident resolution.
- Added `EmulateTools` option in the `config.dist.ini` for flexible tool handling.
- Enriched error logging with stack traces in `bot.py` for better insight during failures.
Introduced additional debug log entries in the `GPTBot` class to provide clarity on the initial sync and callback setup process. This helps with monitoring and troubleshooting during the early stages of bot deployment, making it easier to pinpoint issues around bot startup and room joining behavior.
Bumped project version to 0.3.3-dev to signal ongoing development.
Updated README to caution users about the current issues with end-to-end encryption, specifically that it can disrupt file uploads and downloads. The aim is to prevent user frustration and potential data loss until a fix is implemented.
Resolved an issue that prevented the bot from responding when files were uploaded to encrypted rooms by implementing a workaround. The bot now tries to generate text from uploaded files and logs errors without interrupting the message flow. Upgraded the Pantalaimon dependency to ensure compatibility. Also, refined the message processing logic to handle different message types correctly and made the download_file method asynchronous to match the matrix client's expected behavior. Additionally, updated the changelog and bumped the project version to reflect these fixes and improvements.
Known issues have been documented, including a limitation when using Pantalaimon where the bot cannot download/use files uploaded to encrypted rooms.
Upgraded bot features to interpret and respond to text, image, and voice prompts in Matrix rooms using advanced OpenAI models, including vision preview and text-to-speech. Streamlined installation process with bot now available via PyPI, simplifying setup and extending accessibility. Eliminated planned features section, signaling a shift towards realized functionalities over prospective development.
Configured Pantalaimon as an optional dependency to enable bot use in E2EE rooms while maintaining compatibility with non-encrypted rooms. Removed trackingmore dependency, indicating a refinement in the feature set towards core functionalities. Version bumped to 0.3.0, signifying major enhancements over previous iteration.
Introduced a new systemd service configuration for GPTbot to ensure Pantalaimon starts as a background process on system boot, maintaining persistent Matrix encryption handling. Ensures seamless restarts and network dependency management for improved reliability.
Integrated Pantalaimon support with updated configuration instructions and examples, facilitating secure communication when using the Matrix homeserver. The .gitignore is now extended to exclude a Pantalaimon configuration file, preventing sensitive information from accidental commits. Removed encryption callbacks and related functions as the application leverages Pantalaimon for E2EE, simplifying the codebase and shifting encryption responsibilities externally. Streamlined dependency management by removing the requirements.txt in favor of pyproject.toml, aligning with modern Python practices. This change overall improves security handling and eases future maintenance.
Resolved a syntax error in the allowed_users property within the GPTBot class by adding the missing 'self' parameter. This correction ensures the proper functioning of the property method, enabling the bot to correctly retrieve the list of users authorized to use it.
Extended the condition for the audio message handling in the chatbot to recognize MP3 audio files sent as file attachments. This ensures that MP3 files will be properly processed as audio messages, improving the bot's media handling capabilities. This is just a test at this point, and may be rolled back.
Migrated several hardcoded bot configuration settings to dynamic properties with fallbacks, enhancing flexibility and customization. The properties now read from a configuration file, allowing changes without code modification. Simplified the instantiation logic by removing immediate attribute setting in favor of lazy-loaded properties. Additionally, prepared to segregate OpenAI-related settings into a dedicated class (noted with TODO comments).
Note: Verify the presence of necessary configuration parameters or include defaults to prevent potential runtime issues.
Added options to extract specific info and summarize content from Wikipedia pages within the gptbot's Wikipedia tool. The 'extract' option enables partial retrieval of page data based on a user-defined string, leveraging the bot's existing chat API for extraction. The 'summarize' option allows users to get concise versions of articles, again utilizing the bot's chat capabilities. These additions provide users with more granular control over the information they receive, potentially reducing response clutter and focusing on user-specified interests.
Cast user objects to strings to standardize ID handling across API calls. Enhanced logging statements now include user and room context, providing better traceability for response generation. Also, refined error handling for API token limits by falling back to an altered response flow, removing tool roles from messages when a max token error occurs, before reattempting. This targets more graceful handling of response generation without tool assistance when constraints are hit.