#!/usr/bin/env python3 # -*- coding: utf-8 -*- """专题四 · 步骤 5 · 修改后:删除 chat.py 临时调试日志块。""" from __future__ import annotations import sys import _bootstrap # noqa: F401 import _config as C import _plugin_patch as P from dify_api import Dify def main() -> int: d = Dify(C.DIFY_EMAIL, C.DIFY_PASSWORD) try: d.login() chat_path = P.find_plugin_file(d, "chat.py") content = P.read_remote_file(d, chat_path) new_content = P.remove_debug_log(content) P.deploy_plugin_file(d, chat_path, new_content) print("已删除调试日志并重启 plugin_daemon") return 0 finally: d.close() if __name__ == "__main__": sys.exit(main())