mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-23 01:49:58 +00:00
refactor: Refactor storage system (#937)
This commit is contained in:
@@ -73,9 +73,11 @@ def extract_content_open_ending(long_string, s1, s2, is_include: bool = False):
|
||||
return match_map
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
s = "abcd123efghijkjhhh456xxx123aa456yyy123bb456xx123"
|
||||
s1 = "123"
|
||||
s2 = "456"
|
||||
def _to_str(x, charset="utf8", errors="strict"):
|
||||
if x is None or isinstance(x, str):
|
||||
return x
|
||||
|
||||
print(extract_content_open_ending(s, s1, s2, True))
|
||||
if isinstance(x, bytes):
|
||||
return x.decode(charset, errors)
|
||||
|
||||
return str(x)
|
||||
|
Reference in New Issue
Block a user