refactor: think

This commit is contained in:
莘权 马 2023-09-05 23:18:18 +08:00
parent 703b2a9a24
commit a147bdf92a

View file

@ -318,8 +318,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
return windows
@staticmethod
def extract_info(input_string):
pattern = r"\[([A-Z]+)\]:\s*(.+)"
def extract_info(input_string, pattern=r"\[([A-Z]+)\]:\s*(.+)"):
match = re.match(pattern, input_string)
if match:
return match.group(1), match.group(2)