logger.info("Indexing may take a while. Please wait...") # First create an in memory index to get embeddings for all nodes. local_vector_store_index = VectorStoreIndex.from_documents(documents) nodes = list(local_vector_store_index.docstore.docs.values()) local_vector_store_data: SimpleVectorStoreData = local_vector_store_index.vector_store._data for node in nodes: node.embedding = local_vector_store_data.embedding_dict[node.node_id] ################## This is an Azure Vector Store VectorStoreIndex(nodes, storage_context=azure_storage_context) logger.info(f"Your index {self.index_name} should now be populated at {self.service_endpoint} (go check)")
2024-06-06 14:54:59,932 - llama_index.embeddings.openai.utils - WARNING - Retrying llama_index.embeddings.openai.base.get_embeddings in 0.6736039165786247 seconds as it raised RateLimitError: Error code: 429 - {'error': {'code': '429', 'message': 'Requests to the Embeddings_Create Operation under Azure OpenAI API version 2024-02-15-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 86400 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.'}}.
$ llamaindex-cli-tool.exe upgrade file.py Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "...\venv\Scripts\cli-tool.exe\__main__.py", line 4, in <module> File "...\venv\Lib\site-packages\package\cli\command_line.py", line 4, in <module> from package.cli.module import ModuleCLI, default_modulecli_persist_dir File "...\venv\Lib\site-packages\package\cli\module\__init__.py", line 1, in <module> from package.cli.module.base import ModuleCLI, default_modulecli_persist_dir File "...\venv\Lib\site-packages\package\cli\module\base.py", line 9, in <module> from package.core import ( ImportError: cannot import name 'SimpleDirectoryReader' from 'package.core' (unknown location)
llama-hub==0.0.79.post1 llama-index==0.10.14 llama-index-agent-openai==0.1.5 llama-index-cli==0.1.7 llama-index-core==0.10.14.post1 llama-index-embeddings-openai==0.1.6 llama-index-indices-managed-llama-cloud==0.1.3 llama-index-legacy==0.9.48 llama-index-llms-openai==0.1.7 llama-index-multi-modal-llms-openai==0.1.4 llama-index-program-openai==0.1.4 llama-index-question-gen-openai==0.1.3 llama-index-readers-file==0.1.6 llama-index-readers-llama-parse==0.1.3 llama-index-vector-stores-chroma==0.1.5 llama-parse==0.3.5 llamaindex-py-client==0.1.13
index.as_query_engine
on a SummaryIndex.import phoenix as px from llama_index import set_global_handler set_global_handler("arize_phoenix") session = px.launch_app()
index = SummaryIndex.from_documents(documents, storage_context=storage_context, service_context=service_context) query_engine = index.as_query_engine(text_qa_template=text_qa_template, refine_template=refine_template) response = query_engine.query("")
refresh()
to update documents with the same doc_id but different text, as well as add new documents... but I'd also like to delete documents that are not present in the new scrape. Does llama-index have a built in management utility for this too?qa_prompt = QuestionAnswerPrompt(prompt_prefix_template.format( context_str="{context_str}", query_str="{query_str}")) refine_template_string = CHAT_REFINE_PROMPT_TMPL.format( context_msg="{context_msg}", query_str="{query_str}", existing_answer="{existing_answer}") my_refine_prompt = RefinePrompt(refine_template_string) query_engine_refine = index.as_query_engine(text_qa_template=qa_prompt, refine_template=my_refine_prompt, response_mode=ResponseMode.REFINE, similarity_top_k=6) query_engine_simple = index.as_query_engine(text_qa_template=qa_prompt, response_mode=ResponseMode.SIMPLE_SUMMARIZE, similarity_top_k=4)