An unofficial Google Translate API for Python providing free text translation and language detection capabilities
Overall
score
100%
Evaluation — 100%
↑ 1.01xAgent success when using this tile
Build a translation service that works across different deployment environments with configurable translator settings.
Your task is to create a translation service module that initializes translators with different configurations based on environment requirements. The service should support multiple deployment scenarios (production, testing, and restricted networks) with appropriate translator settings.
Create a Python module that provides translator instances configured for three different environments:
Implement a function get_translator(environment: str) that returns an appropriately configured translator instance based on the environment parameter. The function should accept "production", "development", or "restricted" as valid environment values.
@generates
def get_translator(environment: str):
"""
Returns a configured translator instance for the specified environment.
Args:
environment: One of "production", "development", or "restricted"
Returns:
A configured Translator instance
Raises:
ValueError: If environment is not recognized
"""
passProvides translation services via Google Translate API.
Install with Tessl CLI
npx tessl i tessl/pypi-googletrans@4.0.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10