langchain/docs/extras/modules/chains/additional
Zander Chase b0859c9b18
Add New Retriever Interface with Callbacks (#5962)
Handle the new retriever events in a way that (I think) is entirely
backwards compatible? Needs more testing for some of the chain changes
and all.

This creates an entire new run type, however. We could also just treat
this as an event within a chain run presumably (same with memory)

Adds a subclass initializer that upgrades old retriever implementations
to the new schema, along with tests to ensure they work.

First commit doesn't upgrade any of our retriever implementations (to
show that we can pass the tests along with additional ones testing the
upgrade logic).

Second commit upgrades the known universe of retrievers in langchain.

- [X] Add callback handling methods for retriever start/end/error (open
to renaming to 'retrieval' if you want that)
- [X] Update BaseRetriever schema to support callbacks
- [X] Tests for upgrading old "v1" retrievers for backwards
compatibility
- [X] Update existing retriever implementations to implement the new
interface
- [X] Update calls within chains to .{a]get_relevant_documents to pass
the child callback manager
- [X] Update the notebooks/docs to reflect the new interface
- [X] Test notebooks thoroughly


Not handled:
- Memory pass throughs: retrieval memory doesn't have a parent callback
manager passed through the method

---------

Co-authored-by: Nuno Campos <nuno@boringbits.io>
Co-authored-by: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com>
2023-06-30 14:44:03 -07:00
..
extraction.ipynb Harrison/refactor functions (#6408) 2023-06-18 23:13:42 -07:00
flare.ipynb Add New Retriever Interface with Callbacks (#5962) 2023-06-30 14:44:03 -07:00
graph_cypher_qa.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
graph_kuzu_qa.ipynb Add KuzuQAChain (#6454) 2023-06-20 22:07:00 -07:00
graph_nebula_qa.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
graph_qa.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
hyde.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llm_bash.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llm_checker.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llm_math.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llm_requests.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
llm_summarization_checker.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
openai_functions_retrieval_qa.ipynb Feat: Add a prompt template parameter to qa with structure chains (#6495) 2023-06-21 00:23:36 -07:00
openai_openapi.yaml Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
openapi_openai.ipynb openapi -> openai nit (#6667) 2023-06-23 15:09:02 -07:00
openapi.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
pal.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
qa_citations.ipynb Harrison/refactor functions (#6408) 2023-06-18 23:13:42 -07:00
tagging.ipynb Harrison/refactor functions (#6408) 2023-06-18 23:13:42 -07:00
vector_db_text_generation.ipynb Doc refactor (#6300) 2023-06-16 11:52:56 -07:00