feat: 首次推送到Gitea - 完整项目代码 + 安全加固 + 知识库
This commit is contained in:
@@ -36,12 +36,12 @@ function getOpenAI() {
|
||||
if (!process.env.DEEPSEEK_API_KEY) return null;
|
||||
_openai = new OpenAI({
|
||||
apiKey: process.env.DEEPSEEK_API_KEY,
|
||||
baseURL: "https://api.deepseek.com/v1",
|
||||
baseURL: "https://api.deepseek.com",
|
||||
});
|
||||
return _openai;
|
||||
}
|
||||
|
||||
const MODEL = process.env.DEEPSEEK_MODEL || "deepseek-chat";
|
||||
const MODEL = process.env.DEEPSEEK_MODEL || "deepseek-v4-pro";
|
||||
|
||||
function ts() {
|
||||
return `[${new Date().toISOString()}]`;
|
||||
@@ -219,7 +219,8 @@ async function extractInsightWithLLM(botChar, topic) {
|
||||
model: MODEL,
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
temperature: 0.6,
|
||||
max_tokens: 800,
|
||||
// DeepSeek V4 推理 token 计入 max_tokens,预算不足会导致正文截断/为空
|
||||
max_tokens: 4096,
|
||||
})
|
||||
);
|
||||
const text = response.choices?.[0]?.message?.content?.trim() || "";
|
||||
|
||||
Reference in New Issue
Block a user