优化:移除unused依赖、懒加载和容错处理

This commit is contained in:
Liang Jiaqing committed 2026-02-01 20:03:39 +08:00
1 parent da10ba404b
commit 6e6e5d989d
3 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -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]
+1 -1
View File
@@ -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):
+2 -1
View File
@@ -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() {