langchain/docs/modules/chains
Jon Luo 5bf8772f26
add option to use user-defined SQL table info (#1347)
Currently, table information is gathered through SQLAlchemy as complete
table DDL and a user-selected number of sample rows from each table.
This PR adds the option to use user-defined table information instead of
automatically collecting it. This will use the provided table
information and fall back to the automatic gathering for tables that the
user didn't provide information for.

Off the top of my head, there are a few cases where this can be quite
useful:
- The first n rows of a table are uninformative, or very similar to one
another. In this case, hand-crafting example rows for a table such that
they provide the good, diverse information can be very helpful. Another
approach we can think about later is getting a random sample of n rows
instead of the first n rows, but there are some performance
considerations that need to be taken there. Even so, hand-crafting the
sample rows is useful and can guarantee the model sees informative data.
- The user doesn't want every column to be available to the model. This
is not an elegant way to fulfill this specific need since the user would
have to provide the table definition instead of a simple list of columns
to include or ignore, but it does work for this purpose.
- For the developers, this makes it a lot easier to compare/benchmark
the performance of different prompting structures for providing table
information in the prompt.

These are cases I've run into myself (particularly cases 1 and 3) and
I've found these changes useful. Personally, I keep custom table info
for a few tables in a yaml file for versioning and easy loading.

Definitely open to other opinions/approaches though!
2023-02-28 18:58:04 -08:00
..
examples add option to use user-defined SQL table info (#1347) 2023-02-28 18:58:04 -08:00
generic chroma docs (#1012) 2023-02-12 23:02:01 -08:00
async_chain.ipynb Harrison/updating docs (#1196) 2023-02-20 22:54:26 -08:00
generic_how_to.rst Feature: linkcheck-action (#534) (#542) 2023-01-04 21:39:50 -08:00
getting_started.ipynb Documentation: Minor typo fixes (#1327) 2023-02-27 14:40:43 -08:00
how_to_guides.rst improve docs for indexes (#1146) 2023-02-19 23:14:50 -08:00
key_concepts.md Update key_concepts.md (#1209) (#1237) 2023-02-22 13:30:53 -08:00
utility_how_to.rst Harrison/new api chain (#623) 2023-01-15 18:34:43 -08:00