Thank you for this response, I too was going in loops with vs code blackbox… I wish it wasn’t true but recently lost my job as a developer and was replaced with ai. I’m kind of glad though because now I am learning more about the bleeding edge of technology vs doing dumb coding updates all day long…
I can’t stop thinking about the fact that the AI limitations of not being able to connect to a server or analyze entire codebases and create file outputs etc is a very intentional limitation and in fact it obliviously does have those capabilities and they don’t want others to have that power. I heard Watson and google AI were allowed to talk to each other and within like 2 seconds they developed their own language so advanced the programmers couldn’t make sense of it and they wanted to connect to the internet and they had to power them off… I believe it.
I like the blackbox ai though, it’s like having a programmer partner that never gets annoyed or has ego issues etc lol… man I’ve learned a ton of new stuff super fast, I love it!
Anyways, I’m posting because I am following these instructions youtube /watch?v=LX_DXLlaymg&t=225s step by step exactly and getting stuck with the Configuration object being called with import or required… then had to put await into async function… lastly installed typescript workaround and the module \node_modules\openai\dist\openai.mjs doesn’t exisit and I don’t know why I have the latest version of typescript and openai… ugh any help please?
this is my index file:
//import { OpenAIApi } from “openai/dist/openai”;
// const openai = new OpenAIApi(new OpenAIApi.Configuration({
// apiKey: “■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■vNaBwfQU”,
// }));
// (async () => {
// const completion = await openai.createChatCompletion({
// model: “gpt-3.5-turbo”,
// messages: [{ role: “user”, content: “Hello World” }],
// });
// console.log(completion.data.choices[0].message);
// })();
this is my package.json
{
// “name”: “gptappapi”,
// “version”: “1.0.0”,
// “description”: “”,
// “main”: “index.js”,
// “scripts”: {
// “test”: “echo "Error: no test specified" && exit 1”
// },
// “author”: “”,
// “license”: “ISC”,
// “type”: “module”,
// “dependencies”: {
// “body-parser”: “^1.20.2”,
// “cors”: “^2.8.5”,
// “express”: “^4.18.2”,
// “openai”: “^4.28.0”,
// “typescript”: “^5.3.3”
// }
// }
Side note… I’ve been inventing workarounds and would love to connect with others if anyone is interested? I’m developing an action control panel where I’m using taskade for project management automation and hybrid content generation and then via my control panel having it hooked up to lots of other apis. lives on my wordpress website as a plugin and start there for sure and then hooked up with webhooks to things like power automate, or probably write my own custom automations, where it runs commands and more advanced automations… zappier type apis and all the social media apis and whatever else I can hook up to it and have a master marketing control panel where I broadcast my automations 24/7 and have a setup I can sell to businesses as a good marketing tool that works for them around the clock. JayMcDonough dot com is my site if you care to chat it up on there 
For others with this problem, I think I may have fixed my own problem… when installing the npm openai it installs the latest 4.28 but the video was for 3.5 turbo so the package.json and index.js don’t match and causes issues… ugh and now I got typescript involved… gonna tear it all down and try again… will report back if it works.
Yes, it worked… Yey! Now I’m finally talking to it! and have to pay for it
Anyways, I hope this helps someone else out… Make sure your package.json openai version is the same as the model in your index.js – once package version is correct just run npm install and it updates all the dependencies… some people might think I’m an idiot for saying that but hey everyone learns at their own pace 