Whenever i run this code:
from openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
assistant_id = "asst_321"
embeddings = client.embeddings.create(
model="text-embedding-ada-002",
input="The food was delicious and the waiter...",
)
vectors = embeddings.data[0].embedding
index.upsert(namespace=assistant_id, vectors=[{"id": "node-id-1", "values": vectors}], show_progress=True)
it shows me the output:
{'upserted_count': 1}
but when i do:
query_results = index.query(
namespace=assistant_id,
vector=embeddings.data[0].embedding,
top_k=3,
include_values=True
)
query_results
{'matches': [], 'namespace': 'asst_321', 'usage': {'read_units': 1}}
Be vary, these are the same vector values, that were used during the upsertion process. Now the thing is, this new namespace doesn’t reflect in my dashboard and neither when i use index.describe_index_stats()
. But i am able to view it, only if i use the index.fetch
command and specifying the exact id and namespace, that i used while upsertion but as you can see it will not be of any use to me on runtime. Now please tell me why the index.query
and index.upsert
is not properly working? Has anyone else also faced similar issue?