1.优化AI请求替换OpenAI SDK调用,使用httpx和自定义头请求,避免触发部分公益站的cloudflare

2.修复deepseek模型调用问题,舍弃思考过程AI响应内容,只获取结果内容
3.新增会话过期机制,更新后添加到.env中
4.支持用户在生成章节内容时设置字数
This commit is contained in:
xiamuceer
2025-11-03 15:28:51 +08:00
parent e02e61ed6b
commit 1cde345ed9
21 changed files with 1118 additions and 251 deletions
+6 -2
View File
@@ -302,7 +302,8 @@ export function useChapterSync() {
const generateChapterContentStream = useCallback(async (
chapterId: string,
onProgress?: (content: string) => void,
styleId?: number
styleId?: number,
targetWordCount?: number
) => {
try {
// 使用fetch处理流式响应
@@ -311,7 +312,10 @@ export function useChapterSync() {
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(styleId ? { style_id: styleId } : {}),
body: JSON.stringify({
style_id: styleId,
target_word_count: targetWordCount
}),
});
if (!response.ok) {