Replies: 3 comments 1 reply
-
Hey there, @mllife! 😊 Great to see you back here with another intriguing puzzle for us to solve together. Hang tight while I dive into this and I'll get back to you with some insights in a jiffy! |
Beta Was this translation helpful? Give feedback.
0 replies
-
This seems to me a potential bug in the library for now, but need more opinions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@mllife this isn't a bug, here is the proper usage
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to access an available index using llamaindex and query it using a retriver object.
"""
import os
from pinecone import Pinecone
api_key = os.environ['PINECONE_API_KEY']
pc = Pinecone(api_key=api_key)
index_name = 'multi-ext'
index = pc.Index(index_name)
index.describe_index_stats()
"""
{'dimension': 1536,
'index_fullness': 0.0,
'namespaces': {'sample_li': {'vector_count': 107}},
'total_vector_count': 107}
The vector store have nodes added already, how can I query it.
sample node:
"""
ID
db6e4cc2-d82b-4185-80d2-e96717046427
VALUES
0.0369355902, 0.0153047238, 0.0251910929, ...
METADATA
node_content: "{"id": "db6e4cc2-d82b-4185-80d2-e96717046427", "embedding": null, "metadata": {"file_path": "JNJ-US-20240123__2861917.txt", "file_name": "JNJ-US-20240123.txt", "file_type": "text/plain", "file_size": 58296, "creation_date": "2024-05-03", "last_modified_date": "2024-04-15", "company": "JNJ", "story_date": "20240123", "source": "pinecone_external"}, "excluded_embed_metadata_keys": [], "excluded_llm_metadata_keys": [], "relationships": {}, "text": "node text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}"
_node_type: "TextNode"
creation_date: "2024-05-03"
doc_id: "None"
document_id: "None"
file_id: "2861917"
file_name: "JNJ-US-20240123.txt"
file_path: "JNJ-US-20240123.txt"
file_size: 58296
file_type: "text/plain"
last_modified_date: "2024-04-15"
ref_doc_id: "None"
source: "pinecone_external"
story_date: "20240123"
"""
The below code, is not working
error -
File ~/Projects/multi_index_poc/.venv/lib/python3.11/site-packages/llama_index/vector_stores/pinecone/base.py:465, in PineconeVectorStore.query(self, query, **kwargs)
462 else:
463 filter = kwargs.pop("filter", {})
--> 465 response = self._pinecone_index.query(
466 vector=query_embedding,
467 sparse_vector=sparse_vector,
468 top_k=query.similarity_top_k,
469 include_values=kwargs.pop("include_values", True),
470 include_metadata=kwargs.pop("include_metadata", True),
471 namespace=self.namespace,
472 filter=filter,
473 **kwargs,
474 )
476 top_k_nodes = []
477 top_k_ids = []
AttributeError: 'Pinecone' object has no attribute 'query'
library versions I am using,
Beta Was this translation helpful? Give feedback.
All reactions