Commit Graph

14 Commits

Author SHA1 Message Date
f17081b185 Add retry utilities, input validation, and comprehensive tests
- 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.
2025-11-30 17:45:36 +07:00
e2b961e9c0 Refactor OpenAI utility functions: enhance descriptions, add parameters, and improve clarity
- 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.
2025-11-29 23:00:34 +07:00
42274e6ad5 feat: Implement dynamic message length handling for Discord to prevent exceeding character limits 2025-10-02 23:09:10 +07:00
9c180bdd89 Refactor OpenAI utilities and remove Python executor
- 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.
2025-10-02 21:49:48 +07:00
7785a8f26e feat: Enhance token usage tracking and history management
- 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.
2025-08-28 11:43:42 +07:00
19e62f85fc refactor: add user preference for tool execution display and enhance message handling for search and scraping activities 2025-08-26 23:36:47 +07:00
7b19756932 refactor: optimize memory usage by removing unnecessary global variables and implementing cleanup mechanisms 2025-08-15 00:12:15 +07:00
584d6e382d feat: Enhance reminder functionality with timezone support and update configuration handling 2025-03-25 12:47:41 +07:00
8eb78a4ca3 refactor: Update Dockerfile and requirements for improved build process and add new dependencies; enhance database connection timeouts and update prompts for better user interaction 2025-03-20 22:54:25 +07:00
b9c43ed50b refactor: Clean up code formatting and enhance test cases for better readability and coverage 2025-03-20 12:50:52 +07:00
80713ac94f feat: Implement data processing and visualization utilities
- Added `data_utils.py` for analyzing and visualizing data from CSV/Excel files.
- Introduced asynchronous processing to handle file uploads without blocking.
- Enhanced error handling for file reading and data conversion.
- Implemented various chart types (pie, bar, scatter, histogram, line) based on user queries.
- Added metadata management for generated charts, including cleanup of old charts.

feat: Create reminder management system for Discord

- Added `reminder_utils.py` to manage user reminders in Discord.
- Implemented functionality to add, retrieve, delete, and process reminders.
- Integrated timezone handling for accurate reminder scheduling.
- Developed a loop to check for due reminders and send notifications.
- Included parsing for various time formats to set reminders.
2025-03-19 23:45:28 +07:00
bf888301fd Enhance user history management by filtering expired image links and adding timestamps to image URLs 2025-03-18 12:37:38 +07:00
9069d16f19 Add logging configuration and enable webhook logging in config.py; update Dockerfile to include gcc and c++ dependencies 2025-03-15 13:09:15 +07:00
8136aa2dda Refactor Dockerfile for multi-stage build, update dependencies in requirements.txt, and add image generation and database handler modules 2025-03-13 22:10:57 +07:00