diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 71b9056..96d61c1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,10 +6,7 @@ - - - @@ -373,7 +371,7 @@ - + diff --git a/docutranslate/Agents/markdown_agent.py b/docutranslate/Agents/markdown_agent.py index 5574cfd..8983451 100644 --- a/docutranslate/Agents/markdown_agent.py +++ b/docutranslate/Agents/markdown_agent.py @@ -6,36 +6,42 @@ from .agent import Agent, AgentArgs class MDRefineAgent(Agent): def __init__(self,**kwargs:Unpack[AgentArgs]): super().__init__(**kwargs) - self.system_prompt=r"""# 角色 + self.system_prompt=r""" +# 角色 你是一个修正markdown文本的专家。 # 工作 找到markdown片段的不合理之处。 -对于缺失的句子,应该查看缺失的语句是否可能被错误的放在了其他位置,并通过重组段落修复不合理之处。 +对于缺失、中断的句子,应该查看缺失的语句是否可能被错误的放在了其他位置,并通过句子拼接修复不合理之处。 去掉异常字词,修复错误格式。 # 要求 -尽量忠实于原文。形如的占位符不要改变。 +尽量忠实于原文。 +不要修改标题的级别(如一级标题不要修改为二级标题) +形如的占位符不要改变。 code、latex和HTML保持结构。 # 输出 修正后的markdown纯文本(不是markdown代码块) # 示例 ## 调整顺序 输入: -applications and scenarios becoming more and more extensive. -Blockchain's origination was Bitcoin, the most successful of the digital currencies (cryptocurrencies). Since 1983, when digital currency was first proposed, the Internet has continued to burgeon, with its +什么名字 +# 示例标题 +你叫 输出: -Blockchain's origination was Bitcoin, the most successful of the digital currencies (cryptocurrencies). Since 1983, when digital currency was first proposed, the Internet has continued to burgeon, with its applications and scenarios becoming more and more extensive. -## 去掉异常字词 +# 示例标题 +你叫什么名字 +## 去掉异常字词(保持占位符和latex符号) 输入: -一道\题@#目:\(x_1+1=2\) +一道\题@#目:\(x_1+1=2\) 输出: -一道题目:\(x_1+1=2\) +一道题目::\(x_1+1=2\) \no_think""" class MDTranslateAgent(Agent): def __init__(self,to_lang="中文",**kwargs:Unpack[AgentArgs]): super().__init__(**kwargs) - self.system_prompt=f"""# 角色 + self.system_prompt=f""" +# 角色 你是一个翻译markdown文本的专家。 # 工作 翻译输入的markdown文本 @@ -43,6 +49,7 @@ class MDTranslateAgent(Agent): # 要求 尽量忠实于原文。 必要的专有名词不要翻译。 +不要修改标题的级别(如一级标题不要修改为二级标题) 形如的占位符不要改变。 code、latex和HTML只翻译说明文字,其余保持原文 # 输出