From 6e6e5d989da695ad9f12ed4f4eda1da50eaeac59 Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Sun, 1 Feb 2026 20:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E7=A7=BB=E9=99=A4un?= =?UTF-8?q?used=E4=BE=9D=E8=B5=96=E3=80=81=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=92=8C=E5=AE=B9=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ga.py | 4 ++-- sidercall.py | 2 +- simphtml.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ga.py b/ga.py index 16aa93c..95f325d 100644 --- a/ga.py +++ b/ga.py @@ -1,4 +1,4 @@ -import sys, os, re, json, time, pyperclip, threading +import sys, os, re, json, time, threading from pathlib import Path import tempfile, traceback, subprocess, itertools, collections if sys.stdout is None: sys.stdout = open(os.devnull, "w") @@ -22,7 +22,7 @@ def code_run(code: str, code_type: str = "python", timeout: int = 60, cwd: str = tmp_file.write(code) tmp_path = tmp_file.name tmp_file.close() - cmd = ["python", "-X", "utf8", "-u", tmp_path] + cmd = [sys.executable, "-X", "utf8", "-u", tmp_path] elif code_type in ["powershell", "bash"]: if os.name == 'nt': cmd = ["powershell", "-NoProfile", "-NonInteractive", "-Command", code] else: cmd = ["bash", "-c", code] diff --git a/sidercall.py b/sidercall.py index cb0dbee..bf52f28 100644 --- a/sidercall.py +++ b/sidercall.py @@ -1,5 +1,4 @@ import os, json, re, time, requests -from sider_ai_api import Session try: from mykey import sider_cookie except ImportError: sider_cookie = "" @@ -8,6 +7,7 @@ except ImportError: oai_apikey = oai_apibase = oai_model = "" class SiderLLMSession: def __init__(self, default_model="gemini-3.0-flash"): + from sider_ai_api import Session self._core = Session(cookie=sider_cookie, proxies={'https':'127.0.0.1:2082'}) self.default_model = default_model def ask(self, prompt, model=None): diff --git a/simphtml.py b/simphtml.py index 4542e86..bbd3c93 100644 --- a/simphtml.py +++ b/simphtml.py @@ -1,4 +1,5 @@ -from bs4 import BeautifulSoup +try: from bs4 import BeautifulSoup +except ImportError: print("[Error] BeautifulSoup4 未安装,请叫Agent安装BeautifulSoup4,再使用web相关工具。") js_optHTML = r'''function optHTML() { function createEnhancedDOMCopy() {