#!/usr/bin/env python3 """ Inference Script for AccessibilityAudit-Env ============================================ MANDATORY STDOUT FORMAT: [START] task= env= model= [STEP] step= action= reward=<0.00> done= error= [END] success= steps= score= rewards= """ from __future__ import annotations import asyncio import os import textwrap from typing import List, Optional from openai import OpenAI from accessibility_audit_env import AccessibilityAuditAction, AccessibilityAuditEnv IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME") or os.getenv("IMAGE_NAME", "accessibility_audit_env:latest") HF_TOKEN = os.getenv("HF_TOKEN") API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1") MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct") BENCHMARK = "accessibility_audit" MAX_STEPS = 5 TEMPERATURE = 0.3 MAX_TOKENS = 4096 TASKS = ["easy", "medium", "hard", "expert"] SYSTEM_PROMPT = textwrap.dedent( """ You are a web accessibility expert. You receive HTML pages with WCAG 2.1 accessibility violations. Your job is to fix ALL violations while preserving the page's visual appearance and functionality. You will receive: 1. The current HTML source 2. A list of accessibility violations detected by axe-core (with rule IDs, impact levels, CSS selectors, and fix guidance) You must respond with the COMPLETE corrected HTML. Do not explain — just output the fixed HTML. Make surgical, minimal fixes. Do not rewrite the entire page. Common fixes: - Missing alt text: add descriptive alt attributes to - Missing labels: add