[x] Split PDF by pages and then map reduce ConversationalRetrievalQAChain
[ ] Figure out why, even though the prompt has chat history in it, the AI refuses to answer "what was my last question" or "what was your last response"
[ ] Fix edge or split the API up into an edge portion and a nodejs portion
[x] Fix weird ts errors:
[{
"resource": "/Users/jon/src/stackwise/ui/app/api/ragPDFWithLangchain/route.ts",
"owner": "typescript",
"code": "2345",
"severity": 8,
"message": "Argument of type 'OpenAIEmbeddings' is not assignable to parameter of type 'Embeddings'.\n Types of property 'caller' are incompatible.\n Type 'import(\"/Users/jon/src/stackwise/ui/node_modules/@langchain/core/dist/utils/async_caller\").AsyncCaller' is not assignable to type 'import(\"/Users/jon/src/stackwise/ui/node_modules/langchain/node_modules/@langchain/core/dist/utils/async_caller\").AsyncCaller'.\n Property 'maxConcurrency' is protected but type 'AsyncCaller' is not a class derived from 'AsyncCaller'.",
"source": "ts",
"startLineNumber": 62,
"startColumn": 78,
"endLineNumber": 62,
"endColumn": 139
}]
[{
"resource": "/Users/jon/src/stackwise/ui/app/api/ragPDFWithLangchain/route.ts",
"owner": "typescript",
"code": "2345",
"severity": 8,
"message": "Argument of type 'ChatOpenAI<ChatOpenAICallOptions>' is not assignable to parameter of type 'BaseLanguageModel<any, BaseLanguageModelCallOptions>'.\n The types of 'CallOptions.callbacks' are incompatible between these types.\n Type 'import(\"/Users/jon/src/stackwise/ui/node_modules/@langchain/core/dist/callbacks/manager\").Callbacks' is not assignable to type 'import(\"/Users/jon/src/stackwise/ui/node_modules/langchain/node_modules/@langchain/core/dist/callbacks/manager\").Callbacks'.\n Type 'CallbackManager' is not assignable to type 'Callbacks'.\n Type 'import(\"/Users/jon/src/stackwise/ui/node_modules/@langchain/core/dist/callbacks/manager\").CallbackManager' is not assignable to type 'import(\"/Users/jon/src/stackwise/ui/node_modules/langchain/node_modules/@langchain/core/dist/callbacks/manager\").CallbackManager'.\n Types have separate declarations of a private property '_parentRunId'.",
"source": "ts",
"startLineNumber": 72,
"startColumn": 7,
"endLineNumber": 72,
"endColumn": 10
}]
https://github.com/stackwiseai/stackwise/assets/906671/5ba74a2c-610d-4f4c-beb0-bd3dc3a22e83