fix JSON parsing error
This commit is contained in:
parent
e99832cc13
commit
254330813a
1 changed files with 1 additions and 0 deletions
|
|
@ -479,6 +479,7 @@ async def kg_query(
|
||||||
print(result)
|
print(result)
|
||||||
try:
|
try:
|
||||||
# json_text = locate_json_string_body_from_string(result) # handled in use_model_func
|
# json_text = locate_json_string_body_from_string(result) # handled in use_model_func
|
||||||
|
result = re.search(r"{.*}", json_text, re.DOTALL)
|
||||||
keywords_data = json.loads(result)
|
keywords_data = json.loads(result)
|
||||||
hl_keywords = keywords_data.get("high_level_keywords", [])
|
hl_keywords = keywords_data.get("high_level_keywords", [])
|
||||||
ll_keywords = keywords_data.get("low_level_keywords", [])
|
ll_keywords = keywords_data.get("low_level_keywords", [])
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue