This commit is contained in:
xunbu
2025-08-27 21:23:25 +08:00
parent 1ffed8f280
commit 172f4ba9fd
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
class Glossary:
def __init__(self,glossary_dict:dict[str:str]|None=None):
def __init__(self,glossary_dict:dict[str:str]=None):
self.glossary_dict=glossary_dict
def update(self,update_dict:dict[str:str]):
@@ -9,7 +9,8 @@ class Glossary:
def append_system_prompt(self,text:str):
prompt="\n以下为参考术语表:\n"
for src,dst in self.glossary_dict:
for src,dst in self.glossary_dict.items():
if src in text:
prompt+=f"{src}=>{dst}\n"
prompt+="术语表结束\n"
return prompt