mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-07-21 17:40:09 +00:00
reformat with black
This commit is contained in:
parent
fc2d663773
commit
acf01251f3
@ -43,10 +43,13 @@ class Claude(Base):
|
|||||||
|
|
||||||
def create_messages(self, text, intermediate_messages=None):
|
def create_messages(self, text, intermediate_messages=None):
|
||||||
"""Create messages for the current translation request"""
|
"""Create messages for the current translation request"""
|
||||||
current_msg = {"role": "user", "content": self.prompt_template.format(
|
current_msg = {
|
||||||
text=text,
|
"role": "user",
|
||||||
language=self.language,
|
"content": self.prompt_template.format(
|
||||||
)}
|
text=text,
|
||||||
|
language=self.language,
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
messages = []
|
messages = []
|
||||||
if intermediate_messages:
|
if intermediate_messages:
|
||||||
@ -67,12 +70,9 @@ class Claude(Base):
|
|||||||
"content": self.prompt_template.format(
|
"content": self.prompt_template.format(
|
||||||
text="\n\n".join(self.context_list),
|
text="\n\n".join(self.context_list),
|
||||||
language=self.language,
|
language=self.language,
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
{
|
{"role": "assistant", "content": "\n\n".join(self.context_translated_list)},
|
||||||
"role": "assistant",
|
|
||||||
"content": "\n\n".join(self.context_translated_list)
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def save_context(self, text, t_text):
|
def save_context(self, text, t_text):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user