You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you very much for your work.
Please tell me which way to look. When I start, I get this error, I see the problem, but I can't figure out what to do.
How can I help? Who is Neil Armstrong?
file:///User/GitHub/langchain-mini/index.mjs:59
.then((res) => res.choices[0].text)
^
TypeError: Cannot read properties of undefined (reading '0')
at file:///User/GitHub/langchain-mini/index.mjs:59:31
at process.process Ticks And Rejection (node:internal/process/task_queues:95:5)
at asynccomplete Prompt (file:///User/GitHub/langchain-mini/index.mjs:43:3)
at async answer Question (file:///User/GitHub/langchain-mini/index.mjs:77:22)
at async file:///User/GitHub/langchain-mini/index.mjs:109:18
Node.js v18.15.0
The line index.mjs:59 says .then((res) => res.choices[0].text)
The text was updated successfully, but these errors were encountered:
Hi @brinrbc - thanks for raising this issue. This project is intended for educational purposes, to help you learn how to create 'chain of reasoning' applications with LLM. It isn't designed to be production ready. As a result, the code lacks any error checking :-)
This is your opportunity to learn! Clearly the OpenAI API has not returned the expected result. I'd recommend adding a console.log or breakpoint at that line of code to find out what it returned instead. It will likely be an error message (perhaps a lack of API as @MikeRalphson pointed out), that you can then debug.
Hi! Thank you very much for your work.
Please tell me which way to look. When I start, I get this error, I see the problem, but I can't figure out what to do.
The line index.mjs:59 says
.then((res) => res.choices[0].text)
The text was updated successfully, but these errors were encountered: