embedings template

I tried to run the embeddings template and I also set the OPENAI_API_KEY and PINECONE_API_KEY keys and I got this error whtn I run wasp db seed [ Db ] Running seed: embedSeedScript [ Db ] Error generating embeddings: PineconeConfigurationError: The client configuration must have required property: apiKey. You can find the configuration values for your project in the Pinecone developer console at https://app.pinecone.io. [ Db ] at new Pinecone (/mnt/c/Users/RogerBagueMasanes/Documents/personal/wasp_projects/Marinerito-GPT/node_modules/@pinecone-database/pinecone/src/pinecone.ts:117:13) [ Db ] at initPinecone (/mnt/c/Users/RogerBagueMasanes/Documents/personal/wasp_projects/Marinerito-GPT/src/embeddings/utils.ts:6:10) [ Db ] at generateEmbeddings (/mnt/c/Users/RogerBagueMasanes/Documents/personal/wasp_projects/Marinerito-GPT/src/embeddings/generateEmbeddings.ts:181:28) [ Db ] at async Object.embedSeedScript (/mnt/c/Users/RogerBagueMasanes/Documents/personal/wasp_projects/Marinerito-GPT/src/seeds/seedEmbeddings.ts:9:3) [ Db ] at async main (/mnt/c/Users/RogerBagueMasanes/Documents/personal/wasp_projects/Marinerito-GPT/.wasp/out/server/src/dbSeed.ts:23:10) { [ Db ] cause: undefined [ Db ] }
Pinecone Console
Long-term memory for AI
3 Replies
kapa.ai
kapa.ai4mo ago
Hi @pollastrepiupiu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It looks like you're encountering an issue with the Pinecone configuration in the Wasp embeddings template. The error indicates that the Pinecone client can't find the API key, even though you mentioned you've set it. This is likely due to an outdated version of the Pinecone SDK in the embeddings template. According to other users who faced similar issues, the template uses an older version of Pinecone (0.X), while the current stable version is 1.X. As one user reported:
I figured out that the implemented pinecone version was outdated (0.X), and I upgraded the pinecone implementations from the embedding template to V1.X. Now it works
Discord support thread To fix this issue, you should: 1. Update the Pinecone implementation in your project to use version 1.X 2. Make sure your environment variables are correctly set in the .env.server file 3. Run wasp clean and then wasp start to refresh your project This issue has been recognized by the Wasp team and there's an open GitHub issue about it: Issue #1725. Also, ensure that you've created an index in Pinecone as mentioned in the template setup instructions, and that all your environment variables are correctly formatted in the .env.server file. Let me know if updating the Pinecone implementation resolves your issue! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @pollastrepiupiu, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Filip
Filip4mo ago
Hmm, @miho do you mind taking this one? You might know it right of the bat
miho
miho4mo ago
What does your .env.server look like? (Replace parts of the secrets with XXX) For me it looks like this:
# https://platform.openai.com/account/api-keys
OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXX

# sign up for a free tier account at https://www.pinecone.io/
PINECONE_API_KEY=XXXXXXX-XXX-XXXX-XXXX-XXXXXXXX

# will be a location, e.g 'us-west4-gcp-free'
PINECONE_ENV=us-east-1

# if you're not using `wasp db start` and setting up a local database yourself, you can use the following
# DATABASE_URL=
# https://platform.openai.com/account/api-keys
OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXX

# sign up for a free tier account at https://www.pinecone.io/
PINECONE_API_KEY=XXXXXXX-XXX-XXXX-XXXX-XXXXXXXX

# will be a location, e.g 'us-west4-gcp-free'
PINECONE_ENV=us-east-1

# if you're not using `wasp db start` and setting up a local database yourself, you can use the following
# DATABASE_URL=

Did you find this page helpful?