fix: switch to DeepSeek API (deepseek-chat)

This commit is contained in:
hfshfg
2026-04-02 20:34:15 +08:00
parent c22ab032ec
commit 840e8ef734
2 changed files with 6 additions and 6 deletions

View File

@@ -59,7 +59,7 @@ const USER_PROMPT = `请生成今天(${TODAY})的内容,包含两部分:
function callGLM(apiKey) { function callGLM(apiKey) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const body = JSON.stringify({ const body = JSON.stringify({
model: 'glm-4-plus', model: 'deepseek-chat',
max_tokens: 1024, max_tokens: 1024,
messages: [ messages: [
{ role: 'system', content: SYSTEM_PROMPT }, { role: 'system', content: SYSTEM_PROMPT },
@@ -68,8 +68,8 @@ function callGLM(apiKey) {
}); });
const options = { const options = {
hostname: 'open.bigmodel.cn', hostname: 'api.deepseek.com',
path: '/api/paas/v4/chat/completions', path: '/chat/completions',
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -106,9 +106,9 @@ function callGLM(apiKey) {
} }
async function main() { async function main() {
const apiKey = process.env.ZHIPU_API_KEY; const apiKey = process.env.DEEPSEEK_API_KEY;
if (!apiKey) { if (!apiKey) {
console.error('ZHIPU_API_KEY not set'); console.error('DEEPSEEK_API_KEY not set');
process.exit(1); process.exit(1);
} }

View File

@@ -22,7 +22,7 @@ jobs:
- name: Generate daily content - name: Generate daily content
env: env:
ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: node .github/scripts/generate-daily.js run: node .github/scripts/generate-daily.js
- name: Commit and push changes - name: Commit and push changes