or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/googletrans@4.0.x
tile.json

tessl/pypi-googletrans

tessl install tessl/pypi-googletrans@4.0.0

An 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%

task.mdevals/scenario-3/

Translation Service Comparator

Build a tool that compares translation results from different service endpoint configurations.

Requirements

Create a Python module that compares how translations behave when using different service endpoints:

Service Endpoint Comparison

The tool should:

  • Accept multiple service URLs as input
  • Translate the same text using each service URL configuration
  • Return results showing translations from each endpoint

Translation Execution

For a given text and target language:

  • Create translator instances with different service URLs
  • Execute the same translation request with each instance
  • Collect the translated text from each service

Test Cases

  • Translating "Hello world" to Spanish using a single service URL returns the Spanish translation @test
  • Comparing translations across two different service URLs returns results from both @test
  • The tool properly handles async context managers for each translator instance @test

Implementation

@generates

API

from typing import List, Dict

async def compare_translations(
    text: str,
    dest_lang: str,
    service_urls: List[str]
) -> Dict[str, str]:
    """
    Compare translations of the same text across different service endpoints.

    Args:
        text: The text to translate
        dest_lang: Target language code (e.g., 'es', 'fr', 'ja')
        service_urls: List of service URLs to use for translation

    Returns:
        Dictionary mapping service URL to translated text
    """
    pass

Dependencies { .dependencies }

googletrans { .dependency }

Provides translation services with configurable backend URLs.

@satisfied-by