llama-index

Форк
0
54 строки · 1.8 Кб
1
"""Pinecone reader."""
2

3
from typing import Any, Dict, List, Optional
4

5
from llama_index.legacy.readers.base import BaseReader
6
from llama_index.legacy.schema import Document
7

8

9
class PineconeReader(BaseReader):
10
    """Pinecone reader.
11

12
    Args:
13
        api_key (str): Pinecone API key.
14
        environment (str): Pinecone environment.
15
    """
16

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

23
    def load_data(
24
        self,
25
        index_name: str,
26
        id_to_text_map: Dict[str, str],
27
        vector: Optional[List[float]],
28
        top_k: int,
29
        separate_documents: bool = True,
30
        include_values: bool = True,
31
        **query_kwargs: Any
32
    ) -> List[Document]:
33
        """Load data from Pinecone.
34

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

49
        Returns:
50
            List[Document]: A list of documents.
51
        """
52
        raise NotImplementedError(
53
            "PineconeReader has been deprecated. Please use `PineconeVectorStore` instead."
54
        )
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.