partialjson 0.0.9__tar.gz → 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {partialjson-0.0.9 → partialjson-0.1.0}/PKG-INFO +1 -1
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson/__init__.py +1 -1
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson/json_parser.py +3 -3
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson.egg-info/PKG-INFO +1 -1
- {partialjson-0.0.9 → partialjson-0.1.0}/LICENSE +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/README.md +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson.egg-info/SOURCES.txt +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson.egg-info/dependency_links.txt +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/partialjson.egg-info/top_level.txt +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/setup.cfg +0 -0
- {partialjson-0.0.9 → partialjson-0.1.0}/setup.py +0 -0
|
@@ -6,7 +6,7 @@ Parsing ChatGPT JSON stream response — Partial and incomplete JSON parser pyth
|
|
|
6
6
|
|
|
7
7
|
from .json_parser import JSONParser
|
|
8
8
|
|
|
9
|
-
__version__ = "0.0
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
10
|
__author__ = "Nima Akbarzadeh"
|
|
11
11
|
__author_email__ = "iw4p@protonmail.com"
|
|
12
12
|
__license__ = "MIT"
|
|
@@ -117,14 +117,14 @@ class JSONParser:
|
|
|
117
117
|
return s[1:], ""
|
|
118
118
|
return s[1:], ""
|
|
119
119
|
else:
|
|
120
|
-
#
|
|
120
|
+
# Handle incomplete escape sequences
|
|
121
121
|
if incomplete_escape_regex.match(s[1:]):
|
|
122
|
-
return
|
|
122
|
+
return "", ""
|
|
123
123
|
# Attempt to parse the string without incomplete escape sequences
|
|
124
124
|
try:
|
|
125
125
|
return json.loads(f'"{s[1:]}"'), ""
|
|
126
126
|
except json.JSONDecodeError:
|
|
127
|
-
return
|
|
127
|
+
return "", ""
|
|
128
128
|
str_val = s[: end + 1]
|
|
129
129
|
s = s[end + 1 :]
|
|
130
130
|
if not self.strict:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|