Holds the result of a text translation request.
| 10 | |
| 11 | |
| 12 | class TextResult: |
| 13 | """Holds the result of a text translation request.""" |
| 14 | |
| 15 | def __init__( |
| 16 | self, |
| 17 | text: str, |
| 18 | detected_source_lang: str, |
| 19 | billed_characters: int, |
| 20 | model_type_used: Optional[str] = None, |
| 21 | ): |
| 22 | self.text = text |
| 23 | self.detected_source_lang = detected_source_lang |
| 24 | self.billed_characters = billed_characters |
| 25 | self.model_type_used = model_type_used |
| 26 | |
| 27 | def __str__(self): |
| 28 | return self.text |
| 29 | |
| 30 | |
| 31 | class WriteResult: |