langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
32.38k stars 3.97k forks source link

Error Pinecone #4281

Open irshadmb opened 2 hours ago

irshadmb commented 2 hours ago

Bug Description

Error building Component Pinecone: Invalid type for variable '0'. Required value type is float and passed type was float64 at ['values'][0]

Reproduction

image

Expected behavior

It must not give error

Who can help?

No response

Operating System

Docker

Langflow Version

1.0.19

Python Version

None

Screenshot

No response

Flow File

No response

dosubot[bot] commented 2 hours ago

Hi @irshadmb! I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this together!

The error you're encountering is due to a type mismatch where a float64 value is being passed instead of a float. This issue often arises when handling numerical data types in Python, especially when using libraries like NumPy, which default to float64.

To resolve this, you can explicitly convert the float64 values to float before storing them in Pinecone. If you're using NumPy arrays, you can convert them using the .astype(float) method. Here's a quick example:

import numpy as np

# Example array with float64
float64_array = np.array([1.0, 2.0, 3.0], dtype=np.float64)

# Convert to float
float_array = float64_array.astype(float)

Ensure that this conversion is done in the part of your code where embeddings are prepared before being sent to Pinecone. This should help in preventing the type mismatch error.

To continue talking to Dosu, mention @dosu.