Conversation
- Add TelegramBot class for Telegram Bot API communication - Add TelegramCallback class with bilingual support (en/zh) - Support notification on experiment start (optional) and stop - Support success/error/offline mode notifications - Add comprehensive unit tests (30 test cases) - Add integration test script following notification_bark.py style - Export TelegramCallback in plugin __init__.py
* fix(core): add default timeout for request session 为请求会话设置默认超时时间(60s),避免在请求未接收到响应的情况下阻塞上传的情况。 * optmize swanlab/core_python/session.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
#1359) * fix(data): preserve more field in media metrics to fix image loading issue - Modified __filter_list to accept keep_none_list parameter - Ensure more field is always present in log data even when all values are None - This fixes the frontend TypeError when accessing more[0] Fixes #1354 * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Refactor __filter_list to simplify empty list handling Updated the __filter_list static method to return None only when the input list is empty or all elements are None, unless keep_none_list is True. This refactoring simplifies the logic and improves code readability. --------- Co-authored-by: Kang Li <79990647+SAKURA-CAT@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Kang Li <cunykang@gmail.com>
* Add LOG_LEVEL env var for log level configuration Introduced SWANLAB_LOG_LEVEL environment variable to control SwanLab's log output level. The log level now prioritizes the environment variable over the log_level argument, improving configurability. * Refactor metrics upload logic and add batch uploader Moved metrics upload batching logic from upload.py to a new batch.py module, introducing improved chunking and client state management. Updated related imports and test cases to use the new batch uploader. Enhanced logging in client/__init__.py and improved type handling in toolkit/logger.py. * Improve logger level handling and add tests Refactored logger initialization to support environment variable for log level and improved handling of invalid log levels. Added unit tests to verify environment variable log level and defaulting to 'info' for invalid levels. * Refactor batch uploader to simplify request handling Removed the client_state_guard decorator and integrated client state checks directly into the trace_metrics function. This streamlines the request logic and eliminates unnecessary indirection, making the code easier to follow and maintain. * Refactor SwanLog tests for better isolation and flexibility Updated test_log.py to use instance-level logger management, allowing tests to operate on different SwanLog instances and improving test isolation. Modified start_proxy to accept a logger parameter and return both log file and logger. Minor improvements in batch.py to handle empty data in trace_metrics and expanded type hints. * Remove LOG_LEVEL from environment in reset_some_env Ensures that the LOG_LEVEL environment variable is deleted if present when resetting environment variables in reset_some_env. * Improve log level handling and test cleanup Log level is now consistently set to lowercase in SwanLog. Test setup now resets swanlog to ensure proper cleanup, handling potential RuntimeError. Removed LOG_LEVEL env var deletion from reset_some_env for better environment management. * Refactor uploader URL usage and update tests Centralized the '/house/metrics' URL as HOUSE_URL in upload.py and updated all references. Improved logging in client/__init__.py and batch.py. Fixed and clarified test for trace_metrics behavior when client is pending. * Fix handling of None data in trace_metrics Updated trace_metrics to handle cases where data is None by defaulting to an empty list, preventing errors when calculating total_len.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )