
    i                     *    d e defdZddede defdZy)cityreturnc                 
    ddiS )z
    Fetch the city code for a given city name.
    Example response:
    {
        "city": "Beijing",
        "city_num": "1010",
    }
    city_numiu   )r   s    O/Users/bowang/.openclaw/workspace/ChatDev/functions/function_calling/weather.pyget_city_numr      s     	D     r   unitc                 8    d}|dk(  r|dz  dz  dz   }n|}| ||dS )z
    Fetch weather information for the city represented by ``city_num``.
    Example response:
    {
        "city_num": "1010",
        "temperature": 20,
        "unit": "celsius"
    }
       
fahrenheit	          )r   temperaturer
   r   )r   r
   temperature_cr   s       r   get_weatherr      s?     M|#a'!+b0# " r	   N)celsius)strdictr   intr   r   r	   r   <module>r      s2   s t # S  r	   