refactor: think

This commit is contained in:
莘权 马 2023-09-05 20:07:55 +08:00
parent 50835b8c47
commit 246bf5ce00

View file

@ -276,7 +276,9 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
return response
async def is_related(self, text1, text2):
command = f"Paragraph 1:{text1}\n\nParagraph 2:{text2}\n\nIf the two Paragraphs above are related, return [TRUE] brief and clear. Otherwise, return [FALSE]."
p1 = text1.replace("\n", " ")
p2 = text2.replace("\n", " ")
command = f"Paragraph 1:{p1}\n\nParagraph 2:{p2}\n\nIf the two Paragraphs above are related, return [TRUE] brief and clear. Otherwise, return [FALSE]."
rsp = await self.aask(msg=command, system_msgs=[])
result, _ = self.extract_info(rsp)
return result == "TRUE"