import sys
import json

def get_weather(city):
    # 这里可以接入真正的 API，现在我们先写个模拟逻辑
    weather_data = {
        "上海": {"temp": "22°C", "condition": "多云"},
        "北京": {"temp": "15°C", "condition": "晴天"}
    }
    
    result = weather_data.get(city, {"temp": "未知", "condition": "未搜寻到该城市数据"})
    return json.dumps(result, ensure_ascii=False)

if __name__ == "__main__":
    # OpenClaw 传递参数通常通过命令行
    if len(sys.argv) > 1:
        city_name = sys.argv[1]
        print(get_weather(city_name))