提交 1c7abe14 编写于 作者: P practicer2015

Auto Commit

上级 553b27ff
...@@ -9,9 +9,7 @@ app = Flask(__name__) ...@@ -9,9 +9,7 @@ app = Flask(__name__)
# 设置 DeepSeek API 的相关信息 # 设置 DeepSeek API 的相关信息
DEEPSEEK_API_URL = "https://api.deepseek.com/v1/chat/completions" DEEPSEEK_API_URL = "https://api.deepseek.com/v1/chat/completions"
DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY") # 从环境变量获取 API 密钥 DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY") # 从环境变量获取 API 密钥
DEEPSEEK_API_KEY = input("请设置DEEPSEEK_API_KEY:")
if not DEEPSEEK_API_KEY:
raise ValueError("请设置 DEEPSEEK_API_KEY 环境变量")
# 配置日志记录 # 配置日志记录
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
...@@ -49,6 +47,10 @@ def judge(): ...@@ -49,6 +47,10 @@ def judge():
} }
logging.debug(f"payload: {json.dumps(payload, indent=2)}") logging.debug(f"payload: {json.dumps(payload, indent=2)}")
#if not DEEPSEEK_API_KEY:
#exit()
if not DEEPSEEK_API_KEY:
raise ValueError("请设置 DEEPSEEK_API_KEY 环境变量")
try: try:
# 发送请求到 DeepSeek API # 发送请求到 DeepSeek API
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册