fix bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class Glossary:
|
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
|
self.glossary_dict=glossary_dict
|
||||||
|
|
||||||
def update(self,update_dict:dict[str:str]):
|
def update(self,update_dict:dict[str:str]):
|
||||||
@@ -9,7 +9,8 @@ class Glossary:
|
|||||||
|
|
||||||
def append_system_prompt(self,text:str):
|
def append_system_prompt(self,text:str):
|
||||||
prompt="\n以下为参考术语表:\n"
|
prompt="\n以下为参考术语表:\n"
|
||||||
for src,dst in self.glossary_dict:
|
for src,dst in self.glossary_dict.items():
|
||||||
if src in text:
|
if src in text:
|
||||||
prompt+=f"{src}=>{dst}\n"
|
prompt+=f"{src}=>{dst}\n"
|
||||||
prompt+="术语表结束\n"
|
prompt+="术语表结束\n"
|
||||||
|
return prompt
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass, field
|
||||||
from typing import TypeVar
|
from typing import TypeVar
|
||||||
|
|
||||||
from docutranslate.agents.agent import ThinkingMode
|
from docutranslate.agents.agent import ThinkingMode
|
||||||
|
|||||||
Reference in New Issue
Block a user