or run

tessl search
Log in

Version

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

tessl/pypi-modal

tessl install tessl/pypi-modal@1.1.0

Python client library for Modal, a serverless cloud computing platform that enables developers to run Python code in the cloud with on-demand access to compute resources.

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.6x

Baseline

Agent success rate without this tile

53%

task.mdevals/scenario-1/

Interactive Data Validator

Problem Statement

Build a cloud-based data validation tool that processes data entries and allows interactive correction when validation issues are detected. The tool should run computations remotely and provide a mechanism for human-in-the-loop intervention when automatic validation cannot determine the correct action.

Requirements

  1. Create a remote function that validates data entries against specific rules
  2. When validation fails or is ambiguous, enable interactive user input to decide how to proceed
  3. The function should accept a list of data records and return validated/corrected records
  4. Each data record is a dictionary with fields: name (string), age (integer), and email (string)

Validation Rules

  • name: Must be non-empty and contain only alphabetic characters and spaces
  • age: Must be between 0 and 120
  • email: Must contain exactly one '@' symbol and at least one '.' after the '@'

Interactive Behavior

When a validation rule fails:

  1. Display the problematic record to the user
  2. Show which validation rule failed
  3. Prompt the user to either:
    • Provide a corrected value
    • Skip the record (exclude from output)
    • Keep the original value anyway

Implementation Details

  • Use a remote execution environment with proper PTY support
  • The main processing should happen in a cloud function, not locally
  • Return a list of validated/corrected records
  • Implement your solution in a file named validator.py

Dependencies { .dependencies }

modal { .dependency }

Provides serverless cloud computing capabilities for remote code execution.

Test Cases

Test 1: Valid records pass through unchanged { .test }

Input:

records = [
    {"name": "Alice Smith", "age": 30, "email": "alice@example.com"},
    {"name": "Bob Jones", "age": 25, "email": "bob@test.org"}
]

Expected behavior: All records should pass validation without requiring interactive input and be returned unchanged.

Test 2: Invalid record triggers interaction { .test }

Input:

records = [
    {"name": "Charlie123", "age": 30, "email": "charlie@example.com"}
]

Expected behavior: The validator should detect that the name contains invalid characters (digits), pause execution, and wait for user input on how to correct or handle the invalid record.

Test 3: Multiple validation issues { .test }

Input:

records = [
    {"name": "Dave", "age": 150, "email": "dave.example.com"}
]

Expected behavior: The validator should detect multiple issues (age out of range, email missing '@') and allow interactive correction for each problem field.