#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""外网测速Skill"""

import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))

from skills.base_skill import BaseSkill
from network_tools import run_speed_test


class SpeedTestSkill(BaseSkill):
    """外网测速Skill"""
    
    def get_metadata(self):
        return {
            "name": "speed_test",
            "display_name": "外网测速",
            "description": "测试互联网带宽、下载速度和延迟",
            "category": "network",
            "keywords": ["测速", "网速", "带宽", "下载", "speed", "test"],
            "parameters": [],
            "examples": [
                "测试网速",
                "网速测试",
                "测速",
                "查看网速"
            ],
            "requires_admin": False,
            "requires_ui": False
        }
    
    def execute(self) -> str:
        """执行网速测试"""
        return run_speed_test()
