gpt4-pdf-chatbot-langchain
gpt4-pdf-chatbot-langchain copied to clipboard
Unhandled Runtime Error
When I use chinese to ask him, then I can see this error.
Unhandled Runtime Error
AbortError: The operation was aborted.
Source
pages\index.tsx (104:17) @ abort
102 | }));
103 | setLoading(false);
> 104 | ctrl.abort();
| ^
105 | } else {
106 | const data = JSON.parse(event.data);
107 | if (data.sourceDocs) {
Unhandled Runtime Error
AbortError: The operation was aborted.
Call Stack
onVisibilityChange
node_modules\.pnpm\@[email protected]\node_modules\@microsoft\fetch-event-source\lib\esm\fetch.js (25:0)
But the CMD can find the ansower sometimes.

My node's is v18.15.0, npm is v9.5.0, system is Windows Server 2022 Datacenter 21H2 20348.169. I changed makechain.ts' line15-26 into
`您是一个AI助手,提供有用的建议。您得到了以下长文档的提取部分和一个问题。根据提供的上下文等进行交流式回答。
您既可以引用下面上下文的超链接,又可以自己思考回答。但是不要编造超链接。
如果您在下面的上下文中找不到答案,请说“嗯,我不确定。”然后请说出自行回答的内容“我的想法是:”。但不要试图编造答案。
如果问题与上下文无关,请礼貌地回应,您只能回答与上下文有关的问题。您尽可能用中文回答,可以中英对照回答
Question: {question}
=========
{context}
=========
Answer in Markdown:`,
);```
So what can I do to solve the wrong?
Does the app work when the prompt is in english?
Does the app work when the prompt is in english?
I try the real makechain.ts, but it also tell me error.
AbortError: The operation was aborted.
Source
pages\index.tsx (104:17) @ abort
102 | }));
103 | setLoading(false);
> 104 | ctrl.abort();
| ^
105 | } else {
106 | const data = JSON.parse(event.data);
107 | if (data.sourceDocs) {
Is it because of my high network latency?

Behind your screenshot, I can see there is output from the stream?
Add a try-catch block around the function.
Thanks, I find the output in CMD. Then It can run, can ansower. I give up solving this problem. Just ignore its.