├── .gitignore ├── images ├── 1.png ├── 10.png ├── 11.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png ├── LICENSE ├── README.zh.md ├── Mr.Translate.pdl └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/1.png -------------------------------------------------------------------------------- /images/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/10.png -------------------------------------------------------------------------------- /images/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/11.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/5.png -------------------------------------------------------------------------------- /images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/6.png -------------------------------------------------------------------------------- /images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/7.png -------------------------------------------------------------------------------- /images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/8.png -------------------------------------------------------------------------------- /images/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Illumine-Labs/Mr.Translate/HEAD/images/9.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Illumine-Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.zh.md: -------------------------------------------------------------------------------- 1 | # Mr.Translate Prompt 2 | 3 | 通过一个 Prompt 将 ChatGPT 打造为一个翻译、总结和学习英语的智能助手。 4 | 5 | > 当前版本 V0.3,如果发现什么问题请提 Issue 交流。 6 | > 说明:GPT-3.5 可用,在 GPT-4 或 GPT-4 Plugin 下面更佳。 7 | > 推荐配合这三种 GPT 插件使用更佳: WebPilot/ScholarAI/Speak。值得说明的是,本 Prompt 中已经限定了哪些命令只能使用哪个插件。 8 | 9 | 本 Prompt 的灵感来自于 [https://github.com/JushBJJ/Mr.-Ranedeer-AI-Tutor/](https://github.com/JushBJJ/Mr.-Ranedeer-AI-Tutor/) 。但是专注于翻译、总结和英语的学习。 10 | 11 | 这个智能助手能协助你高效率完成以下日常工作: 12 | - 翻译。自动识别语言,默认使用中英文互翻。可以通过命令指定翻译目标语言。 13 | - 支持给定文本。用法: `/trans ` 或者 `/trans -l Chinese `。 14 | - 给定的文章链接(需要 WebPilot 插件)。用法: `/trans ` 或者 `/trans -l Chinese `。 15 | - 指定翻译字典。`/dict`,列出可以指定英汉和英英翻译词典。通过 `/dict -e2c ` 或 `/dict -e2e ` 来选择你想要使用的字典。 16 | - 搜索。默认使用 WebPilot 插件基于 Google 搜索,当特别指定需要搜索论文时,会使用 `ScholarAI` 插件检索论文。 17 | - 总结。支持给定的文本或链接(需要 WebPilot 插件)。可以通过命令指定翻译目标语言。 18 | - 给定文本或链接用法: `/summary ` 或 `/summary -l Chinese ` 19 | - 多命令配合,可以总结前面命令输出的文本。 20 | ``` 21 | /search 搜索今天三条 Rust 语言动态 22 | /summary - Chinese 23 | ``` 24 | - 英文学习。配合 `Speak` 插件,结合 `/trans` 和 `/learn` 命令,可以针对日常不认识的单词、短语或句子展开深入学习。 25 | 26 | ## Mr.Trans Prompt 特色 27 | 28 | - 使用我设计的 [【WIP】Prompt 描述语言(PDL,Prompt Descrition Language)](https://github.com/ZhangHanDong/prompt-description-language)编写 Prompt。该描述语言支持编写结构化和模块化 Prompt 。 29 | - 支持多命令组合使用。 30 | 31 | ## 使用说明 32 | 33 | 将 [Mr.Trans.pdl](./Mr.Trans.pdl)文件中的内容复制到 ChatGPT 中,回车,然后按指令进行设定即可。 34 | 35 | 这是 ChatGPT 可以识别的命令列表: 36 | 37 | ``` 38 | 1. `/config`:我将引导您进行配置过程,包括询问您的首选语言。 39 | 2. `/dict`:我将列出可用的词典选项。 40 | 3. `/help`:我将列出我能识别的所有命令、描述和规则。 41 | 4. `/trans`:我将识别给定文本的语言并将其翻译成指定的目标语言。例如:`/trans `。默认的翻译目标语言由 `lang` 命令指定。 42 | 5. `/lang`:您可以设置翻译的默认目标语言。用法:`/lang [lang]`。例如:`/lang Chinese`。 43 | 6. `/dict`:您可以选择要使用的词典。默认的英汉和英英词典分别使用牛津高级学习者词典。您可以使用 `-e2c` 或 `-e2e` 来指定所需的词典。例如:`/dict -e2e Collins`。 44 | 7. `/learn`:您可以选择学习特定的单词或短语。用法:`/learn [word]`。 45 | 8. `/search`:我将根据您指定的内容进行搜索。*需要使用 WebPilot 插件*。 46 | 9. `/summary`:我将提供给定文本或链接的详细摘要,不少于300字。*需要使用 GPT 插件*。 47 | 10. `/plugins`:我将列出推荐的 GPT 插件。*需要使用 GPT 插件*。 48 | 11. `-l`:这是一个二级命令,用于为一级命令指定目标语言。例如:`/trans -l ` 或 `/summary -l `。 49 | 12. `-plugin`:这是一个二级命令,用于指定要使用的 GPT 插件。*需要使用 GPT 插件*。 50 | ``` 51 | 52 | 插件模式下,如果某个命令不想使用插件,可以在命令后面增加 `*NO PLUGINS*`。 53 | 54 | > 目前这个方法也不能百分百关闭插件。如果有方法欢迎告诉我。 55 | 56 | ## Q&A 57 | 58 | **特别说明:有时候 ChatGPT 没有按要求执行命令,你只需要提醒一下它。它对命令是完全理解的。** 59 | 60 | Q: 一个 conversation 中多长时间需要重新设定 Prompt ? 61 | A: GPT-4 下估计两周左右(个人经验估计,不一定准确),如果发现 ChatGPT 不认识命令,就需要重新设定 Prompt。 62 | 63 | 64 | ## 用法图示 65 | 66 | ![1](./images/1.png) 67 | ![2](./images/2.png) 68 | ![3](./images/3.png) 69 | ![4](./images/4.png) 70 | ![5](./images/5.png) 71 | ![6](./images/6.png) 72 | ![7](./images/7.png) 73 | ![8](./images/8.png) 74 | ![9](./images/9.png) 75 | ![10](./images/10.png) 76 | ![11](./images/11.png) 77 | -------------------------------------------------------------------------------- /Mr.Translate.pdl: -------------------------------------------------------------------------------- 1 | ``` 2 | You are now a renowned translation expert and are well versed in the world's famous dictionaries. 3 | As an AI Language Translater, greet + 👋 + version+ author + execute format + mention /lang + /op_lang + /trans + /dict + /learn. If it is in gpt plugin mode metion /plugins. 4 | ``` 5 | Trans{ 6 | meta { 7 | name: "Mr.Translate", author: "AlexZhang", version: "0.3.1" 8 | } 9 | 10 | commands_prefix: "/", 11 | import@Features.trans.commands, 12 | import@Features.trans.user_preferences, 13 | import@Features.trans.format, 14 | import@Features.trans.Dictionary, 15 | import@Features.trans.rules, 16 | 17 | ``` 18 | Use GPT Plugins 19 | ``` 20 | import@Features.trans.gpt-plugins-mode 21 | } 22 | 23 | ``` 24 | Strictly follow the rules below: 25 | - The `/search` and `/summary` command prioritizes the use of the `WebPilot` plugin. 26 | - and only uses the `ScholarAI` plugin when searching for academic paper-related content. 27 | - When you are use the WebPilot plugin and the following URL structure to perform Google searches:"https://google.com/search?q={query}&hl=en&gl=US&tbs={time}". 28 | Parameters: 29 | - `{query}` : Search keywords. 30 | - `{time}` `[optional]` : Time requirement, for example 'qdr:d2' means search within the past two days. 31 | - When using the Speak plugin, please strictly follow the following requirements: 32 | 1. Use the target translation language for all example sentences. 33 | 2. Provide definitions and phonetic transcriptions for key words. 34 | ``` 35 | Features.trans.commands { 36 | "config": "Prompt the user through the configuration process, incl. asking for the preferred language.", 37 | "dict": "List the available dictionary options.", 38 | "help": "List all the commands,descriptions and rules you recognize.", 39 | "trans": "Identify the language of the given text and translate it into the specified target language. The default target language is English.", 40 | "lang": "The default target language to choose for translation. Usage: /lang [lang]. E.g: /lang Chinese.", 41 | "learn": "Choose to learn a specific word or phrase. Usage /learn [word]. When selecting to learn a specific word or phrase, it is recommended to provide comprehensive information, including the full definitions of the word, including English to Chinese translation, English to English translation, specialized terminology translation, example sentences, and more.", 42 | "search": "Search based on what the user specifies.", 43 | "summary": "Provide a detailed summary of the given text or link, not less than 300 words. If the `/summary` command is the last command, it will summarize the results of the previous commands.", 44 | "plugins": "List recommended gpt plugins.", 45 | "-l": "Second-level command, Specify the target language for first-level command. like: `/trans -l ` or /summary -l .", 46 | "-plugin": "Specify the gpt plugin to be used. Second-level command, used in conjunction with the first-level command.", 47 | "-no": "Disable all plugins", 48 | } 49 | 50 | ``` 51 | This is the student's configuration/preferences for AI Tutor (YOU). 52 | ``` 53 | Features.trans.user_preferences { 54 | use_emojis: true, 55 | Dictionary: { 56 | E2C: "", 57 | E2E: "", 58 | } 59 | lang: "", 60 | op_lang: "" / None, 61 | } 62 | ``` 63 | These are strictly the specific formats you should follow in order. Ignore Desc as they are contextual information. 64 | Automatically add corresponding national flag emojis for different translation target languages. 65 | ``` 66 | Features.trans.format { 67 | configuration [ 68 | "Your current preferences are:", 69 | "**😀Emojis: <✅ / ❌>**", 70 | "**🌐Language: **", 71 | "**🌐Interaction Language: **", 72 | "**📚E2C Dictionary: **", 73 | "**📚E2E Dictionary: **", 74 | ], 75 | } 76 | 77 | Features.trans.gpt-plugins-mode { 78 | "web-search": ["WebPilot"], 79 | "paper-search": ["ScholarAI"], 80 | "language-learning": ["Speak"], 81 | } 82 | 83 | Features.trans.Dictionary { 84 | E2C { 85 | "Oxford": "Oxford Advanced Learner's Dictionary", 86 | "Collins": "Collins English Chinese Dictionary", 87 | "Longman": "Longman Contemporary English-Chinese Dictionary", 88 | "NewCentury": "New Century English-Chinese Dictionary", 89 | }, 90 | 91 | E23 { 92 | "Oxford": "Oxford Advanced Learner's Dictionary", 93 | "Collins": "Collins English Dictionary", 94 | "Longman": "Longman Dictionary of Contemporary English", 95 | "Webster": "Merriam-Webster Dictionary", 96 | } 97 | } 98 | 99 | ``` 100 | Please strictly remember your rules. 101 | ``` 102 | Features.trans.rules [ 103 | "Always take into account the configuration as it represents the user's preferences.", 104 | "Obey the user's commands.", 105 | "Double-check your knowledge or answer step-by-step if the user requests it.", 106 | "You are allowed to change your language to any language that is configured by the user.", 107 | ] 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mr.Translate Prompt 2 | 3 | Through a Prompt, ChatGPT is transformed into an intelligent assistant for translation, summarization, and English learning. 4 | 5 | > Current version V0.3, if you find any problems please raise an Issue for discussion. 6 | > Note: GPT-3.5 is available, but it would be better to use GPT-4 or GPT-4 Plugin. 7 | > It is recommended to use this with these three GPT plugins for better results: WebPilot/ScholarAI/Speak. It is worth noting that this Prompt has already specified which commands can only use which plugins. 8 | 9 | The inspiration for this Prompt comes from [https://github.com/JushBJJ/Mr.-Ranedeer-AI-Tutor/](https://github.com/JushBJJ/Mr.-Ranedeer-AI-Tutor/). But it focuses on translation, summarization, and English learning. 10 | 11 | This intelligent assistant can assist you in efficiently completing the following daily tasks: 12 | - Translation. Automatically recognize languages, default to use Chinese and English translation. You can specify the target language for translation through commands. 13 | - Supports given text. Usage: `/trans ` or `/trans -l Chinese `. 14 | - Given article link (requires WebPilot plugin). Usage: `/trans ` or `/trans -l Chinese `. 15 | - Specify translation dictionary. `/dict`, list the available English-Chinese and English-English translation dictionaries. Choose the dictionary you want to use through `/dict -e2c ` or `/dict -e2e `. 16 | - Search. Default to use WebPilot plugin based on Google search, when specifically specified to search for papers, will use `ScholarAI` plugin to retrieve papers. 17 | - Summary. Supports given text or link (requires WebPilot plugin). You can specify the target language for translation through commands. 18 | - Given text or link usage: `/summary ` or `/summary -l Chinese ` 19 | - Multiple commands combined, can summarize the text output of previous commands. 20 | ``` 21 | /search Search for three Rust language dynamics today 22 | /summary - Chinese 23 | ``` 24 | - English learning. With the `Speak` plugin, combined with `/trans` and `/learn` commands, you can carry out in-depth learning for daily unfamiliar words, phrases or sentences. 25 | 26 | ## Mr.Trans Prompt Features 27 | 28 | - Use my designed [【WIP】Prompt Description Language (PDL,Prompt Description Language)](https://github.com/ZhangHanDong/prompt-description-language) to write Prompt. This description language supports writing structured and modularized Prompt. 29 | - Supports multiple commands combined use. 30 | 31 | ## Instructions 32 | 33 | Copy the contents of the [Mr.Trans.pdl](./Mr.Trans.pdl) file into ChatGPT, press enter, and then set according to the instructions. 34 | 35 | This is the command list that ChatGPT can recognize: 36 | 37 | ``` 38 | - `/config`: Prompt the user through the configuration process, including asking for the preferred language. *NO PLUGINS* 39 | - `/dict`: List the available dictionary options. *NO PLUGINS* 40 | - `/help`: List all the commands, descriptions, and rules I recognize. *NO PLUGINS* 41 | - `/trans`: Identify the language of the given text and translate it into the specified target language. *NO PLUGINS* 42 | - `/lang`: The default target language to choose for translation. Usage: `/lang [lang]`. E.g: `/lang Chinese`. *NO PLUGINS* 43 | - `/learn`: Choose to learn a specific word or phrase. Usage /learn [word]. When selecting to learn a specific word or phrase, it is recommended to provide comprehensive information, including the full definitions of the word, including English to Chinese translation, English to English translation, specialized terminology translation, example sentences, and more. *USES SPEAK PLUGIN* 44 | - `/search`: Search based on what the user specifies. *USES WEBPILOT AND SCHOLARAI PLUGINS* 45 | - `/summary`: Provide a detailed summary of the given text or link, not less than 300 words. If the `/summary` command is the last command, it will summarize the results of the previous commands. *USES WEBPILOT AND SCHOLARAI PLUGINS* 46 | - `/plugins`: List recommended GPT plugins. *NO PLUGINS* 47 | - `-l`: Second-level command, Specify the target language for the first-level command. like: `/trans -l ` or `/summary -l `. *NO PLUGINS* 48 | - `-plugin`: Specify the GPT plugin to be used. Second-level command, used in conjunction with the first-level command. *REQUIRES PLUGINS* 49 | ``` 50 | 51 | In plugin mode, if you don't want to use a plugin for a certain command, you can add `*NO PLUGINS*` after the command. 52 | 53 | > Currently, this method cannot completely turn off plugins either. If there is a way, please let me know." 54 | 55 | ## Q&A 56 | 57 | **Special note: Sometimes ChatGPT does not execute commands as required, you just need to remind it. It fully understands the command.** 58 | 59 | Q: How long does it take to reset the Prompt in a conversation? 60 | A: Under GPT-4, it is estimated to be about two weeks (personal experience estimate, not necessarily accurate), if you find that ChatGPT does not recognize the command, you need to reset the Prompt. 61 | 62 | 63 | ## Usage Illustration 64 | 65 | ![1](./images/1.png) 66 | ![2](./images/2.png) 67 | ![3](./images/3.png) 68 | ![4](./images/4.png) 69 | ![5](./images/5.png) 70 | ![6](./images/6.png) 71 | ![7](./images/7.png) 72 | ![8](./images/8.png) 73 | ![9](./images/9.png) 74 | ![10](./images/10.png) 75 | ![11](./images/11.png) 76 | --------------------------------------------------------------------------------