Fix JSON parsing error

This commit is contained in:
Larfii
2024-12-05 18:26:55 +08:00
parent 567fde643f
commit 9af3676991
2 changed files with 6 additions and 2 deletions

View File

@@ -479,7 +479,7 @@ async def kg_query(
print(result)
try:
# json_text = locate_json_string_body_from_string(result) # handled in use_model_func
result = re.search(r"{.*}", json_text, re.DOTALL)
result = re.search(r"{.*}", result, re.DOTALL)
keywords_data = json.loads(result)
hl_keywords = keywords_data.get("high_level_keywords", [])
ll_keywords = keywords_data.get("low_level_keywords", [])