From 3f62930231c6f3b67bfc14f424c9827359f3c627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=81=97=E5=BF=98=E7=9A=84=E8=AE=B0=E5=BF=86?= <32097237+YIWANG-sketch@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:50:34 +0800 Subject: [PATCH] upload files compatible with both txt and docx formats --- provider.mjs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/provider.mjs b/provider.mjs index b68d942..3e06abe 100644 --- a/provider.mjs +++ b/provider.mjs @@ -779,12 +779,8 @@ class YouProvider { let previousMessages = formattedMessages.map((msg) => `${msg.role}: ${msg.content}`).join("\n\n"); // 创建本地副本(用于调试) - const localCopyPath = path.join(__dirname, 'local_copy_formatted_messages.' + this.uploadFileFormat); - if (this.uploadFileFormat === 'docx') { - await createDocx(previousMessages, localCopyPath); - } else { - fs.writeFileSync(localCopyPath, previousMessages); - } + const localCopyPath = path.join(__dirname, 'local_copy_formatted_messages.txt'); + fs.writeFileSync(localCopyPath, previousMessages); console.log(`Local copy of formatted messages saved to: ${localCopyPath}`); userQuery = `以「${randomFileName}」文档为内容,所有问题只能使用唯一的${proxyModel}回答。禁止使用you.com搜索,禁止使用You.com AI进行回复,否则将是严重的作弊行为。`;