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

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how well the engineer uses the googletrans package's language detection capabilities to build a multi-language content analyzer. The focus is on proper usage of the Translator class, the detect() method, async context management, and handling detection results.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Translator Initialization",
      "description": "Uses the Translator class from googletrans to create a translator instance. Should instantiate the Translator class properly.",
      "max_score": 10
    },
    {
      "name": "Async Context Management",
      "description": "Uses 'async with Translator()' pattern to ensure proper resource cleanup and connection management. The Translator should be used as an async context manager.",
      "max_score": 15
    },
    {
      "name": "detect() Method Usage",
      "description": "Correctly uses the await translator.detect() method to detect language from text. Should call detect() with a text parameter and properly await the result.",
      "max_score": 20
    },
    {
      "name": "Detected Object Handling",
      "description": "Correctly accesses properties from the Detected object returned by detect(). Should access the 'lang' property for language code and 'confidence' property for confidence score.",
      "max_score": 20
    },
    {
      "name": "Batch Detection",
      "description": "Implements batch processing of multiple texts using googletrans. Can use either detect() in a loop or leverage the package's ability to handle lists. Should properly handle async operations for multiple texts.",
      "max_score": 15
    },
    {
      "name": "Async/Await Pattern",
      "description": "All functions that use googletrans are defined as async functions and properly await all translator operations. Should use 'async def' and 'await' keywords correctly throughout.",
      "max_score": 10
    },
    {
      "name": "Language Code Access",
      "description": "Correctly extracts and returns language codes from detection results. Should access the 'lang' attribute from Detected objects and include it in return values.",
      "max_score": 5
    },
    {
      "name": "Confidence Score Access",
      "description": "Correctly extracts and returns confidence scores from detection results. Should access the 'confidence' attribute from Detected objects and include it in return values.",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-googletrans@4.0.0

tile.json