mirror of
https://github.com/run-llama/llama_cloud_services.git
synced 2026-07-23 13:06:02 -04:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3954f3dda | |||
| b779e231bf | |||
| de12de1437 | |||
| 5274ea5277 | |||
| 398d775122 | |||
| aca18e12ef | |||
| 270c2ed0aa | |||
| 2cf960196f | |||
| 6b83edc8fd | |||
| 711822223a | |||
| 8e6872b57c | |||
| e14224b05d | |||
| c3a30898af | |||
| f3f6fb0444 | |||
| 641b6d61a7 | |||
| c0996a64a7 | |||
| a8904f39e2 | |||
| 81011f6336 | |||
| 117b193ee9 | |||
| bd724a7939 | |||
| 866cdca216 | |||
| ba321ac5b0 | |||
| 8fab0ac2ad | |||
| 563eb936e4 | |||
| 09c069de4b | |||
| 1224c3b40e | |||
| 1001a1586f |
@@ -27,14 +27,21 @@ from llama_parse import LlamaParse
|
||||
parser = LlamaParse(
|
||||
api_key="llx-...", # can also be set in your env as LLAMA_CLOUD_API_KEY
|
||||
result_type="markdown", # "markdown" and "text" are available
|
||||
num_workers=4, # if multiple files passed, split in `num_workers` API calls
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# sync
|
||||
documents = parser.load_data("./my_file.pdf")
|
||||
|
||||
# sync batch
|
||||
documents = parser.load_data(["./my_file1.pdf", "./my_file2.pdf"])
|
||||
|
||||
# async
|
||||
documents = await parser.aload_data("./my_file.pdf")
|
||||
|
||||
# async batch
|
||||
documents = await parser.aload_data(["./my_file1.pdf", "./my_file2.pdf"])
|
||||
```
|
||||
|
||||
## Using with `SimpleDirectoryReader`
|
||||
@@ -46,7 +53,7 @@ import nest_asyncio
|
||||
nest_asyncio.apply()
|
||||
|
||||
from llama_parse import LlamaParse
|
||||
from llama_index import SimpleDirectoryReader
|
||||
from llama_index.core import SimpleDirectoryReader
|
||||
|
||||
parser = LlamaParse(
|
||||
api_key="llx-...", # can also be set in your env as LLAMA_CLOUD_API_KEY
|
||||
|
||||
+172
-252
@@ -6,7 +6,9 @@
|
||||
"source": [
|
||||
"# Llama Parser <> LlamaIndex\n",
|
||||
"\n",
|
||||
"This notebook is a complete walkthrough for using `LlamaParse` for RAG applications with `LlamaIndex`."
|
||||
"This notebook is a complete walkthrough for using `LlamaParse` for RAG applications with `LlamaIndex`.\n",
|
||||
"\n",
|
||||
"Note for this example, we are using the `llama_index >=0.10.4` version"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -15,7 +17,12 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!pip install llama-index llama-parse sentence-transformers llama_hub pypdf"
|
||||
"!pip install llama-index\n",
|
||||
"!pip install llama-index-core==0.10.6.post1\n",
|
||||
"!pip install llama-index-embeddings-openai\n",
|
||||
"!pip install llama-index-postprocessor-flag-embedding-reranker\n",
|
||||
"!pip install git+https://github.com/FlagOpen/FlagEmbedding.git\n",
|
||||
"!pip install llama-parse"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -36,69 +43,38 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# llama-parse is async-first, running the sync code in a notebook requires the use of nest_asyncio\n",
|
||||
"# llama-parse is async-first, running the async code in a notebook requires the use of nest_asyncio\n",
|
||||
"import nest_asyncio\n",
|
||||
"\n",
|
||||
"nest_asyncio.apply()\n",
|
||||
"\n",
|
||||
"import os\n",
|
||||
"# API access to llama-cloud\n",
|
||||
"os.environ[\"LLAMA_CLOUD_API_KEY\"] = \"llx-\"\n",
|
||||
"\n",
|
||||
"# Using OpenAI API for embeddings/llms\n",
|
||||
"os.environ[\"OPENAI_API_KEY\"] = \"sk-\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Using old `PDFReader` from LLamaHub as baseline PDF parser"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_hub.file.pdf.base import PDFReader\n",
|
||||
"from pathlib import Path\n",
|
||||
"from llama_index import Document\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"loader = PDFReader()\n",
|
||||
"docs0 = loader.load_data(file=Path('./uber_10q_march_2022.pdf'))\n",
|
||||
"doc_text = \"\\n\\n\".join([d.get_content() for d in docs0])\n",
|
||||
"baseline_docs = [Document(text=doc_text)]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Build Vector Index for the nodes parsed from `PdfReader` and run basic query engine as a baseline approach"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index.llms import OpenAI\n",
|
||||
"from llama_index.embeddings import OpenAIEmbedding\n",
|
||||
"from llama_index import VectorStoreIndex, ServiceContext\n",
|
||||
"from llama_index.llms.openai import OpenAI\n",
|
||||
"from llama_index.embeddings.openai import OpenAIEmbedding\n",
|
||||
"from llama_index.core import VectorStoreIndex\n",
|
||||
"from llama_index.core import Settings\n",
|
||||
"\n",
|
||||
"embed_model=OpenAIEmbedding(model=\"text-embedding-3-small\")\n",
|
||||
"llm = OpenAI(model=\"gpt-3.5-turbo-0613\")\n",
|
||||
"service_context = ServiceContext.from_defaults(\n",
|
||||
" llm=llm, embed_model=embed_model, chunk_size=512\n",
|
||||
")\n",
|
||||
"llm = OpenAI(model=\"gpt-3.5-turbo-0125\")\n",
|
||||
"\n",
|
||||
"baseline_index = VectorStoreIndex.from_documents(baseline_docs, service_context=service_context)\n",
|
||||
"baseline_pdf_query_engine = baseline_index.as_query_engine(similarity_top_k=15)"
|
||||
"Settings.llm = llm\n",
|
||||
"Settings.embed_model = embed_model\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -114,14 +90,14 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 34,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Started parsing the file under job_id 75cc54de-b6fe-4466-b238-a1d711817a72\n"
|
||||
"Started parsing the file under job_id edbcecf3-5379-40de-9c52-0d97985dccf5\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -133,54 +109,37 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"# Form 10-Q\n",
|
||||
"# Document\n",
|
||||
"\n",
|
||||
"# UNITED STATES SECURITIES AND EXCHANGE COMMISSION\n",
|
||||
"\n",
|
||||
"Washington, D.C. 20549\n",
|
||||
"# UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C. 20549\n",
|
||||
"\n",
|
||||
"## FORM 10-Q\n",
|
||||
"\n",
|
||||
"(Mark One)\n",
|
||||
"\n",
|
||||
"☒ QUARTERLY REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934\n",
|
||||
"☒ QUARTERLY REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934 For the quarterly period\n",
|
||||
"ended March 31, 2022 OR ☐ TRANSITION REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934\n",
|
||||
"For the transition period from_____ to _____ Commission File Number: 001-38902\n",
|
||||
"\n",
|
||||
"For the quarterly period ended March 31, 2022\n",
|
||||
"UBER TECHNOLOGIES, INC. (Exact name of registrant as specified in its charter) Not Applicable (Former name, former\n",
|
||||
"address and former fiscal year, if changed since last report)\n",
|
||||
"\n",
|
||||
"Commission File Number: 001-38902\n",
|
||||
"Delaware 45-2647441 (State or other jurisdiction of incorporation or organization) (I.R.S. Employer Identification\n",
|
||||
"No.)\n",
|
||||
"\n",
|
||||
"### UBER TECHNOLOGIES, INC.\n",
|
||||
"1515 3rd Street San Francisco, California 94158 (Address of principal executive offices, including zip code) (415)\n",
|
||||
"612-8582 (Registrant’s telephone number, including area code)\n",
|
||||
"\n",
|
||||
"(Exact name of registrant as specified in its charter)\n",
|
||||
"Securities registered pursuant to Section 12(b) of the Act:\n",
|
||||
"\n",
|
||||
"Delaware 45-2647441\n",
|
||||
"\n",
|
||||
"(State or other jurisdiction of incorporation or organization) (I.R.S. Employer Identification No.)\n",
|
||||
"\n",
|
||||
"1515 3rd Street\n",
|
||||
"\n",
|
||||
"San Francisco, California 94158\n",
|
||||
"\n",
|
||||
"(Address of principal executive offices, including zip code)\n",
|
||||
"\n",
|
||||
"(415) 612-8582\n",
|
||||
"\n",
|
||||
"(Registrant’s telephone number, including area code)\n",
|
||||
"\n",
|
||||
"### Securities registered pursuant to Section 12(b) of the Act:\n",
|
||||
"\n",
|
||||
"|Title of each class|Trading Symbol(s)|Name of each exchange on which registered|\n",
|
||||
"|---|---|---|\n",
|
||||
"|Common Stock, par value $0.00001 per share|UBER|New York Stock Exchange|\n",
|
||||
"\n",
|
||||
"Indicate by check mark whether the registrant (1) has filed all reports required to be ...\n"
|
||||
"|Title of each class|Trading Symbol(s)|...\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -190,19 +149,18 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index.node_parser import MarkdownElementNodeParser\n",
|
||||
"from llama_index.llms import OpenAI\n",
|
||||
"from llama_index.core.node_parser import MarkdownElementNodeParser\n",
|
||||
"\n",
|
||||
"node_parser = MarkdownElementNodeParser(llm=OpenAI(model=\"gpt-3.5-turbo-0613\"), num_workers=8)"
|
||||
"node_parser = MarkdownElementNodeParser(llm=OpenAI(model=\"gpt-3.5-turbo-0125\"), num_workers=8)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -216,81 +174,79 @@
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"52it [00:00, 58835.66it/s]\n",
|
||||
" 0%| | 0/52 [00:00<?, ?it/s]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"100%|██████████| 52/52 [00:19<00:00, 2.69it/s]\n"
|
||||
"80it [00:00, 77744.28it/s]\n",
|
||||
"100%|██████████| 80/80 [00:21<00:00, 3.66it/s]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"nodes = node_parser.get_nodes_from_documents(documents)\n",
|
||||
"base_nodes, node_mapping = node_parser.get_base_nodes_and_mappings(nodes)"
|
||||
"nodes = node_parser.get_nodes_from_documents(documents)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index import VectorStoreIndex, ServiceContext\n",
|
||||
"from llama_index.embeddings import OpenAIEmbedding\n",
|
||||
"base_nodes, objects = node_parser.get_nodes_and_objects(nodes)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"recursive_index = VectorStoreIndex(nodes=base_nodes+objects)\n",
|
||||
"raw_index = VectorStoreIndex.from_documents(documents)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index.postprocessor.flag_embedding_reranker import FlagEmbeddingReranker\n",
|
||||
"\n",
|
||||
"ctx = ServiceContext.from_defaults(\n",
|
||||
" llm=OpenAI(model=\"gpt-4\"), \n",
|
||||
" embed_model=OpenAIEmbedding(model=\"text-embedding-3-small\"), \n",
|
||||
" chunk_size=512\n",
|
||||
"reranker = FlagEmbeddingReranker(\n",
|
||||
" top_n=5,\n",
|
||||
" model=\"BAAI/bge-reranker-large\",\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"recursive_index = VectorStoreIndex(nodes=base_nodes, service_context=ctx)\n",
|
||||
"raw_index = VectorStoreIndex.from_documents(documents, service_context=ctx)"
|
||||
"recursive_query_engine = recursive_index.as_query_engine(\n",
|
||||
" similarity_top_k=15, \n",
|
||||
" node_postprocessors=[reranker], \n",
|
||||
" verbose=True\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"raw_query_engine = raw_index.as_query_engine(similarity_top_k=15, node_postprocessors=[reranker])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"303\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from llama_index.retrievers import RecursiveRetriever\n",
|
||||
"\n",
|
||||
"retriever = RecursiveRetriever(\n",
|
||||
" \"vector\", \n",
|
||||
" retriever_dict={\n",
|
||||
" \"vector\": recursive_index.as_retriever(similarity_top_k=15)\n",
|
||||
" },\n",
|
||||
" node_dict=node_mapping,\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 40,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index.query_engine import RetrieverQueryEngine\n",
|
||||
"from llama_index.postprocessor import SentenceTransformerRerank\n",
|
||||
"\n",
|
||||
"reranker = SentenceTransformerRerank(top_n=5, model=\"BAAI/bge-reranker-large\")\n",
|
||||
"\n",
|
||||
"recursive_query_engine = RetrieverQueryEngine.from_args(retriever, node_postprocessors=[reranker], service_context=ctx)\n",
|
||||
"\n",
|
||||
"raw_query_engine = raw_index.as_query_engine(similarity_top_k=15, node_postprocessors=[reranker], service_context=ctx)"
|
||||
"print(len(nodes))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Comparing `PdfReader vs new LlamaParse` as pdf data parsing methods\n",
|
||||
"we also compare base query engine vs recursive query engine with tables"
|
||||
"## Using `new LlamaParse` as pdf data parsing methods and retrieve tables with two different methods\n",
|
||||
"we compare base query engine vs recursive query engine with tables"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -302,31 +258,36 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 41,
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"***********Baseline PDF Query Engine***********\n",
|
||||
"The information provided does not specify the amount of cash paid for income taxes, net of refunds.\n",
|
||||
"\n",
|
||||
"***********New LlamaParse+ Basic Query Engine***********\n",
|
||||
"The context does not provide specific information on the cash paid for income taxes, net of refunds.\n",
|
||||
"\n",
|
||||
"Cash paid for income taxes, net of refunds, is not explicitly provided in the context information.\n",
|
||||
"\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_44_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_42_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_40_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_320_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_38_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_324_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\n",
|
||||
"\u001b[0m\n",
|
||||
"***********New LlamaParse+ Recursive Retriever Query Engine***********\n",
|
||||
"The cash paid for income taxes, net of refunds, is $22.\n"
|
||||
"$22 for the period ended March 31, 2021 and $41 for the period ended March 31, 2022.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"query = \"how is the Cash paid for Income taxes, net of refunds?\"\n",
|
||||
"\n",
|
||||
"response_0 = baseline_pdf_query_engine.query(query)\n",
|
||||
"print(\"***********Baseline PDF Query Engine***********\")\n",
|
||||
"print(response_0)\n",
|
||||
"\n",
|
||||
"query = \"how is the Cash paid for Income taxes, net of refunds from Supplemental disclosures of cash flow information?\"\n",
|
||||
"\n",
|
||||
"response_1 = raw_query_engine.query(query)\n",
|
||||
"print(\"\\n***********New LlamaParse+ Basic Query Engine***********\")\n",
|
||||
@@ -351,31 +312,42 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 42,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"***********Baseline PDF Query Engine***********\n",
|
||||
"The change in free cash flow is a decrease of $635 million. The rate of change is not provided in the given context.\n",
|
||||
"\n",
|
||||
"***********New LlamaParse+ Basic Query Engine***********\n",
|
||||
"The free cash flow changed from $(682) million in the three months ended March 31, 2021, to $(47) million in the same period in 2022. However, the context does not provide a specific rate of change for the free cash flow.\n",
|
||||
"\n",
|
||||
"The change in free cash flow from the financial and operational highlights is a decrease from $(682) million in 2021 to $(47) million in 2022. This represents a significant improvement in free cash flow performance from one period to the next.\n",
|
||||
"\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_320_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_38_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_44_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_324_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_40_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_280_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_42_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_124_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_240_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the change of free cash flow and what is the rate from the financial and operational highlights?\n",
|
||||
"\u001b[0m\n",
|
||||
"***********New LlamaParse+ Recursive Retriever Query Engine***********\n",
|
||||
"The free cash flow changed from negative $682 million in the three months ended March 31, 2021, to negative $47 million in the same period in 2022. This represents a significant improvement, but the exact rate of change is not provided in the context.\n"
|
||||
"The change in free cash flow from the financial and operational highlights is an improvement of $635 million, with the rate being a significant increase compared to the same period in the prior year.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"query = \"what is the change of free cash flow and what is the rate?\"\n",
|
||||
"\n",
|
||||
"response_0 = baseline_pdf_query_engine.query(query)\n",
|
||||
"print(\"***********Baseline PDF Query Engine***********\")\n",
|
||||
"print(response_0)\n",
|
||||
"\n",
|
||||
"query = \"what is the change of free cash flow and what is the rate from the financial and operational highlights?\"\n",
|
||||
"\n",
|
||||
"response_1 = raw_query_engine.query(query)\n",
|
||||
"print(\"\\n***********New LlamaParse+ Basic Query Engine***********\")\n",
|
||||
@@ -400,31 +372,38 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"***********Baseline PDF Query Engine***********\n",
|
||||
"The net loss attributable to Uber Technologies, Inc. for the current year is $5.9 billion. However, there is no information provided in the given context regarding the net loss for the previous year.\n",
|
||||
"\n",
|
||||
"***********New LlamaParse+ Basic Query Engine***********\n",
|
||||
"The net loss attributable to Uber Technologies, Inc. for the first quarter of 2022 was $5.9 billion. This is significantly higher compared to the net loss of $108 million in the first quarter of 2021.\n",
|
||||
"\n",
|
||||
"The net loss value attributable to Uber for the current period is $5.9 billion, which is an increase compared to the net loss of $108 million in the same period last year.\n",
|
||||
"\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_22_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_316_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_230_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_26_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_234_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_24_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_196_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query what is the net loss value attributable to Uber compared to last year?\n",
|
||||
"\u001b[0m\n",
|
||||
"***********New LlamaParse+ Recursive Retriever Query Engine***********\n",
|
||||
"The net loss attributable to Uber Technologies, Inc. for the three months ended March 31, 2022 was $5.93 billion. This is significantly higher compared to the same period in 2021, when the net loss was $108 million.\n"
|
||||
"The net loss value attributable to Uber Technologies, Inc. for the first quarter of 2022 was $5,930 million, which is significantly higher compared to the net loss of $108 million for the same period in 2021.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"query = \"what is Net loss attributable to Uber compared to last year\"\n",
|
||||
"\n",
|
||||
"response_0 = baseline_pdf_query_engine.query(query)\n",
|
||||
"print(\"***********Baseline PDF Query Engine***********\")\n",
|
||||
"print(response_0)\n",
|
||||
"\n",
|
||||
"query = \"what is the net loss value attributable to Uber compared to last year?\"\n",
|
||||
"\n",
|
||||
"response_1 = raw_query_engine.query(query)\n",
|
||||
"print(\"\\n***********New LlamaParse+ Basic Query Engine***********\")\n",
|
||||
@@ -449,31 +428,42 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 43,
|
||||
"execution_count": 17,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"***********Baseline PDF Query Engine***********\n",
|
||||
"Cash flows from investing activities refers to the cash inflows and outflows related to the acquisition and disposal of long-term assets and investments. This includes activities such as purchasing property and equipment, acquiring or selling businesses, purchasing or selling marketable securities, and making investments in notes receivable. It provides information on the cash used or generated by these investing activities during a specific period.\n",
|
||||
"\n",
|
||||
"***********New LlamaParse+ Basic Query Engine***********\n",
|
||||
"Cash flows from investing activities refer to the net cash used in or generated from various investment-related transactions within a specific period. For Uber, in the three months ended March 31, 2022, this primarily consisted of $62 million in purchases of property and equipment and $59 million in acquisition of business, net of cash acquired, totaling to a net cash used of $135 million. In the same period in 2021, it primarily consisted of $803 million in purchases of non-marketable equity securities, $336 million in purchases of marketable securities, and $216 million in purchases of a note receivable. These were partially offset by proceeds from maturities and sales of marketable securities of $696 million and $500 million in proceeds from the sale of non-marketable equity securities, resulting in a net cash used of $250 million.\n",
|
||||
"\n",
|
||||
"Cash flows from investing activities were as follows:\n",
|
||||
"- For the three months ended March 31, 2022, net cash used in investing activities was $135 million, primarily driven by $62 million in purchases of property and equipment and $59 million in acquisition of business, net of cash acquired.\n",
|
||||
"- For the three months ended March 31, 2021, net cash used in investing activities was $250 million, mainly consisting of $803 million in purchases of non-marketable equity securities, $336 million in purchases of marketable securities, and $216 million in purchases of a note receivable, partially offset by proceeds from maturities and sales of marketable securities of $696 million and $500 million in proceeds from the sale of non-marketable equity securities.\n",
|
||||
"\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_44_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_38_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_324_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_40_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_320_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_42_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;11;159;203mRetrieval entering id_b656577b-91de-47ca-981e-8b1d63e20c20_270_table: TextNode\n",
|
||||
"\u001b[0m\u001b[1;3;38;2;237;90;200mRetrieving from object TextNode with query What were cash flows like from investing activities?\n",
|
||||
"\u001b[0m\n",
|
||||
"***********New LlamaParse+ Recursive Retriever Query Engine***********\n",
|
||||
"Cash flows from investing activities refer to the money spent or generated from various investment-related activities in a specific period. This can include purchases of property and equipment, purchases of marketable and non-marketable equity securities, acquisition of businesses, and proceeds from the sale of assets or securities. For example, in 2022, the company used $135 million in investing activities, primarily consisting of $62 million in purchases of property and equipment and $59 million in acquisition of business, net of cash acquired.\n"
|
||||
"Cash flows from investing activities were as follows:\n",
|
||||
"- For the three months ended March 31, 2021, net cash used in investing activities was $250 million.\n",
|
||||
"- For the three months ended March 31, 2022, net cash used in investing activities was $135 million.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"query = \"what is Cash flows from investing activities\"\n",
|
||||
"\n",
|
||||
"response_0 = baseline_pdf_query_engine.query(query)\n",
|
||||
"print(\"***********Baseline PDF Query Engine***********\")\n",
|
||||
"print(response_0)\n",
|
||||
"\n",
|
||||
"query = \"What were cash flows like from investing activities?\"\n",
|
||||
"\n",
|
||||
"response_1 = raw_query_engine.query(query)\n",
|
||||
"print(\"\\n***********New LlamaParse+ Basic Query Engine***********\")\n",
|
||||
@@ -495,76 +485,6 @@
|
||||
"source": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Persist and load the Recursive Retriever"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Persist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 44,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"recursive_index.storage_context.persist(persist_dir=\"./storage\")\n",
|
||||
"\n",
|
||||
"node_mapping_json = {k: v.dict() for k, v in node_mapping.items()}\n",
|
||||
"with open(\"./node_mapping.json\", \"w\") as f:\n",
|
||||
" json.dump(node_mapping_json, f)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Load"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 45,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from llama_index import StorageContext, load_index_from_storage\n",
|
||||
"from llama_index.schema import TextNode\n",
|
||||
"\n",
|
||||
"index = load_index_from_storage(StorageContext.from_defaults(\n",
|
||||
" persist_dir=\"./storage\"), service_context=ctx\n",
|
||||
")\n",
|
||||
"with open(\"./node_mapping.json\", \"r\") as f:\n",
|
||||
" node_mapping_json = json.load(f)\n",
|
||||
" node_mapping = {k: TextNode(**v) for k, v in node_mapping_json.items()}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 46,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"retriever = RecursiveRetriever(\n",
|
||||
" \"vector\", \n",
|
||||
" retriever_dict={\n",
|
||||
" \"vector\": index.as_retriever(similarity_top_k=15)\n",
|
||||
" },\n",
|
||||
" node_dict=node_mapping,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"recursive_query_engine = RetrieverQueryEngine.from_args(retriever, node_postprocessors=[reranker], service_context=ctx)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
@@ -583,7 +503,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.6"
|
||||
"version": "3.11.4"
|
||||
},
|
||||
"orig_nbformat": 4
|
||||
},
|
||||
|
||||
+100
-53
@@ -1,14 +1,19 @@
|
||||
import os
|
||||
import asyncio
|
||||
import httpx
|
||||
import mimetypes
|
||||
import time
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from llama_index.core.async_utils import run_jobs
|
||||
from llama_index.core.bridge.pydantic import Field, validator
|
||||
from llama_index.core.constants import DEFAULT_BASE_URL
|
||||
from llama_index.core.readers.base import BasePydanticReader
|
||||
from llama_index.core.schema import Document
|
||||
|
||||
nest_asyncio_err = "cannot be called from a running event loop"
|
||||
nest_asyncio_msg = "The event loop is already running. Add `import nest_asyncio; nest_asyncio.apply()` to your code to fix this issue."
|
||||
|
||||
class ResultType(str, Enum):
|
||||
"""The result type for the parser."""
|
||||
@@ -22,12 +27,18 @@ class LlamaParse(BasePydanticReader):
|
||||
|
||||
api_key: str = Field(default="", description="The API key for the LlamaParse API.")
|
||||
base_url: str = Field(
|
||||
default="https://api.cloud.llamaindex.ai/api/parsing",
|
||||
default=DEFAULT_BASE_URL,
|
||||
description="The base URL of the Llama Parsing API.",
|
||||
)
|
||||
result_type: ResultType = Field(
|
||||
default=ResultType.TXT, description="The result type for the parser."
|
||||
)
|
||||
num_workers: int = Field(
|
||||
default=4,
|
||||
gt=0,
|
||||
lt=10,
|
||||
description="The number of workers to use sending API requests for parsing."
|
||||
)
|
||||
check_interval: int = Field(
|
||||
default=1,
|
||||
description="The interval in seconds to check if the parsing is done.",
|
||||
@@ -51,66 +62,102 @@ class LlamaParse(BasePydanticReader):
|
||||
return api_key
|
||||
|
||||
return v
|
||||
|
||||
@validator("base_url", pre=True, always=True)
|
||||
def validate_base_url(cls, v: str) -> str:
|
||||
"""Validate the base URL."""
|
||||
url = os.getenv("LLAMA_CLOUD_BASE_URL", None)
|
||||
return url or v or DEFAULT_BASE_URL
|
||||
|
||||
def load_data(self, file_path: str, extra_info: Optional[dict] = None) -> List[Document]:
|
||||
async def _aload_data(self, file_path: str, extra_info: Optional[dict] = None) -> List[Document]:
|
||||
"""Load data from the input path."""
|
||||
return asyncio.run(self.aload_data(file_path, extra_info))
|
||||
try:
|
||||
file_path = str(file_path)
|
||||
if not file_path.endswith(".pdf"):
|
||||
raise Exception("Currently, only PDF files are supported.")
|
||||
|
||||
async def aload_data(self, file_path: str, extra_info: Optional[dict] = None) -> List[Document]:
|
||||
"""Load data from the input path."""
|
||||
file_path = str(file_path)
|
||||
if not file_path.endswith(".pdf"):
|
||||
raise Exception("Currently, only PDF files are supported.")
|
||||
extra_info = extra_info or {}
|
||||
extra_info["file_path"] = file_path
|
||||
|
||||
extra_info = extra_info or {}
|
||||
extra_info["file_path"] = file_path
|
||||
headers = {"Authorization": f"Bearer {self.api_key}"}
|
||||
|
||||
headers = {"Authorization": f"Bearer {self.api_key}"}
|
||||
# load data, set the mime type
|
||||
with open(file_path, "rb") as f:
|
||||
mime_type = mimetypes.guess_type(file_path)[0]
|
||||
files = {"file": (f.name, f, mime_type)}
|
||||
|
||||
# load data, set the mime type
|
||||
with open(file_path, "rb") as f:
|
||||
mime_type = mimetypes.guess_type(file_path)[0]
|
||||
files = {"file": (f.name, f, mime_type)}
|
||||
# send the request, start job
|
||||
url = f"{self.base_url}/api/parsing/upload"
|
||||
async with httpx.AsyncClient(timeout=self.max_timeout) as client:
|
||||
response = await client.post(url, files=files, headers=headers)
|
||||
if not response.is_success:
|
||||
raise Exception(f"Failed to parse the PDF file: {response.text}")
|
||||
|
||||
# send the request, start job
|
||||
url = f"{self.base_url}/upload"
|
||||
async with httpx.AsyncClient(timeout=self.max_timeout) as client:
|
||||
response = await client.post(url, files=files, headers=headers)
|
||||
if not response.is_success:
|
||||
raise Exception(f"Failed to parse the PDF file: {response.text}")
|
||||
# check the status of the job, return when done
|
||||
job_id = response.json()["id"]
|
||||
if self.verbose:
|
||||
print("Started parsing the file under job_id %s" % job_id)
|
||||
|
||||
result_url = f"{self.base_url}/api/parsing/job/{job_id}/result/{self.result_type.value}"
|
||||
|
||||
# check the status of the job, return when done
|
||||
job_id = response.json()["id"]
|
||||
if self.verbose:
|
||||
print("Started parsing the file under job_id %s" % job_id)
|
||||
|
||||
result_url = f"{self.base_url}/job/{job_id}/result/{self.result_type.value}"
|
||||
start = time.time()
|
||||
tries = 0
|
||||
while True:
|
||||
await asyncio.sleep(self.check_interval)
|
||||
async with httpx.AsyncClient(timeout=self.max_timeout) as client:
|
||||
tries += 1
|
||||
|
||||
result = await client.get(result_url, headers=headers)
|
||||
|
||||
start = time.time()
|
||||
tries = 0
|
||||
while True:
|
||||
await asyncio.sleep(self.check_interval)
|
||||
async with httpx.AsyncClient(timeout=self.max_timeout) as client:
|
||||
result = await client.get(result_url, headers=headers)
|
||||
if result.status_code == 404:
|
||||
end = time.time()
|
||||
if end - start > self.max_timeout:
|
||||
raise Exception(
|
||||
f"Timeout while parsing the PDF file: {response.text}"
|
||||
)
|
||||
if self.verbose and tries % 10 == 0:
|
||||
print(".", end="", flush=True)
|
||||
continue
|
||||
|
||||
if result.status_code == 404:
|
||||
end = time.time()
|
||||
if end - start > self.max_timeout:
|
||||
raise Exception(
|
||||
f"Timeout while parsing the PDF file: {response.text}"
|
||||
if result.status_code == 400:
|
||||
detail = result.json().get("detail", "Unknown error")
|
||||
raise Exception(f"Failed to parse the PDF file: {detail}")
|
||||
|
||||
return [
|
||||
Document(
|
||||
text=result.json()[self.result_type.value],
|
||||
metadata=extra_info,
|
||||
)
|
||||
if self.verbose and tries % 10 == 0:
|
||||
print(".", end="", flush=True)
|
||||
continue
|
||||
]
|
||||
except Exception as e:
|
||||
print("Error while parsing the PDF file: ", e)
|
||||
return []
|
||||
|
||||
async def aload_data(self, file_path: Union[List[str], str], extra_info: Optional[dict] = None) -> List[Document]:
|
||||
"""Load data from the input path."""
|
||||
if isinstance(file_path, str):
|
||||
return await self._aload_data(file_path, extra_info=extra_info)
|
||||
elif isinstance(file_path, list):
|
||||
jobs = [self._aload_data(f, extra_info=extra_info) for f in file_path]
|
||||
try:
|
||||
results = await run_jobs(jobs, workers=self.num_workers)
|
||||
|
||||
# return flattened results
|
||||
return [item for sublist in results for item in sublist]
|
||||
except RuntimeError as e:
|
||||
if nest_asyncio_err in str(e):
|
||||
raise RuntimeError(nest_asyncio_msg)
|
||||
else:
|
||||
raise e
|
||||
else:
|
||||
raise ValueError("The input file_path must be a string or a list of strings.")
|
||||
|
||||
if result.status_code == 400:
|
||||
detail = result.json().get("detail", "Unknown error")
|
||||
raise Exception(f"Failed to parse the PDF file: {detail}")
|
||||
|
||||
return [
|
||||
Document(
|
||||
text=result.json()[self.result_type.value],
|
||||
metadata=extra_info,
|
||||
)
|
||||
]
|
||||
tries += 1
|
||||
def load_data(self, file_path: Union[List[str], str], extra_info: Optional[dict] = None) -> List[Document]:
|
||||
"""Load data from the input path."""
|
||||
try:
|
||||
return asyncio.run(self.aload_data(file_path, extra_info))
|
||||
except RuntimeError as e:
|
||||
if nest_asyncio_err in str(e):
|
||||
raise RuntimeError(nest_asyncio_msg)
|
||||
else:
|
||||
raise e
|
||||
Generated
+71
-67
@@ -126,13 +126,13 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""}
|
||||
|
||||
[[package]]
|
||||
name = "anyio"
|
||||
version = "4.2.0"
|
||||
version = "4.3.0"
|
||||
description = "High level compatibility layer for multiple asynchronous event loop implementations"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "anyio-4.2.0-py3-none-any.whl", hash = "sha256:745843b39e829e108e518c489b31dc757de7d2131d53fac32bd8df268227bfee"},
|
||||
{file = "anyio-4.2.0.tar.gz", hash = "sha256:e1875bb4b4e2de1669f4bc7869b6d3f54231cdced71605e6e64c9be77e3be50f"},
|
||||
{file = "anyio-4.3.0-py3-none-any.whl", hash = "sha256:048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8"},
|
||||
{file = "anyio-4.3.0.tar.gz", hash = "sha256:f75253795a87df48568485fd18cdd2a3fa5c4f7c5be8e5e36637733fce06fed6"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -761,13 +761,13 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "httpcore"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
description = "A minimal low-level HTTP client."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"},
|
||||
{file = "httpcore-1.0.2.tar.gz", hash = "sha256:9fc092e4799b26174648e54b74ed5f683132a464e95643b226e00c2ed2fa6535"},
|
||||
{file = "httpcore-1.0.3-py3-none-any.whl", hash = "sha256:9a6a501c3099307d9fd76ac244e08503427679b1e81ceb1d922485e2f2462ad2"},
|
||||
{file = "httpcore-1.0.3.tar.gz", hash = "sha256:5c0f9546ad17dac4d0772b0808856eb616eb8b48ce94f49ed819fd6982a8a544"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -778,7 +778,7 @@ h11 = ">=0.13,<0.15"
|
||||
asyncio = ["anyio (>=4.0,<5.0)"]
|
||||
http2 = ["h2 (>=3,<5)"]
|
||||
socks = ["socksio (==1.*)"]
|
||||
trio = ["trio (>=0.22.0,<0.23.0)"]
|
||||
trio = ["trio (>=0.22.0,<0.24.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "httpx"
|
||||
@@ -992,13 +992,13 @@ test = ["ipykernel", "pre-commit", "pytest", "pytest-cov", "pytest-timeout"]
|
||||
|
||||
[[package]]
|
||||
name = "llama-index-core"
|
||||
version = "0.10.1"
|
||||
version = "0.10.7"
|
||||
description = "Interface between LLMs and your data"
|
||||
optional = false
|
||||
python-versions = ">=3.8.1,<4.0"
|
||||
files = [
|
||||
{file = "llama_index_core-0.10.1-py3-none-any.whl", hash = "sha256:81be7e8fd37775af3eade41ec15795460dbcfeae6159258640761a5845ac14ab"},
|
||||
{file = "llama_index_core-0.10.1.tar.gz", hash = "sha256:4872f863bf301d0e69b17af4b12985085b7d832ac7c3747670793ec3e759a826"},
|
||||
{file = "llama_index_core-0.10.7-py3-none-any.whl", hash = "sha256:0dd1ec2878451d75d4644757cc24c8533d83a6c62ffa2ac0a4f1745a31cbb1ad"},
|
||||
{file = "llama_index_core-0.10.7.tar.gz", hash = "sha256:d02f92128ce285110e953ed116a3db1ba02eec508d11ccdca14a851ece5eaead"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -1008,6 +1008,7 @@ deprecated = ">=1.2.9.3"
|
||||
dirtyjson = ">=1.0.8,<2.0.0"
|
||||
fsspec = ">=2023.5.0"
|
||||
httpx = "*"
|
||||
llamaindex-py-client = ">=0.1.13,<0.2.0"
|
||||
nest-asyncio = ">=1.5.8,<2.0.0"
|
||||
networkx = ">=3.0"
|
||||
nltk = ">=3.8.1,<4.0.0"
|
||||
@@ -1032,6 +1033,21 @@ local-models = ["optimum[onnxruntime] (>=1.13.2,<2.0.0)", "sentencepiece (>=0.1.
|
||||
postgres = ["asyncpg (>=0.28.0,<0.29.0)", "pgvector (>=0.1.0,<0.2.0)", "psycopg2-binary (>=2.9.9,<3.0.0)"]
|
||||
query-tools = ["guidance (>=0.0.64,<0.0.65)", "jsonpath-ng (>=1.6.0,<2.0.0)", "lm-format-enforcer (>=0.4.3,<0.5.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "scikit-learn", "spacy (>=3.7.1,<4.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "llamaindex-py-client"
|
||||
version = "0.1.13"
|
||||
description = ""
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "llamaindex_py_client-0.1.13-py3-none-any.whl", hash = "sha256:02400c90655da80ae373e0455c829465208607d72462f1898fd383fdfe8dabce"},
|
||||
{file = "llamaindex_py_client-0.1.13.tar.gz", hash = "sha256:3bd9b435ee0a78171eba412dea5674d813eb5bf36e577d3c7c7e90edc54900d9"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
httpx = ">=0.20.0"
|
||||
pydantic = ">=1.10"
|
||||
|
||||
[[package]]
|
||||
name = "marshmallow"
|
||||
version = "3.20.2"
|
||||
@@ -1728,13 +1744,13 @@ windows-terminal = ["colorama (>=0.4.6)"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "8.0.0"
|
||||
version = "8.0.1"
|
||||
description = "pytest: simple powerful testing with Python"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "pytest-8.0.0-py3-none-any.whl", hash = "sha256:50fb9cbe836c3f20f0dfa99c565201fb75dc54c8d76373cd1bde06b06657bdb6"},
|
||||
{file = "pytest-8.0.0.tar.gz", hash = "sha256:249b1b0864530ba251b7438274c4d251c58d868edaaec8762893ad4a0d71c36c"},
|
||||
{file = "pytest-8.0.1-py3-none-any.whl", hash = "sha256:3e4f16fe1c0a9dc9d9389161c127c3edc5d810c38d6793042fb81d9f48a59fca"},
|
||||
{file = "pytest-8.0.1.tar.gz", hash = "sha256:267f6563751877d772019b13aacbe4e860d73fe8f651f28112e9ac37de7513ae"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -2108,60 +2124,48 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "sqlalchemy"
|
||||
version = "2.0.26"
|
||||
version = "2.0.27"
|
||||
description = "Database Abstraction Library"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:56524d767713054f8758217b3a811f6a736e0ae34e7afc33b594926589aa9609"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c2d8a2c68b279617f13088bdc0fc0e9b5126f8017f8882ff08ee41909fab0713"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84d377645913d47f0dc802b415bcfe7fb085d86646a12278d77c12eb75b5e1b4"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fc0628d2026926404dabc903dc5628f7d936a792aa3a1fc54a20182df8e2172"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:872f2907ade52601a1e729e85d16913c24dc1f6e7c57d11739f18dcfafde29db"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ba46fa770578b3cf3b5b77dadb7e94fda7692dd4d1989268ef3dcb65f31c40a3"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-win32.whl", hash = "sha256:651d10fdba7984bf100222d6e4acc496fec46493262b6170be1981ef860c6184"},
|
||||
{file = "SQLAlchemy-2.0.26-cp310-cp310-win_amd64.whl", hash = "sha256:8f95ede696ab0d7328862d69f29b643d35b668c4f3619cb2f0281adc16e64c1b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fab1bb909bd24accf2024a69edd4f885ded182c079c4dbcd515b4842f86b07cb"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b7ee16afd083bb6bb5ab3962ac7f0eafd1d196c6399388af35fef3d1c6d6d9bb"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:379af901ceb524cbee5e15c1713bf9fd71dc28053286b7917525d01b938b9628"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94a78f56ea13f4d6e9efcd2a2d08cc13531918e0516563f6303c4ad98c81e21d"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a481cc2eec83776ff7b6bb12c8e85d0378af0e2ec4584ac3309365a2a380c64b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8cbeb0e49b605cd75f825fb9239a554803ef2bef1a7b2a8b428926ed518b6b63"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-win32.whl", hash = "sha256:e70cce65239089390c193a7b0d171ce89d2e3dedf797f8010031b2aa2b1e9c80"},
|
||||
{file = "SQLAlchemy-2.0.26-cp311-cp311-win_amd64.whl", hash = "sha256:750d1ef39d50520527c45c309c3cb10bbfa6131f93081b4e93858abb5ece2501"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b39503c3a56e1b2340a7d09e185ddb60b253ad0210877a9958ac64208eb23674"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1a870e6121a052f826f7ae1e4f0b54ca4c0ccd613278218ca036fa5e0f3be7df"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5901eed6d0e23ca4b04d66a561799d4f0fe55fcbfc7ca203bb8c3277f442085b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d25fe55aab9b20ae4a9523bb269074202be9d92a145fcc0b752fff409754b5f6"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5310958d08b4bafc311052be42a3b7d61a93a2bf126ddde07b85f712e7e4ac7b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fd133afb7e6c59fad365ffa97fb06b1001f88e29e1de351bef3d2b1224e2f132"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-win32.whl", hash = "sha256:dc32ecf643c4904dd413e6a95a3f2c8a89ccd6f15083e586dcf8f42eb4e317ae"},
|
||||
{file = "SQLAlchemy-2.0.26-cp312-cp312-win_amd64.whl", hash = "sha256:6e25f029e8ad6d893538b5abe8537e7f09e21d8e96caee46a7e2199f3ddd77b0"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:99a9a8204b8937aa72421e31c493bfc12fd063a8310a0522e5a9b98e6323977c"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:691d68a4fca30c9a676623d094b600797699530e175b6524a9f57e3273f5fa8d"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79a74a4ca4310c812f97bf0f13ce00ed73c890954b5a20b32484a9ab60e567e9"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f2efbbeb18c0e1c53b670a46a009fbde7b58e05b397a808c7e598532b17c6f4b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3fc557f5402206c18ec3d288422f8e5fa764306d49f4efbc6090a7407bf54938"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-win32.whl", hash = "sha256:a9846ffee3283cff4ec476e7ee289314290fcb2384aab5045c6f481c5c4d011f"},
|
||||
{file = "SQLAlchemy-2.0.26-cp37-cp37m-win_amd64.whl", hash = "sha256:ed4667d3d5d6e203a271d684d5b213ebcd618f7a8bc605752a8865eb9e67a79a"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79e629df3f69f849a1482a2d063596b23e32036b83547397e68725e6e0d0a9ab"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4b4d848b095173e0a9e377127b814490499e55f5168f617ae2c07653c326b9d1"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f06afe8e96d7f221cc0b59334dc400151be22f432785e895e37030579d253c3"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f75ac12d302205e60f77f46bd162d40dc37438f1f8db160d2491a78b19a0bd61"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ec3717c1efee8ad4b97f6211978351de3abe1e4b5f73e32f775c7becec021c5c"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06ed4d6bb2365222fb9b0a05478a2d23ad8c1dd874047a9ae1ca1d45f18a255e"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-win32.whl", hash = "sha256:caa79a6caeb4a3cc4ddb9aba9205c383f5d3bcb60d814e87e74570514754e073"},
|
||||
{file = "SQLAlchemy-2.0.26-cp38-cp38-win_amd64.whl", hash = "sha256:996b41c38e34a980e9f810d6e2709a3196e29ee34e46e3c16f96c63da10a9da1"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4f57af0866f6629eae2d24d022ba1a4c1bac9b16d45027bbfcda4c9d5b0d8f26"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e1a532bc33163fb19c4759a36504a23e63032bc8d47cee1c66b0b70a04a0957b"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02a4f954ccb17bd8cff56662efc806c5301508233dc38d0253a5fdb2f33ca3ba"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a678f728fb075e74aaa7fdc27f8af8f03f82d02e7419362cc8c2a605c16a4114"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:8b39462c9588d4780f041e1b84d2ba038ac01c441c961bbee622dd8f53dec69f"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98f4d0d2bda2921af5b0c2ca99207cdab00f2922da46a6336c62c8d6814303a7"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-win32.whl", hash = "sha256:6d68e6b507a3dd20c0add86ac0a0ca061d43c9a0162a122baa5fe952f14240f1"},
|
||||
{file = "SQLAlchemy-2.0.26-cp39-cp39-win_amd64.whl", hash = "sha256:fb97a9b93b953084692a52a7877957b7a88dfcedc0c5652124f5aebf5999f7fe"},
|
||||
{file = "SQLAlchemy-2.0.26-py3-none-any.whl", hash = "sha256:1128b2cdf49107659f6d1f452695f43a20694cc9305a86e97b70793a1c74eeb4"},
|
||||
{file = "SQLAlchemy-2.0.26.tar.gz", hash = "sha256:e1bcd8fcb30305e27355d553608c2c229d3e589fb7ff406da7d7e5d50fa14d0d"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d04e579e911562f1055d26dab1868d3e0bb905db3bccf664ee8ad109f035618a"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fa67d821c1fd268a5a87922ef4940442513b4e6c377553506b9db3b83beebbd8"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:954d9735ee9c3fa74874c830d089a815b7b48df6f6b6e357a74130e478dbd951"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:03f448ffb731b48323bda68bcc93152f751436ad6037f18a42b7e16af9e91c07"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-win32.whl", hash = "sha256:d997c5938a08b5e172c30583ba6b8aad657ed9901fc24caf3a7152eeccb2f1b4"},
|
||||
{file = "SQLAlchemy-2.0.27-cp310-cp310-win_amd64.whl", hash = "sha256:eb15ef40b833f5b2f19eeae65d65e191f039e71790dd565c2af2a3783f72262f"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6c5bad7c60a392850d2f0fee8f355953abaec878c483dd7c3836e0089f046bf6"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3012ab65ea42de1be81fff5fb28d6db893ef978950afc8130ba707179b4284a"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d177b7e82f6dd5e1aebd24d9c3297c70ce09cd1d5d37b43e53f39514379c029c"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1306102f6d9e625cebaca3d4c9c8f10588735ef877f0360b5cdb4fdfd3fd7131"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-win32.whl", hash = "sha256:5b78aa9f4f68212248aaf8943d84c0ff0f74efc65a661c2fc68b82d498311fd5"},
|
||||
{file = "SQLAlchemy-2.0.27-cp311-cp311-win_amd64.whl", hash = "sha256:15e19a84b84528f52a68143439d0c7a3a69befcd4f50b8ef9b7b69d2628ae7c4"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:0de1263aac858f288a80b2071990f02082c51d88335a1db0d589237a3435fe71"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce850db091bf7d2a1f2fdb615220b968aeff3849007b1204bf6e3e50a57b3d32"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4fbe6a766301f2e8a4519f4500fe74ef0a8509a59e07a4085458f26228cd7cc"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0fb3bffc0ced37e5aa4ac2416f56d6d858f46d4da70c09bb731a246e70bff4d5"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-win32.whl", hash = "sha256:7f470327d06400a0aa7926b375b8e8c3c31d335e0884f509fe272b3c700a7254"},
|
||||
{file = "SQLAlchemy-2.0.27-cp312-cp312-win_amd64.whl", hash = "sha256:f9374e270e2553653d710ece397df67db9d19c60d2647bcd35bfc616f1622dcd"},
|
||||
{file = "SQLAlchemy-2.0.27-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e97cf143d74a7a5a0f143aa34039b4fecf11343eed66538610debc438685db4a"},
|
||||
{file = "SQLAlchemy-2.0.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e36aa62b765cf9f43a003233a8c2d7ffdeb55bc62eaa0a0380475b228663a38f"},
|
||||
{file = "SQLAlchemy-2.0.27-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b1d9d1bfd96eef3c3faedb73f486c89e44e64e40e5bfec304ee163de01cf996f"},
|
||||
{file = "SQLAlchemy-2.0.27-cp37-cp37m-win32.whl", hash = "sha256:ca891af9f3289d24a490a5fde664ea04fe2f4984cd97e26de7442a4251bd4b7c"},
|
||||
{file = "SQLAlchemy-2.0.27-cp37-cp37m-win_amd64.whl", hash = "sha256:fd8aafda7cdff03b905d4426b714601c0978725a19efc39f5f207b86d188ba01"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec1f5a328464daf7a1e4e385e4f5652dd9b1d12405075ccba1df842f7774b4fc"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ad862295ad3f644e3c2c0d8b10a988e1600d3123ecb48702d2c0f26771f1c396"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e56afce6431450442f3ab5973156289bd5ec33dd618941283847c9fd5ff06bf"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b86abba762ecfeea359112b2bb4490802b340850bbee1948f785141a5e020de8"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-win32.whl", hash = "sha256:30d81cc1192dc693d49d5671cd40cdec596b885b0ce3b72f323888ab1c3863d5"},
|
||||
{file = "SQLAlchemy-2.0.27-cp38-cp38-win_amd64.whl", hash = "sha256:120af1e49d614d2525ac247f6123841589b029c318b9afbfc9e2b70e22e1827d"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d07ee7793f2aeb9b80ec8ceb96bc8cc08a2aec8a1b152da1955d64e4825fcbac"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cb0845e934647232b6ff5150df37ceffd0b67b754b9fdbb095233deebcddbd4a"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b90053be91973a6fb6020a6e44382c97739736a5a9d74e08cc29b196639eb979"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:33e8bde8fff203de50399b9039c4e14e42d4d227759155c21f8da4a47fc8053c"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-win32.whl", hash = "sha256:d873c21b356bfaf1589b89090a4011e6532582b3a8ea568a00e0c3aab09399dd"},
|
||||
{file = "SQLAlchemy-2.0.27-cp39-cp39-win_amd64.whl", hash = "sha256:ff2f1b7c963961d41403b650842dc2039175b906ab2093635d8319bef0b7d620"},
|
||||
{file = "SQLAlchemy-2.0.27-py3-none-any.whl", hash = "sha256:1ab4e0448018d01b142c916cc7119ca573803a4745cfe341b8f95657812700ac"},
|
||||
{file = "SQLAlchemy-2.0.27.tar.gz", hash = "sha256:86a6ed69a71fe6b88bf9331594fa390a2adda4a49b5c06f98e47bf0d392534f8"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -2383,13 +2387,13 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "2.2.0"
|
||||
version = "2.2.1"
|
||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"},
|
||||
{file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"},
|
||||
{file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"},
|
||||
{file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
@@ -2609,4 +2613,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.8.1,<4.0"
|
||||
content-hash = "5cf698379876c64da36da64eacbc1c6713af00f0607200e01306680c07c48312"
|
||||
content-hash = "f31d084fb327ab8b1e6211692d11cab2f007ff1092277278ce7a7ac693961ee4"
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "llama-parse"
|
||||
version = "0.2.0"
|
||||
version = "0.3.3"
|
||||
description = "Parse files into RAG-Optimized formats."
|
||||
authors = ["Logan Markewich <logan@llamaindex.ai>"]
|
||||
license = "MIT"
|
||||
@@ -9,8 +9,7 @@ packages = [{include = "llama_parse"}]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8.1,<4.0"
|
||||
llama-index-core = "^0.10.0"
|
||||
|
||||
llama-index-core = ">=0.10.7"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest = "^8.0.0"
|
||||
|
||||
Reference in New Issue
Block a user