File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
volcenginesdkarkruntime/common/streaming/chat Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 2929 "httpx>=0.23.0, <1" ,
3030 "anyio>=3.5.0, <5" ,
3131 "cached-property; python_version < '3.8'" ,
32- "cryptography>=43.0.3, <43.0.4" ,
33- "jiter>=0.4.0, <1"
32+ "cryptography>=43.0.3, <43.0.4"
3433 ]
3534 },
3635)
Original file line number Diff line number Diff line change 1414)
1515from typing_extensions import Self , Iterator , assert_never
1616
17- from jiter import from_json
17+ try :
18+ from jiter import from_json
19+ except ImportError :
20+ import json
21+ from typing import Dict , Any
22+
23+ def from_json (json_str : bytes , partial_mode : bool ) -> Dict [str , Any ]:
24+ try :
25+ return json .loads (json_str )
26+ except json .JSONDecodeError as e :
27+ if partial_mode :
28+ return {}
29+ raise e
30+
1831
1932from ._types import (
2033 ParsedChoiceSnapshot ,
You can’t perform that action at this time.
0 commit comments