CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-googletrans

An unofficial Google Translate API for Python providing free text translation and language detection capabilities

Overall
score

100%

Evaluation100%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-9/

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

Install with Tessl CLI

npx tessl i tessl/pypi-googletrans@4.0.0

tile.json