ValueError: Invalid vector value passed: cannot interpret type <class 'str'> error when upserting sparse-dense vectors

When I try to upsert a vectors dictionary with each vector of format:

The type of id is <class ‘str’>
The type of sparse_values is <class ‘dict’>
The type of values is <class ‘list’>
The type of metadata is <class ‘dict’>

I get the error ValueError: Invalid vector value passed: cannot interpret type <class ‘str’>.

How do I fix this? I’ve checked with an example .json file from pinecone and my vectors dictionary format is in accordance with that in the example, therefore I’m very confused on why I get this error.

HI @angelommf21

can you provide an example that we can take a look at?

Best

I’ve figured it out. If I’m not mistaken (since I’ve tried so many different things to overcome the error) it was due to the type of numbers inside one of the vector lists (now I’m not sure which) being wrong.