mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00
替 BBM_CHATGPTAPI_SYS_MSG 與 BBM_CHATGPTAPI_USER_MSG_TEMPLATE 加入斷行能力 (#224)
This commit is contained in:
parent
ffb76baa21
commit
cc9e816c57
@ -50,8 +50,10 @@ class ChatGPTAPI(Base):
|
||||
openai.api_key = next(self.keys)
|
||||
|
||||
def create_chat_completion(self, text):
|
||||
content = self.prompt_template.format(text=text, language=self.language)
|
||||
sys_content = self.system_content or self.prompt_sys_msg
|
||||
content = self.prompt_template.format(
|
||||
text=text, language=self.language, crlf="\n"
|
||||
)
|
||||
sys_content = self.system_content or self.prompt_sys_msg.format(crlf="\n")
|
||||
messages = [
|
||||
{"role": "system", "content": sys_content},
|
||||
{"role": "user", "content": content},
|
||||
|
Loading…
x
Reference in New Issue
Block a user