tessl install tessl/pypi-googletrans@4.0.0An unofficial Google Translate API for Python providing free text translation and language detection capabilities
Agent Success
Agent success rate when using this tile
100%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
99%
Build a Python translation service that can operate behind corporate proxies with authentication requirements.
@generates
Your service should:
Create a TranslatorService class that:
The service should work with various proxy formats including:
"http://proxy.company.com:8080""http://proxy.example.com:8080" and translating "hello" to Spanish returns translated text @testfrom typing import Union, Dict
from httpx import Proxy
class TranslatorService:
"""Translation service that operates through configured proxies."""
def __init__(self, proxy: Union[str, Dict[str, str], Proxy]):
"""
Initialize the translator service with proxy configuration.
Args:
proxy: Proxy configuration - can be:
- String URL: "http://proxy.com:8080"
- Dict with scheme keys: {"http://": "...", "https://": "..."}
- httpx.Proxy object with authentication
"""
pass
async def translate(self, text: str, dest: str = 'en', src: str = 'auto') -> str:
"""
Translate text through the configured proxy.
Args:
text: Text to translate
dest: Destination language code
src: Source language code (default: 'auto' for auto-detection)
Returns:
Translated text
"""
pass
def update_proxy(self, proxy: Union[str, Dict[str, str], Proxy]):
"""
Update the proxy configuration.
Args:
proxy: New proxy configuration in any supported format
"""
pass
async def __aenter__(self):
"""Async context manager entry."""
pass
async def __aexit__(self, exc_type, exc_val, exc_tb):
"""Async context manager exit."""
passProvides translation capabilities with proxy support.
@satisfied-by