Hi @attaashat6 and welcome to the Pinecone community forums!
Thank you for your question.
Based off the fact that your error message includes an HTTP status code of 400 - and the error message - it seems there’s an issue in the way you’re currently handling the query embedding.
Here are some thoughts to hopefully help unstick you after reading through your code briefly:
- Add more logging: If you can add a print statement after every line to verify your output format is as expected and that the format of your vectors you’re planning to upsert matches what Pinecone is expecting.
- Verify Vector Dimensions: Ensure that the vector dimensions align with the Pinecone index’s expected dimension. In the example, the index is created with a dimension of 384. Make sure the query vectors match this dimension.
- Flatten the Vector: Ensure that the query vector is properly flattened before passing it to Pinecone’s
query
function. This can be done by converting it into a list of floats.
Hope that helps!
Best,
Zack