FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
30.32k stars 15.66k forks source link

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

Closed Edisonwei54 closed 2 months ago

Edisonwei54 commented 11 months ago

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

HenryHengZJ commented 6 months ago

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