langchain
langchain copied to clipboard
Choose number of sample rows to add to table_info for SQLDatabase
#782 added the ability to include a sample row of a table to the prompt to provide more context for the model. As demonstrated in this paper, performance increases with the number of rows provided, up to 3 in their tests. This PR builds on #782 to allow for selecting the number of rows to include.
Also, a few of the outputs in the sqlite example notebook were incorrect for the chinook db - there are 8 entries in the employee table, not 9.
Ah yeah I was thinking about making a change to keep the original sample_row_in_table_info: bool
and instead adding an additional parameter for number of rows to include with default 1, which should keep it backwards compatible. Is something like that what you had in mind?
Ah yeah I was thinking about making a change to keep the original
sample_row_in_table_info: bool
and instead adding an additional parameter for number of rows to include with default 1, which should keep it backwards compatible. Is something like that what you had in mind?
yeah exactly!