CA
flat-fuchsia

Getting error from Axios

Hi, I am following the sample code from langchain site https://js.langchain.com/docs/modules/indexes/document_loaders/examples/web_loaders/apify_dataset and I am getting into
[Nest] 18014 - 05/31/2023, 9:03:45 PM ERROR [ExceptionsHandler] Request failed with status code 400
Error: Request failed with status code 400
at createError (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (node:events:523:35)
at endReadableNT (node:internal/streams/readable:1367:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
[Nest] 18014 - 05/31/2023, 9:03:45 PM ERROR [ExceptionsHandler] Request failed with status code 400
Error: Request failed with status code 400
at createError (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (node:events:523:35)
at endReadableNT (node:internal/streams/readable:1367:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
error. Any idea what could be wrong?
Apify Dataset | 🦜️🔗 Langchain
This guide shows how to use Apify with LangChain to load documents from an Apify Dataset.
9 Replies
judicial-coral
judicial-coral3y ago
Hey there? Could you please elaborate - which exactly example are you following there? Did you already create an Apify acc. and ran an actor there? Would be great if you could provide more details.
flat-fuchsia
flat-fuchsiaOP3y ago
Absolutely. I'm following second example from the page I linked, nodejs example of loading data from the existing dataset (therefore, yes, I ran the actor and scraped the web successfully). Basically the only difference is that I've turned the example to the nestjs service. I'll remove the hardcoded security and share the code
flat-fuchsia
flat-fuchsiaOP3y ago
GitHub
GitHub - vorcigernix/apifipt
Contribute to vorcigernix/apifipt development by creating an account on GitHub.
judicial-coral
judicial-coral2y ago
Thanks, sent to the team for furhter investigation! hey, sorry for late reply, was rather sick for a couple of days. Response from one of our devs (not much news though):
I'm sorry but I can't get much out of the error. Can he wrap stuff inside the askGPT method in https://github.com/vorcigernix/apifipt/blob/master/src/app.service.ts in try-catch blocks to determine which part of the code is failing?
flat-fuchsia
flat-fuchsiaOP2y ago
No worries lemme check The error is in last function that call the chain. More specific error is:
TypeError: Cannot read properties of undefined (reading 'call')
at AppService.askGPT (/Users/adamsobotka/Develop/apifipt/src/app.service.ts:58:25)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at /Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@nestjs/core/router/router-proxy.js:9:17
[Nest] 12020 - 06/05/2023, 1:04:19 PM ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'text')
TypeError: Cannot read properties of undefined (reading 'call')
at AppService.askGPT (/Users/adamsobotka/Develop/apifipt/src/app.service.ts:58:25)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at /Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/adamsobotka/Develop/apifipt/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@nestjs/core/router/router-proxy.js:9:17
[Nest] 12020 - 06/05/2023, 1:04:19 PM ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'text')
judicial-coral
judicial-coral2y ago
Thanks! Passed to the team for further investigation 👍
Pepa J
Pepa J2y ago
Hello @Vorcigernix , I am curious, and maybe I am missing something. Based on the error is see your variable chain is undefined. The instance is constructed based on model and vectorStore. Non of these are related to the Apify enviroment right?
flat-fuchsia
flat-fuchsiaOP2y ago
Yeah, correct. Can't figure out why though. But nvm, I gave up on this.
MEE6
MEE62y ago
@Vorcigernix just advanced to level 1! Thanks for your contributions! 🎉

Did you find this page helpful?