langchain/docs/docs
Rohan Dey 41a4c06a94
Added support for a Pandas DataFrame OutputParser (#13257)
**Description:**

Added support for a Pandas DataFrame OutputParser with format
instructions, along with unit tests and a demo notebook. Namely, we've
added the ability to request data from a DataFrame, have the LLM parse
the request, and then use that request to retrieve a well-formatted
response.

Within LangChain, it seamlessly integrates with language models like
OpenAI's `text-davinci-003`, facilitating streamlined interaction using
the format instructions (just like the other output parsers).

This parser structures its requests as
`<operation/column/row>[<optional_array_params>]`. The instructions
detail permissible operations, valid columns, and array formats,
ensuring clarity and adherence to the required format.

For example:

- When the LLM receives the input: "Retrieve the mean of `num_legs` from
rows 1 to 3."
- The provided format instructions guide the LLM to structure the
request as: "mean:num_legs[1..3]".

The parser processes this formatted request, leveraging the LLM's
understanding to extract the mean of `num_legs` from rows 1 to 3 within
the Pandas DataFrame.

This integration allows users to communicate requests naturally, with
the LLM transforming these instructions into structured commands
understood by the `PandasDataFrameOutputParser`. The format instructions
act as a bridge between natural language queries and precise DataFrame
operations, optimizing communication and data retrieval.

**Issue:**

- https://github.com/langchain-ai/langchain/issues/11532

**Dependencies:**

No additional dependencies :)

**Tag maintainer:**

@baskaryan 

**Twitter handle:**

No need. :)

---------

Co-authored-by: Wasee Alam <waseealam@protonmail.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-11-29 22:08:50 -05:00
..
_templates Restructure docs (#11620) 2023-10-10 12:55:19 -07:00
additional_resources new course on DeepLearning.ai (#12755) 2023-11-10 13:55:27 -08:00
expression_language Update index.mdx (#13285) 2023-11-29 22:06:33 -05:00
get_started DOCS: updated langchain stack img to be svg (#13540) 2023-11-19 16:26:53 -08:00
guides experimental[patch] Update prompt injection model (#13930) 2023-11-27 17:56:53 -05:00
integrations Support Vald secure connection (#13269) 2023-11-29 22:07:29 -05:00
langsmith DOCS: format notebooks (#13371) 2023-11-14 14:17:44 -08:00
modules Added support for a Pandas DataFrame OutputParser (#13257) 2023-11-29 22:08:50 -05:00
use_cases langchain[minor]: Reduce the number of tokens required to describe a Cypher/Neo4j schema (#13851) 2023-11-29 11:13:12 -08:00
.gitignore Restructure docs (#11620) 2023-10-10 12:55:19 -07:00
community.md Minor fix (#11748) 2023-10-12 22:36:31 -07:00
security.md Update security.md (#11942) 2023-10-23 15:35:33 -04:00