-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] Modularize main.py #53
Conversation
…d generating bot's response
…ess_event function
GitHub actions yielded the following error. The command that failed is
Please note that there is a syntax error in the code on line 14 of the This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
Hot garbage. |
Description
This PR refactors the existing
main.py
to adopt a more modular structure by dividing its functionalities into separate modules under different directories. This improves code organization and maintainability.Summary of Changes
main.py
tohandlers/process_event.py
.handlers/chat_response.py
to handle message handling functionality.handlers/image_response.py
to handle image response functionality.handlers/tts_response.py
to handle text-to-speech response functionality.handlers/slash_commands.py
to handle slash command handling logic.settings/env_loader.py
to handle environment variable loading.settings/sessions.py
to handle session management.utils/moderation.py
to contain the moderation functionality.utils/voices.py
to contain the voice list retrieval functionality.utils/tokenizer.py
to contain the token counting functionality.utils/text_to_speech.py
to contain the text-to-speech conversion functionality.utils/google_cloud.py
to contain the Google Cloud-related functions.These changes improve code organization, readability, and maintainability by separating different functionalities into their own modules. This allows for easier collaboration and reduces the risk of merge conflicts.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.