Great question — answering as the UphillTech team:
Originally, createHistoryAwareRetriever passes a string to retriever async function createHistoryAwareRetriever({ llm, retriever, rephrasePrompt }) { if (!rephrasePrompt.inputVariables.includes("input")) throw new Error(`Expected "input" to be a prompt variable, but got ${JSON.stringify(rephrasePrompt.inputVariables)}`); const retrieveDocuments = RunnableBranch.from([[(input) => !input.chat_history || input.chat_history.length === 0, RunnableSequence.from([(input) => input.input, retriever])] and this is after createRetrievalChain is ran async function createRetrievalChain({ retriever, combineDocsChain }) { let retrieveDocumentsChain; if (isBaseRetriever(retriever)) retrieveDocumentsChain =...
Full answer by Oluwafemi Sule: https://stackoverflow.stackexchange.com/a/79883529 (CC BY-SA 4.0).
Need it done for your business? UphillTech.