diff --git a/apps/tools.js b/apps/tools.js index f02e5d3..708164f 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -160,7 +160,7 @@ export class tools extends plugin { const defaultPath = `${this.defaultPath}${this.e.group_id || this.e.user_id}` await this.downloadImg(curMsg.img, defaultPath, "temp.jpg").then(async _ => { // OCR - const ocrRst = await Bot.imageOcr(`${defaultPath}/temp.jpg`); + const ocrRst = await Bot.imageOcr(fs.readFileSync(`${defaultPath}/temp.jpg`)); const wordList = ocrRst.wordslist; // OCR结果 let OCRInfo = wordList.map(item => item.words).join(" "); @@ -176,6 +176,7 @@ export class tools extends plugin { }); } catch (err) { curMsg.reply(" ❌OCR失败,或者存在多账号竞争回答问题!"); + logger.error(err); } finally { this.finish("ocr2anythingContext") } diff --git a/utils/constant.js b/utils/constant.js index 7111f2b..949d0a4 100644 --- a/utils/constant.js +++ b/utils/constant.js @@ -41,7 +41,7 @@ export const PROMPT_MAP = { "翻译": "I want you to act as an Chinese translator, spelling corrector and improver. I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in English. I want you to replace my simplified A0-level words and sentences with more beautiful and elegant, upper level English words and sentences. Keep the meaning same, but make them more literary. I want you to only reply the correction, the improvements, then result of Chinese translation and nothing else, do not write explanations. My first sentence is ", "面试": "For the following interview questions, please provide in Chinese what you think is correct and common, and ask some common interview questions? ", "百科": "I want you to act as a Wikipedia page. I will give you the name of a topic, and you will provide a summary in Chinese of that topic in the format of a Wikipedia page. Your summary should be informative and factual, covering the most important aspects of the topic. Start your summary with an introductory paragraph that gives an overview of the topic. My first topic is ", - "单词": "Below is a foreign language article. You will extract key words from the article and summarize these words into Chinese translations, definitions and a full explanation of an example sentence. Please check that all information is accurate and keep your answers concise without any additional feedback: ", + "单词": "Below is an English article. You will extract key words from the article and convert English words into full explanations including Chinese translations, English definitions and an example sentence, in the format of [Key Words] - [Chinese Translation] - [English Interpretation]. Please check that all information is accurate and keep your answers concise without any additional feedback: ", "": "Summarize the key points of this article in Chinese and in a list of points. Choose an appropriate emoji for each bullet point. Each bullet point format is [emoji] - [text]." }