script.py 711 B

1234567891011121314151617181920212223242526272829
  1. from deep_translator import GoogleTranslator
  2. params = {
  3. "language string": "ja",
  4. }
  5. def input_modifier(string):
  6. """
  7. This function is applied to your text inputs before
  8. they are fed into the model.
  9. """
  10. return GoogleTranslator(source=params['language string'], target='en').translate(string)
  11. def output_modifier(string):
  12. """
  13. This function is applied to the model outputs.
  14. """
  15. return GoogleTranslator(source='en', target=params['language string']).translate(string)
  16. def bot_prefix_modifier(string):
  17. """
  18. This function is only applied in chat mode. It modifies
  19. the prefix text for the Bot and can be used to bias its
  20. behavior.
  21. """
  22. return string