mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
refactor: think
This commit is contained in:
parent
0b412008c4
commit
caff43e196
1 changed files with 3 additions and 3 deletions
|
|
@ -280,14 +280,14 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
|
|||
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=[])
|
||||
logger.info(f"RELATED:{rsp}\n\n{p1}\n{p2}")
|
||||
result, _ = self.extract_info(rsp)
|
||||
return result == "TRUE"
|
||||
|
||||
async def rewrite(self, sentence: str, context: str):
|
||||
command = (
|
||||
f"{context}\n\nConsidering the content above, rewrite and return this sentence brief and clear:\n{sentence}"
|
||||
)
|
||||
command = f"{context}\n\nTaking into account the information above, please rephrase and provide the revised sentence:\n{sentence}"
|
||||
rsp = await self.aask(msg=command, system_msgs=[])
|
||||
logger.info(f"REWRITE:{rsp}\nFROM\n\n{sentence}")
|
||||
return rsp
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue