fix hotbug🚀
This commit is contained in:
@ -175,5 +175,4 @@ def send_message(user: str, content: str) -> str:
|
||||
return f"成功向 {user} 发送了私信: '{content}'"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(get_weather("北京"))
|
||||
mcp.run(transport="stdio")
|
||||
@ -31,7 +31,8 @@ def get_city_weather(city):
|
||||
'locale': 'zh_CN',
|
||||
'days': '1'
|
||||
}
|
||||
response = requests.get(URL, params=params, verify=False)
|
||||
response = requests.get(URL, params=params)
|
||||
print(111, response)
|
||||
data = response.json()
|
||||
current = data['current']
|
||||
temperature = current['temperature']
|
||||
|
||||
12
main.py
12
main.py
@ -58,16 +58,8 @@ async def main():
|
||||
except KeyboardInterrupt:
|
||||
logger.info("程序被用户中断.")
|
||||
except Exception as e:
|
||||
logger.error(f"连接到 Lark WebSocket 失败: {str(e)}")
|
||||
sys.exit(1)
|
||||
finally:
|
||||
message_service.close()
|
||||
logger.info("消息服务关闭.")
|
||||
if mcp_process.is_alive():
|
||||
logger.info("Shutting down MCP server...")
|
||||
mcp_process.terminate()
|
||||
mcp_process.join()
|
||||
logger.info("MCP server shut down.")
|
||||
logger.error(f"Error: {str(e)}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user