Add files via upload

增加代理设置选项;
优化新版本google-generativeai 不支持 Client 类问题;
优化批量生成章节界面,使用customtkinter统一设计风格;
This commit is contained in:
PenBo1
2025-09-08 11:58:44 +08:00
committed by GitHub
parent db5057a4a2
commit 9ec873600d
29 changed files with 265 additions and 38 deletions
+12
View File
@@ -88,6 +88,18 @@ class NovelGeneratorGUI:
"retrieval_k": 4
}
# PenBo 增加代理功能支持
proxy_url = self.loaded_config["proxy_setting"]["proxy_url"]
proxy_port = self.loaded_config["proxy_setting"]["proxy_port"]
if self.loaded_config["proxy_setting"]["enabled"]:
os.environ['HTTP_PROXY'] = f"http://{proxy_url}:{proxy_port}"
os.environ['HTTPS_PROXY'] = f"http://{proxy_url}:{proxy_port}"
else:
os.environ.pop('HTTP_PROXY', None)
os.environ.pop('HTTPS_PROXY', None)
# -- LLM通用参数 --
# self.llm_conf_name = next(iter(self.loaded_config["llm_configs"]))
self.api_key_var = ctk.StringVar(value=llm_conf.get("api_key", ""))