diff --git a/llama-index-core/llama_index/core/indices/struct_store/json_query.py b/llama-index-core/llama_index/core/indices/struct_store/json_query.py index 9e48eb7867e919c3fdac44123ac791aa2ba0e555..6b6909154f55cf0401dec71a43a4ebc46edb00f4 100644 --- a/llama-index-core/llama_index/core/indices/struct_store/json_query.py +++ b/llama-index-core/llama_index/core/indices/struct_store/json_query.py @@ -63,6 +63,9 @@ def default_output_response_parser(llm_output: str) -> str: def default_output_processor(llm_output: str, json_value: JSONType) -> JSONType: """Default output processor that extracts values based on JSON Path expressions.""" + # Post-process the LLM output to remove the JSONPath: prefix + llm_output = llm_output.replace("JSONPath: ", "").replace("JSON Path: ", "").strip() + # Split the given string into separate JSON Path expressions expressions = [expr.strip() for expr in llm_output.split(",")]