Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[ERROR]: Cannot read properties of undefined (reading 'embedding')

Open Edisonwei54 opened this issue 2 years ago • 1 comments

Describe the bug When I use this component of LocalAI to call the embedding model deployed on another server through the API, the vector computation process is successful, but when the data is transferred to memory, it returns this error.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'cd /root/app/Flowise/docker'
  2. Click on 'docker-compose up'
  3. Scroll down to '....' 123
  4. Go to 'cd /root/app/Flowise/LocalAI'
  5. Click on 'docker-compose up' . See error

Expected behavior I hope that when I call my embedding model through localai, the interface can be successfully stored in my local memory, so that my LLM can answer questions based on my text

Screenshots image

Flow flowise_1 | 2023-10-31 11:26:31 [INFO]: POST /api/v1/chatmessage/628a845f-8876-48ab-a4a7-74cf8f660768 flowise_1 | 2023-10-31 11:26:31 [INFO]: POST /api/v1/internal-prediction/628a845f-8876-48ab-a4a7-74cf8f660768 flowise_1 | 2023-10-31 11:26:32 [ERROR]: Cannot read properties of undefined (reading 'embedding') flowise_1 | TypeError: Cannot read properties of undefined (reading 'embedding') flowise_1 | at OpenAIEmbeddings.embedDocuments (/usr/local/lib/node_modules/flowise/node_modules/langchain/dist/embeddings/openai.cjs:153:50) flowise_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) flowise_1 | at async MemoryVectorStore.addDocuments (/usr/local/lib/node_modules/flowise/node_modules/langchain/dist/vectorstores/memory.cjs:41:32) flowise_1 | at async MemoryVectorStore.fromDocuments (/usr/local/lib/node_modules/flowise/node_modules/langchain/dist/vectorstores/memory.cjs:129:9) flowise_1 | at async InMemoryVectorStore_VectorStores.init (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/vectorstores/InMemory/InMemoryVectorStore.js:62:29) flowise_1 | at async buildLangchain (/usr/local/lib/node_modules/flowise/dist/utils/index.js:223:50) flowise_1 | at async App.processPrediction (/usr/local/lib/node_modules/flowise/dist/index.js:816:40) flowise_1 | at async /usr/local/lib/node_modules/flowise/dist/index.js:609:13 flowise_1 | 2023-10-31 11:26:32 [ERROR]: [server]: Error: TypeError: Cannot read properties of undefined (reading 'embedding') flowise_1 | Error: TypeError: Cannot read properties of undefined (reading 'embedding') flowise_1 | at buildLangchain (/usr/local/lib/node_modules/flowise/dist/utils/index.js:235:19) flowise_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) flowise_1 | at async App.processPrediction (/usr/local/lib/node_modules/flowise/dist/index.js:816:40) flowise_1 | at async /usr/local/lib/node_modules/flowise/dist/index.js:609:13 flowise_1 | 2023-10-31 11:26:32 [INFO]: POST /api/v1/chatmessage/628a845f-8876-48ab-a4a7-74cf8f660768

Setup $N8AN6@D_ZZL6XHC`WW0UUL

Additional context nothing

Edisonwei54 avatar Oct 31 '23 12:10 Edisonwei54

for some reason it was calling OpenAIEmbeddings instead of LocalAI Embeddings, my suggestion is to try create a new chatflow with a blank canvas and see if issue still persits

HenryHengZJ avatar Mar 30 '24 09:03 HenryHengZJ