Skip to content

How to make a googletrans translator tool for Agent #5973

Answered by julian-risch
dkbs12 asked this question in Questions
Discussion options

You must be logged in to vote

Hello @dkbs12 What language are you trying to translate? Maybe we can help finding a model.
If you would like to create your custom component, here are some ideas. You could use deep-translator, which also support google translator: https://github.com/nidhaloff/deep-translator#id1
pip install deep-translator

and then in your custom components translate method you would do the following:

from deep_translator import GoogleTranslator

translated = GoogleTranslator(source='auto', target='de').translate("keep it up, you are awesome")

inside of

def translate(
        self,
        results: Optional[List[Dict[str, Any]]] = None,
        query: Optional[str] = None,
        documents: Optional[Union

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dkbs12
Comment options

Answer selected by dkbs12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants