Find answers from the community

Updated 3 months ago

So I'm trying to run the new and shiny

So I'm trying to run the new and shiny npx create-llama command, and I keep getting this error message for NextJS
Plain Text
(node:20376) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/Users/tesseract/01-10 Engineering/01 Software Development/01.06 JavaScript/my-app/node_modules/llamaindex/dist/index.js:605
      throw new Error("Set OpenAI Key in OPENAI_API_KEY env variable");
            ^

Error: Set OpenAI Key in OPENAI_API_KEY env variable
    at new OpenAISession (/Users/tesseract/01-10 Engineering/01 Software Development/01.06 JavaScript/my-app/node_modules/llamaindex/dist/index.js:605:13)
    at getOpenAISession (/Users/tesseract/01-10 Engineering/01 Software Development/01.06 JavaScript/my-app/node_modules/llamaindex/dist/index.js:621:15)
    at new OpenAI2 (/Users/tesseract/01-10 Engineering/01 Software Development/01.06 JavaScript/my-app/node_modules/llamaindex/dist/index.js:1540:81)
    at serviceContextFromDefaults (/Users/tesseract/01-10 Engineering/01 Software Development/01.06 JavaScript/my-app/node_modules/llamaindex/dist/index.js:2083:71)
    at file:///Users/tesseract/01-10%20Engineering/01%20Software%20Development/01.06%20JavaScript/my-app/app/api/chat/engine/generate.mjs:41:26
    at file:///Users/tesseract/01-10%20Engineering/01%20Software%20Development/01.06%20JavaScript/my-app/app/api/chat/engine/generate.mjs:48:3
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v21.1.0

Aborting installation.
  npm run generate has failed.
L
A
16 comments
hmm I didn't run into this, but it might have been because I already had run export OPENAI_API_KEY=... in my terminal

I think @Yi Ding was looking into this
@Logan M yes, I did the same, I had to run export OPENAI.... command in my "new" tmux session to make this work.
I got create-llama working and I am blown away by how easy it was to set this up πŸ™‚ @Logan M I can't find instructions on how to regenerate the embeddings for RAG for new files that I've added to the data folder. Apologies in advance if its a basic question.
Glad you've liked it so far! I also find it super easy

I thiiiink you can run npm run generate again? Either that, or you need to delete the saved index from disk... let me locate that haha
I think there is a cache folder you can delete and then re-generate the index
(Other team members built this, and I only explored the fastapi version, so I'm learning in real time hahaha)
Fair enough πŸ™‚ I deleted the cache and ran npm run generate and now I get a wall of the following error message 😦 :
Attachment
CleanShot_2023-11-14.png
I have 3 new pdf files in the data folder with these sizes:
Attachment
CleanShot_2023-11-14_at_21.05.22.png
I think this is just a benign warning when reading pdfs
(thats what my google-fu tells me)
That looks right
hmm, let me restart and try again
I think the index generated properly, restarting should give it access to the new data πŸ™
yeah, i can confirm that it works. Genereting the embeddings took a while ( > 5 mins) but now it works. Many Thanks for your help πŸ™
Add a reply
Sign up and join the conversation on Discord