Skip to content

Commit

Permalink
Fixed sql_retriever.py bug
Browse files Browse the repository at this point in the history
strip gets rid of all the characters you mention in the parameter.

So my sql queries were being truncated if they had an s, a q or an l at the end. Example:

select * from candidates

ended up as 

select * from candidate
  • Loading branch information
dayglo authored Oct 9, 2024
1 parent 65946eb commit d823732
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d823732

Please sign in to comment.