0

I am trying to fetch top 3 related vector from pine cone which are similar to the query_vector

answer=index.query(
  vector=query_vector,
  top_k=3,
  include_values=True
)
st.write(answer)

query_vector is a list of 1536-dimensional embedding of a query which looks like as follows [0.02088431, 0.007455872, -0.016556364, -0.011433648, -0.047843482, -0.016949814, -0.05335178, 0.012023823, -0.021985969, .........] my database is also storing embeddings of 1536 dimensions. When I am executing this it is giving error

TypeError: 'NoneType' object is not callable 

what should I do ...

1 Answer 1

1
from pinecone import Pinecone

pc = Pinecone(api_key="API_KEY_PINECONE")
index = pc.Index("hb-demo")

ans = index.query(
  vector=[0.99,0.59,0.36,...],//1536 total dimensions
  top_k=3,
  include_metadata=True,
    include_values=True,
    namespace='demo'
)
print(ans)

I have used this kind of query in my Jupyter-notebook it works fine.Please check your index-name and namespace.

You haven't provided namespace here so it will take response from default namespace. so, check that default namespace in your pinecone account contains records.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.