mirror of https://github.com/hwchase17/langchain
SQL Query Prompt update + added _execute method for SQLDatabase (#8100)
- Description: This pull request (PR) includes two minor changes: 1. Updated the default prompt for SQL Query Checker: The current prompt does not clearly specify the final response that the LLM (Language Model) should provide when checking for the query if `use_query_checker` is enabled in SQLDatabase Chain. As a result, the LLM adds extra words like "Here is your updated query" to the response. However, this causes a syntax error when executing the SQL command in SQLDatabaseChain, as these additional words are also included in the SQL query. 2. Moved the query's execution part into a separate method for SQLDatabase: The purpose of this change is to provide users with more flexibility when obtaining the result of an SQL query in the original form returned by sqlalchemy. In the previous implementation, the run method returned the results as a string. By creating a distinct method for execution, users can now receive the results in original format, which proves helpful in various scenarios. For example, during the development of a tool, I found it advantageous to obtain results in original format rather than a string, as currently done by the run method. - Tag maintainer: @hinthornw --------- Co-authored-by: Bagatur <baskaryan@gmail.com>pull/8553/head
parent
844eca98d5
commit
144b4c0c78
Loading…
Reference in New Issue