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.
This pull request introduces several improvements and fixes across two files:
utils/function_call.pyandvoice_stt_mode.py. The changes include suppressing warnings, improving error handling, enhancing functionality for text-to-speech and news search, and refining code readability and maintainability.Key Changes:
Improvements to Error Handling:
excinstead ofefor clarity and consistency (voice_stt_mode.py: [1] [2] [3] [4].voice_stt_mode.py: voice_stt_mode.pyL356-R377).Functional Enhancements:
search_newsfunction to format results for readability and handle cases where no results are found (utils/function_call.py: utils/function_call.pyL863-R920).translate_textfunction to extract and return the summary of the translation instead of the raw result (utils/function_call.py: utils/function_call.pyL941-R998).Code Quality and Readability:
voice_stt_mode.py: [1] [2].voice_stt_mode.py: [1] [2].Suppression of Warnings:
Pydanticuser warnings related to namespace conflicts, ensuring cleaner logs during runtime (utils/function_call.py: [1]voice_stt_mode.py: [2].Dependency and Import Adjustments:
utils/function_call.py: utils/function_call.pyL457-R494).