Commit Graph

260 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
69a8bb8164 Fix Claude image URL handling (convert URLs to text references)
Co-authored-by: cauvang32 <113093128+cauvang32@users.noreply.github.com>
2025-12-03 10:16:49 +00:00
copilot-swe-agent[bot]
a2e4382b4b Add Claude API integration alongside existing GPT API
Co-authored-by: cauvang32 <113093128+cauvang32@users.noreply.github.com>
2025-12-03 10:14:25 +00:00
copilot-swe-agent[bot]
6c88143708 Initial exploration of codebase for Claude API integration
Co-authored-by: cauvang32 <113093128+cauvang32@users.noreply.github.com>
2025-12-03 10:03:39 +00:00
copilot-swe-agent[bot]
52dad36df1 Initial plan 2025-12-03 09:57:59 +00:00
41e7c6bac5 Fix paths in deployment workflow to ensure correct docker-compose file usage 2025-12-02 20:53:05 +07:00
211e8dc6c7 Fix deployment directory path in workflow 2025-12-02 20:46:20 +07:00
6634ea7ad6 Add environment variables for registry and image name in deployment workflow 2025-12-02 20:45:12 +07:00
0c5c27a660 Update deploy.yml 2025-12-02 20:43:50 +07:00
db90774e17 Add deployment workflow for ChatGPT-Discord-Bot 2025-12-02 20:42:52 +07:00
d549c43844 Enhance file handling instructions in code interpreter and message handler; clarify usage of load_file() and print() for user-uploaded files 2025-12-01 17:38:53 +07:00
668f56020d Merge pull request #12 from Coder-Vippro/alert-autofix-7
Potential fix for code scanning alert no. 7: Incomplete URL substring sanitization
2025-11-30 17:55:23 +07:00
Vu Quoc Anh
fd143aba17 Potential fix for code scanning alert no. 7: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-11-30 17:53:15 +07:00
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
Vu Quoc Anh
c9531b37bb Add LICENSE file 2025-10-31 21:53:31 +07:00
86875bf93d feat: Revamp README.md for enhanced clarity and feature presentation in v2.0.0 2025-10-03 23:57:26 +07:00
0a1e871cdb feat: Implement package cleanup and usage tracking in Docker and non-Docker environments 2.0.4 2025-10-03 13:05:07 +07:00
33a76aa8cc feat: Implement Docker environment detection to use system Python and skip virtual environment management 2025-10-03 12:48:14 +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
1cb47f1d25 refactor: Update prepare_messages_for_api tests to reflect changes in message handling 2025-08-28 15:31:45 +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
85b0d265a6 refactor: remove forced tool choice parameter in API call for model tool usage 2025-08-27 10:22:47 +07:00
6bfc6d4573 refactor: update database handler references for user tool display preferences in message handling 2025-08-27 00:05:47 +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
eaaef0676a refactor: enhance persistent package management and streamline code execution environment 2025-08-26 23:21:28 +07:00
b51bcdc3a9 refactor: enforce tool usage in API calls and enhance Discord message displays for search and scraping activities 2025-08-25 23:16:08 +07:00
8277e06a13 refactor: improve code execution display by handling long code outputs with file attachments and enhancing error messaging 2025-08-25 21:40:03 +07:00
ecfc2b48d5 refactor: enhance Python code execution with async package installation and improved timeout handling 2025-08-25 21:01:22 +07:00
ac6bb8c582 refactor: simplify logging setup by removing file handlers and using console output only 2025-08-25 17:47:50 +07:00
5a69b29ae0 refactor: enhance code execution and analysis features with package installation support and detailed output display 2025-08-24 23:50:54 +07:00
7b19756932 refactor: optimize memory usage by removing unnecessary global variables and implementing cleanup mechanisms 2025-08-15 00:12:15 +07:00
8cad2c541f refactor: adjust token limits and streamline prompts for improved clarity and efficiency 2025-08-14 16:55:35 +07:00
e5d8e5db94 refactor: update NORMAL_CHAT_PROMPT for clarity and conciseness in user interactions 2025-08-08 16:04:23 +07:00
61abc9b1e6 refactor: streamline API call parameters and enhance token management for OpenAI interactions 2025-08-08 11:44:17 +07:00
59b5e13005 fix: update PdfReader import from PyPDF2 to pypdf in pdf_utils.py 2025-08-08 10:18:27 +07:00
e93f76d693 Refactor code structure for improved readability and maintainability 2025-08-08 09:54:18 +07:00
7af48efe00 Refactor and optimize utility functions for improved performance and readability
- 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.
2.0.3
2025-06-21 21:46:06 +07:00
e505cc4b3a feat: Remove linting step from CI workflow 2025-06-20 21:26:05 +07:00
ac8fd924c1 feat: Add comprehensive unit tests for DatabaseHandler, OpenAI utilities, and code utilities 2025-06-20 21:23:03 +07:00
623b18a37c feat: Update execute_python_code tool to enforce explicit print() statements for calculations and add test_executor.py for validation 2025-06-20 21:14:59 +07:00
d3b92f8bef feat: Implement data analysis and code execution utilities
- 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.
2025-06-20 17:56:27 +07:00
cce1ff506b feat: Update NORMAL_CHAT_PROMPT to prioritize Python for code execution and analysis 2025-05-13 23:45:03 +07:00
423d09664c feat: Update model support in MessageHandler to include additional OpenAI models 2025-04-24 14:38:27 +07:00
18bcd79090 feat: Extend model support in response history tracking for additional OpenAI models 2025-04-23 17:35:06 +07:00
47309c0a98 feat: Update PDF processing model validation to use PDF_ALLOWED_MODELS for better flexibility 2025-04-18 18:07:27 +07:00
3163049207 feat: Update MODEL_OPTIONS and PDF_ALLOWED_MODELS to include additional OpenAI models 2025-04-17 20:31:01 +07:00
20ee9b63ab feat: Update PDF_ALLOWED_MODELS and MODEL_OPTIONS to include additional OpenAI models 2025-04-17 15:09:01 +07:00
5649d67d78 feat: Add missing COPY commands for Python packages in Dockerfile 2025-04-16 22:52:24 +07:00
858c938a8b refactor: Simplify Dockerfile by removing non-root user setup and adjusting paths for Python package installation 2025-04-16 22:38:15 +07:00