Skip to content

Pinecone

PineconeReader #

Bases: BaseReader

Pinecone reader.

Parameters:

Name Type Description Default
api_key str

Pinecone API key.

required
environment str

Pinecone environment.

None
Source code in llama-index-integrations/readers/llama-index-readers-pinecone/llama_index/readers/pinecone/base.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class PineconeReader(BaseReader):
    """Pinecone reader.

    Args:
        api_key (str): Pinecone API key.
        environment (str): Pinecone environment.
    """

    def __init__(self, api_key: str, environment: Optional[str] = None) -> None:
        """Initialize with parameters."""
        raise NotImplementedError(
            "PineconeReader has been deprecated. Please use `PineconeVectorStore` instead."
        )

    def load_data(
        self,
        index_name: str,
        id_to_text_map: Dict[str, str],
        vector: Optional[List[float]],
        top_k: int,
        separate_documents: bool = True,
        include_values: bool = True,
        **query_kwargs: Any
    ) -> List[Document]:
        """Load data from Pinecone.

        Args:
            index_name (str): Name of the index.
            id_to_text_map (Dict[str, str]): A map from ID's to text.
            separate_documents (Optional[bool]): Whether to return separate
                documents per retrieved entry. Defaults to True.
            vector (List[float]): Query vector.
            top_k (int): Number of results to return.
            include_values (bool): Whether to include the embedding in the response.
                Defaults to True.
            **query_kwargs: Keyword arguments to pass to the query.
                Arguments are the exact same as those found in
                Pinecone's reference documentation for the
                query method.

        Returns:
            List[Document]: A list of documents.
        """
        raise NotImplementedError(
            "PineconeReader has been deprecated. Please use `PineconeVectorStore` instead."
        )

load_data #

load_data(index_name: str, id_to_text_map: Dict[str, str], vector: Optional[List[float]], top_k: int, separate_documents: bool = True, include_values: bool = True, **query_kwargs: Any) -> List[Document]

Load data from Pinecone.

Parameters:

Name Type Description Default
index_name str

Name of the index.

required
id_to_text_map Dict[str, str]

A map from ID's to text.

required
separate_documents Optional[bool]

Whether to return separate documents per retrieved entry. Defaults to True.

True
vector List[float]

Query vector.

required
top_k int

Number of results to return.

required
include_values bool

Whether to include the embedding in the response. Defaults to True.

True
**query_kwargs Any

Keyword arguments to pass to the query. Arguments are the exact same as those found in Pinecone's reference documentation for the query method.

{}

Returns:

Type Description
List[Document]

List[Document]: A list of documents.

Source code in llama-index-integrations/readers/llama-index-readers-pinecone/llama_index/readers/pinecone/base.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def load_data(
    self,
    index_name: str,
    id_to_text_map: Dict[str, str],
    vector: Optional[List[float]],
    top_k: int,
    separate_documents: bool = True,
    include_values: bool = True,
    **query_kwargs: Any
) -> List[Document]:
    """Load data from Pinecone.

    Args:
        index_name (str): Name of the index.
        id_to_text_map (Dict[str, str]): A map from ID's to text.
        separate_documents (Optional[bool]): Whether to return separate
            documents per retrieved entry. Defaults to True.
        vector (List[float]): Query vector.
        top_k (int): Number of results to return.
        include_values (bool): Whether to include the embedding in the response.
            Defaults to True.
        **query_kwargs: Keyword arguments to pass to the query.
            Arguments are the exact same as those found in
            Pinecone's reference documentation for the
            query method.

    Returns:
        List[Document]: A list of documents.
    """
    raise NotImplementedError(
        "PineconeReader has been deprecated. Please use `PineconeVectorStore` instead."
    )