diff --git a/llama-index-core/llama_index/core/indices/struct_store/sql_retriever.py b/llama-index-core/llama_index/core/indices/struct_store/sql_retriever.py index 45c3d2e1c3514..102605b1802aa 100644 --- a/llama-index-core/llama_index/core/indices/struct_store/sql_retriever.py +++ b/llama-index-core/llama_index/core/indices/struct_store/sql_retriever.py @@ -143,7 +143,7 @@ def parse_response_to_sql(self, response: str, query_bundle: QueryBundle) -> str sql_result_start = response.find("SQLResult:") if sql_result_start != -1: response = response[:sql_result_start] - return response.strip().strip("```sql").strip("```").strip() + return response.replace("```sql", "").replace("```", "").strip() class PGVectorSQLParser(BaseSQLParser):