- Implemented async retry logic with exponential backoff in `src/utils/retry.py`.
- Created input validation utilities for Discord bot in `src/utils/validators.py`.
- Refactored token pricing import in `src/utils/token_counter.py`.
- Added comprehensive test suite in `tests/test_comprehensive.py` covering various modules including pricing, validators, retry logic, and Discord utilities.
- Updated descriptions for functions to provide clearer guidance on usage.
- Added detailed parameter descriptions for better understanding.
- Introduced new function `remove_background` for background removal.
- Adjusted parameter requirements and constraints across various functions.
- Improved overall consistency and readability of the code.
- Removed the `analyze_data_file` function from tool definitions to streamline functionality.
- Enhanced the `execute_python_code` function description to clarify auto-installation of packages and file handling.
- Deleted the `python_executor.py` module to simplify the codebase and improve maintainability.
- Introduced a new `token_counter.py` module for efficient token counting for OpenAI API requests, including support for Discord image links and cost estimation.
- Implement proactive history trimming in DatabaseHandler to limit conversation messages to the last 50 while preserving system messages.
- Add methods for saving and retrieving user token usage statistics, including breakdowns by model.
- Introduce model pricing for token usage calculations in MessageHandler.
- Update message handling to count tokens accurately and log costs associated with API calls.
- Refactor token counting methods to utilize API response data instead of internal counting.
- Improve tool definitions in get_tools_for_model for clarity and conciseness.
- Remove deprecated python_executor_new.py file.
- Adjust web_utils to use tiktoken for preprocessing content before API calls.
- Updated `openai_utils.py` to streamline tool definitions and enhance token usage efficiency.
- Simplified the `process_tool_calls` function for better error handling and message preparation.
- Improved time parsing logic in `reminder_utils.py` to support various formats including AM/PM and "tomorrow" keywords.
- Added async wrappers for Google search and webpage scraping in `web_utils.py` to match expected interfaces and improve error handling.
- Added data_analyzer.py for comprehensive data analysis with templates for summary, correlation, distribution, and custom analysis.
- Integrated logging for tracking analysis processes and errors.
- Included package installation functionality for required libraries.
- Developed python_executor.py to safely execute user-provided Python code with sanitization and timeout features.
- Implemented security measures to prevent unsafe code execution.
- Enhanced output handling to capture visualizations and standard output.
- Implemented `edit_image` method for background removal from images.
- Added `enhance_prompt` method to generate improved versions of text prompts.
- Introduced `image_to_text` method for converting images to text descriptions.
- Created `upscale_image` method to enhance image resolution.
- Developed `photo_maker` method for generating images based on prompts and reference images.
- Added `generate_image_with_refiner` method for high-quality image generation using a refiner model.
- Updated OpenAI function definitions to include new image processing capabilities.
- Enhanced message processing to handle image URLs and descriptions appropriately.