Spaces:
Runtime error
Runtime error
File size: 4,173 Bytes
35b22df |
1 2 3 4 5 6 7 8 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
"""Init file of LlamaIndex."""
from pathlib import Path
with open(Path(__file__).absolute().parents[0] / "VERSION") as _f:
__version__ = _f.read().strip()
import logging
from logging import NullHandler
from gpt_index.data_structs.struct_type import IndexStructType
# embeddings
from gpt_index.embeddings.langchain import LangchainEmbedding
from gpt_index.embeddings.openai import OpenAIEmbedding
# structured
from gpt_index.indices.common.struct_store.base import SQLDocumentContextBuilder
from gpt_index.indices.empty import GPTEmptyIndex
# indices
from gpt_index.indices.keyword_table import (
GPTKeywordTableIndex,
GPTRAKEKeywordTableIndex,
GPTSimpleKeywordTableIndex,
)
from gpt_index.indices.list import GPTListIndex
# prompt helper
from gpt_index.indices.prompt_helper import PromptHelper
# for composability
from gpt_index.indices.query.schema import QueryConfig, QueryMode
from gpt_index.indices.struct_store.sql import GPTSQLStructStoreIndex
from gpt_index.indices.tree import GPTTreeIndex
from gpt_index.indices.vector_store import (
GPTChromaIndex,
GPTFaissIndex,
GPTPineconeIndex,
GPTQdrantIndex,
GPTSimpleVectorIndex,
GPTVectorStoreIndex,
GPTWeaviateIndex,
)
# langchain helper
from gpt_index.langchain_helpers.chain_wrapper import LLMPredictor
from gpt_index.langchain_helpers.memory_wrapper import GPTIndexMemory
from gpt_index.langchain_helpers.sql_wrapper import SQLDatabase
# prompts
from gpt_index.prompts.base import Prompt
from gpt_index.prompts.prompts import (
KeywordExtractPrompt,
QueryKeywordExtractPrompt,
QuestionAnswerPrompt,
RefinePrompt,
SummaryPrompt,
TreeInsertPrompt,
TreeSelectMultiplePrompt,
TreeSelectPrompt,
)
# readers
from gpt_index.readers import (
BeautifulSoupWebReader,
ChromaReader,
DiscordReader,
Document,
FaissReader,
GithubRepositoryReader,
GoogleDocsReader,
JSONReader,
MboxReader,
NotionPageReader,
ObsidianReader,
PineconeReader,
QdrantReader,
RssReader,
SimpleDirectoryReader,
SimpleMongoReader,
SimpleWebPageReader,
SlackReader,
StringIterableReader,
TrafilaturaWebReader,
TwitterTweetReader,
WeaviateReader,
WikipediaReader,
)
from gpt_index.readers.download import download_loader
# token predictor
from gpt_index.token_counter.mock_chain_wrapper import MockLLMPredictor
from gpt_index.token_counter.mock_embed_model import MockEmbedding
# best practices for library logging:
# https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
logging.getLogger(__name__).addHandler(NullHandler())
__all__ = [
"GPTKeywordTableIndex",
"GPTSimpleKeywordTableIndex",
"GPTRAKEKeywordTableIndex",
"GPTListIndex",
"GPTEmptyIndex",
"GPTTreeIndex",
"GPTFaissIndex",
"GPTPineconeIndex",
"GPTQdrantIndex",
"GPTSimpleVectorIndex",
"GPTVectorStoreIndex",
"GPTWeaviateIndex",
"GPTChromaIndex",
"GPTSQLStructStoreIndex",
"Prompt",
"LangchainEmbedding",
"OpenAIEmbedding",
"SummaryPrompt",
"TreeInsertPrompt",
"TreeSelectPrompt",
"TreeSelectMultiplePrompt",
"RefinePrompt",
"QuestionAnswerPrompt",
"KeywordExtractPrompt",
"QueryKeywordExtractPrompt",
"WikipediaReader",
"ObsidianReader",
"Document",
"SimpleDirectoryReader",
"JSONReader",
"SimpleMongoReader",
"NotionPageReader",
"GoogleDocsReader",
"MboxReader",
"SlackReader",
"StringIterableReader",
"WeaviateReader",
"FaissReader",
"ChromaReader",
"PineconeReader",
"QdrantReader",
"DiscordReader",
"SimpleWebPageReader",
"RssReader",
"BeautifulSoupWebReader",
"TrafilaturaWebReader",
"LLMPredictor",
"MockLLMPredictor",
"MockEmbedding",
"SQLDatabase",
"GPTIndexMemory",
"SQLDocumentContextBuilder",
"SQLContextBuilder",
"PromptHelper",
"QueryConfig",
"QueryMode",
"IndexStructType",
"TwitterTweetReader",
"download_loader",
"GithubRepositoryReader",
]
# NOTE: keep for backwards compatibility
SQLContextBuilder = SQLDocumentContextBuilder
|