llama-cloud 0.1.41__py3-none-any.whl → 1.0.0b4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (714) hide show
  1. llama_cloud/__init__.py +101 -816
  2. llama_cloud/_base_client.py +2124 -0
  3. llama_cloud/_client.py +795 -0
  4. llama_cloud/_compat.py +219 -0
  5. llama_cloud/_constants.py +14 -0
  6. llama_cloud/_exceptions.py +108 -0
  7. llama_cloud/_files.py +127 -0
  8. llama_cloud/_models.py +872 -0
  9. llama_cloud/_polling.py +182 -0
  10. llama_cloud/_qs.py +150 -0
  11. llama_cloud/_resource.py +43 -0
  12. llama_cloud/_response.py +832 -0
  13. llama_cloud/_streaming.py +333 -0
  14. llama_cloud/_types.py +270 -0
  15. llama_cloud/_utils/__init__.py +64 -0
  16. llama_cloud/_utils/_compat.py +45 -0
  17. llama_cloud/_utils/_datetime_parse.py +136 -0
  18. llama_cloud/_utils/_logs.py +25 -0
  19. llama_cloud/_utils/_proxy.py +65 -0
  20. llama_cloud/_utils/_reflection.py +42 -0
  21. llama_cloud/_utils/_resources_proxy.py +24 -0
  22. llama_cloud/_utils/_streams.py +12 -0
  23. llama_cloud/_utils/_sync.py +58 -0
  24. llama_cloud/_utils/_transform.py +457 -0
  25. llama_cloud/_utils/_typing.py +156 -0
  26. llama_cloud/_utils/_utils.py +421 -0
  27. llama_cloud/_version.py +4 -0
  28. llama_cloud/lib/__init__.py +0 -0
  29. llama_cloud/lib/index/__init__.py +13 -0
  30. llama_cloud/lib/index/api_utils.py +300 -0
  31. llama_cloud/lib/index/base.py +1041 -0
  32. llama_cloud/lib/index/composite_retriever.py +272 -0
  33. llama_cloud/lib/index/retriever.py +233 -0
  34. llama_cloud/pagination.py +465 -0
  35. llama_cloud/py.typed +0 -0
  36. llama_cloud/resources/__init__.py +136 -107
  37. llama_cloud/resources/beta/__init__.py +102 -1
  38. llama_cloud/resources/beta/agent_data.py +1041 -0
  39. llama_cloud/resources/beta/batch/__init__.py +33 -0
  40. llama_cloud/resources/beta/batch/batch.py +664 -0
  41. llama_cloud/resources/beta/batch/job_items.py +348 -0
  42. llama_cloud/resources/beta/beta.py +262 -0
  43. llama_cloud/resources/beta/directories/__init__.py +33 -0
  44. llama_cloud/resources/beta/directories/directories.py +719 -0
  45. llama_cloud/resources/beta/directories/files.py +913 -0
  46. llama_cloud/resources/beta/parse_configurations.py +743 -0
  47. llama_cloud/resources/beta/sheets.py +1130 -0
  48. llama_cloud/resources/beta/split.py +917 -0
  49. llama_cloud/resources/classifier/__init__.py +32 -1
  50. llama_cloud/resources/classifier/classifier.py +588 -0
  51. llama_cloud/resources/classifier/jobs.py +563 -0
  52. llama_cloud/resources/data_sinks.py +579 -0
  53. llama_cloud/resources/data_sources.py +651 -0
  54. llama_cloud/resources/extraction/__init__.py +61 -0
  55. llama_cloud/resources/extraction/extraction.py +609 -0
  56. llama_cloud/resources/extraction/extraction_agents/__init__.py +33 -0
  57. llama_cloud/resources/extraction/extraction_agents/extraction_agents.py +633 -0
  58. llama_cloud/resources/extraction/extraction_agents/schema.py +308 -0
  59. llama_cloud/resources/extraction/jobs.py +1106 -0
  60. llama_cloud/resources/extraction/runs.py +498 -0
  61. llama_cloud/resources/files.py +784 -0
  62. llama_cloud/resources/parsing.py +1296 -0
  63. llama_cloud/resources/pipelines/__init__.py +98 -24
  64. llama_cloud/resources/pipelines/data_sources.py +529 -0
  65. llama_cloud/resources/pipelines/documents.py +810 -0
  66. llama_cloud/resources/pipelines/files.py +682 -0
  67. llama_cloud/resources/pipelines/images.py +513 -0
  68. llama_cloud/resources/pipelines/metadata.py +265 -0
  69. llama_cloud/resources/pipelines/pipelines.py +1525 -0
  70. llama_cloud/resources/pipelines/sync.py +243 -0
  71. llama_cloud/resources/projects.py +276 -0
  72. llama_cloud/resources/retrievers/__init__.py +32 -1
  73. llama_cloud/resources/retrievers/retriever.py +238 -0
  74. llama_cloud/resources/retrievers/retrievers.py +920 -0
  75. llama_cloud/types/__init__.py +171 -721
  76. llama_cloud/types/advanced_mode_transform_config.py +102 -38
  77. llama_cloud/types/advanced_mode_transform_config_param.py +102 -0
  78. llama_cloud/types/auto_transform_config.py +11 -25
  79. llama_cloud/types/auto_transform_config_param.py +17 -0
  80. llama_cloud/types/azure_openai_embedding.py +62 -0
  81. llama_cloud/types/azure_openai_embedding_config.py +17 -0
  82. llama_cloud/types/azure_openai_embedding_config_param.py +17 -0
  83. llama_cloud/types/azure_openai_embedding_param.py +61 -0
  84. llama_cloud/types/b_box.py +37 -0
  85. llama_cloud/types/bedrock_embedding.py +49 -46
  86. llama_cloud/types/bedrock_embedding_config.py +10 -27
  87. llama_cloud/types/bedrock_embedding_config_param.py +17 -0
  88. llama_cloud/types/bedrock_embedding_param.py +48 -0
  89. llama_cloud/types/beta/__init__.py +59 -0
  90. llama_cloud/types/beta/agent_data.py +26 -0
  91. llama_cloud/types/beta/agent_data_agent_data_params.py +20 -0
  92. llama_cloud/types/beta/agent_data_aggregate_params.py +79 -0
  93. llama_cloud/types/beta/agent_data_aggregate_response.py +17 -0
  94. llama_cloud/types/beta/agent_data_delete_by_query_params.py +43 -0
  95. llama_cloud/types/beta/agent_data_delete_by_query_response.py +11 -0
  96. llama_cloud/types/beta/agent_data_delete_params.py +14 -0
  97. llama_cloud/types/beta/agent_data_delete_response.py +8 -0
  98. llama_cloud/types/beta/agent_data_get_params.py +14 -0
  99. llama_cloud/types/beta/agent_data_search_params.py +69 -0
  100. llama_cloud/types/beta/agent_data_update_params.py +16 -0
  101. llama_cloud/types/beta/batch/__init__.py +12 -0
  102. llama_cloud/types/beta/batch/job_item_get_processing_results_params.py +17 -0
  103. llama_cloud/types/beta/batch/job_item_get_processing_results_response.py +409 -0
  104. llama_cloud/types/beta/batch/job_item_list_params.py +23 -0
  105. llama_cloud/types/beta/batch/job_item_list_response.py +42 -0
  106. llama_cloud/types/beta/batch_cancel_params.py +21 -0
  107. llama_cloud/types/beta/batch_cancel_response.py +23 -0
  108. llama_cloud/types/beta/batch_create_params.py +399 -0
  109. llama_cloud/types/beta/batch_create_response.py +63 -0
  110. llama_cloud/types/beta/batch_get_status_params.py +14 -0
  111. llama_cloud/types/beta/batch_get_status_response.py +73 -0
  112. llama_cloud/types/beta/batch_list_params.py +29 -0
  113. llama_cloud/types/beta/batch_list_response.py +63 -0
  114. llama_cloud/types/beta/directories/__init__.py +15 -0
  115. llama_cloud/types/beta/directories/file_add_params.py +26 -0
  116. llama_cloud/types/beta/directories/file_add_response.py +42 -0
  117. llama_cloud/types/beta/directories/file_delete_params.py +16 -0
  118. llama_cloud/types/beta/directories/file_get_params.py +16 -0
  119. llama_cloud/types/beta/directories/file_get_response.py +42 -0
  120. llama_cloud/types/beta/directories/file_list_params.py +28 -0
  121. llama_cloud/types/beta/directories/file_list_response.py +42 -0
  122. llama_cloud/types/beta/directories/file_update_params.py +27 -0
  123. llama_cloud/types/beta/directories/file_update_response.py +42 -0
  124. llama_cloud/types/beta/directories/file_upload_params.py +24 -0
  125. llama_cloud/types/beta/directories/file_upload_response.py +42 -0
  126. llama_cloud/types/beta/directory_create_params.py +23 -0
  127. llama_cloud/types/beta/directory_create_response.py +36 -0
  128. llama_cloud/types/beta/directory_delete_params.py +14 -0
  129. llama_cloud/types/beta/directory_get_params.py +14 -0
  130. llama_cloud/types/beta/directory_get_response.py +36 -0
  131. llama_cloud/types/beta/directory_list_params.py +24 -0
  132. llama_cloud/types/beta/directory_list_response.py +36 -0
  133. llama_cloud/types/beta/directory_update_params.py +20 -0
  134. llama_cloud/types/beta/directory_update_response.py +36 -0
  135. llama_cloud/types/beta/parse_configuration.py +40 -0
  136. llama_cloud/types/beta/parse_configuration_create_params.py +34 -0
  137. llama_cloud/types/beta/parse_configuration_delete_params.py +14 -0
  138. llama_cloud/types/beta/parse_configuration_get_params.py +14 -0
  139. llama_cloud/types/beta/parse_configuration_list_params.py +24 -0
  140. llama_cloud/types/beta/parse_configuration_query_response.py +28 -0
  141. llama_cloud/types/beta/parse_configuration_update_params.py +22 -0
  142. llama_cloud/types/beta/sheet_create_params.py +22 -0
  143. llama_cloud/types/beta/sheet_delete_job_params.py +14 -0
  144. llama_cloud/types/beta/sheet_get_params.py +16 -0
  145. llama_cloud/types/beta/sheet_get_result_table_params.py +20 -0
  146. llama_cloud/types/beta/sheet_list_params.py +20 -0
  147. llama_cloud/types/beta/sheets_job.py +88 -0
  148. llama_cloud/types/beta/sheets_parsing_config.py +49 -0
  149. llama_cloud/types/beta/sheets_parsing_config_param.py +51 -0
  150. llama_cloud/types/beta/split_category.py +17 -0
  151. llama_cloud/types/beta/split_category_param.py +18 -0
  152. llama_cloud/types/beta/split_create_params.py +36 -0
  153. llama_cloud/types/beta/split_create_response.py +48 -0
  154. llama_cloud/types/beta/split_document_input.py +15 -0
  155. llama_cloud/types/beta/split_document_input_param.py +17 -0
  156. llama_cloud/types/beta/split_get_params.py +14 -0
  157. llama_cloud/types/beta/split_get_response.py +48 -0
  158. llama_cloud/types/beta/split_list_params.py +18 -0
  159. llama_cloud/types/beta/split_list_response.py +48 -0
  160. llama_cloud/types/beta/split_result_response.py +15 -0
  161. llama_cloud/types/beta/split_segment_response.py +20 -0
  162. llama_cloud/types/classifier/__init__.py +15 -0
  163. llama_cloud/types/classifier/classifier_rule.py +25 -0
  164. llama_cloud/types/classifier/classifier_rule_param.py +27 -0
  165. llama_cloud/types/classifier/classify_job.py +51 -0
  166. llama_cloud/types/classifier/classify_job_param.py +53 -0
  167. llama_cloud/types/classifier/classify_parsing_configuration.py +21 -0
  168. llama_cloud/types/classifier/classify_parsing_configuration_param.py +23 -0
  169. llama_cloud/types/classifier/job_create_params.py +30 -0
  170. llama_cloud/types/classifier/job_get_params.py +14 -0
  171. llama_cloud/types/classifier/job_get_results_params.py +14 -0
  172. llama_cloud/types/classifier/job_get_results_response.py +66 -0
  173. llama_cloud/types/classifier/job_list_params.py +18 -0
  174. llama_cloud/types/cohere_embedding.py +37 -40
  175. llama_cloud/types/cohere_embedding_config.py +10 -27
  176. llama_cloud/types/cohere_embedding_config_param.py +17 -0
  177. llama_cloud/types/cohere_embedding_param.py +36 -0
  178. llama_cloud/types/composite_retrieval_mode.py +4 -18
  179. llama_cloud/types/composite_retrieval_result.py +52 -37
  180. llama_cloud/types/data_sink.py +46 -39
  181. llama_cloud/types/data_sink_create_param.py +41 -0
  182. llama_cloud/types/data_sink_create_params.py +44 -0
  183. llama_cloud/types/data_sink_list_params.py +14 -0
  184. llama_cloud/types/data_sink_list_response.py +10 -0
  185. llama_cloud/types/data_sink_update_params.py +40 -0
  186. llama_cloud/types/data_source.py +67 -39
  187. llama_cloud/types/data_source_create_params.py +65 -0
  188. llama_cloud/types/data_source_list_params.py +14 -0
  189. llama_cloud/types/data_source_list_response.py +10 -0
  190. llama_cloud/types/data_source_reader_version_metadata.py +8 -27
  191. llama_cloud/types/data_source_update_params.py +61 -0
  192. llama_cloud/types/extraction/__init__.py +25 -0
  193. llama_cloud/types/extraction/extract_agent.py +41 -0
  194. llama_cloud/types/extraction/extract_config.py +118 -0
  195. llama_cloud/types/extraction/extract_config_param.py +118 -0
  196. llama_cloud/types/extraction/extract_job.py +32 -0
  197. llama_cloud/types/extraction/extract_run.py +64 -0
  198. llama_cloud/types/extraction/extraction_agent_create_params.py +25 -0
  199. llama_cloud/types/extraction/extraction_agent_list_params.py +17 -0
  200. llama_cloud/types/extraction/extraction_agent_list_response.py +10 -0
  201. llama_cloud/types/extraction/extraction_agent_update_params.py +18 -0
  202. llama_cloud/types/extraction/extraction_agents/__init__.py +8 -0
  203. llama_cloud/types/extraction/extraction_agents/schema_generate_schema_params.py +23 -0
  204. llama_cloud/types/extraction/extraction_agents/schema_generate_schema_response.py +14 -0
  205. llama_cloud/types/extraction/extraction_agents/schema_validate_schema_params.py +12 -0
  206. llama_cloud/types/extraction/extraction_agents/schema_validate_schema_response.py +13 -0
  207. llama_cloud/types/extraction/job_create_params.py +38 -0
  208. llama_cloud/types/extraction/job_file_params.py +29 -0
  209. llama_cloud/types/extraction/job_get_result_params.py +14 -0
  210. llama_cloud/types/extraction/job_get_result_response.py +27 -0
  211. llama_cloud/types/extraction/job_list_params.py +11 -0
  212. llama_cloud/types/extraction/job_list_response.py +10 -0
  213. llama_cloud/types/extraction/run_delete_params.py +14 -0
  214. llama_cloud/types/extraction/run_get_by_job_params.py +14 -0
  215. llama_cloud/types/extraction/run_get_params.py +14 -0
  216. llama_cloud/types/extraction/run_list_params.py +15 -0
  217. llama_cloud/types/extraction/webhook_configuration.py +43 -0
  218. llama_cloud/types/extraction/webhook_configuration_param.py +43 -0
  219. llama_cloud/types/extraction_run_params.py +45 -0
  220. llama_cloud/types/fail_page_mode.py +4 -26
  221. llama_cloud/types/file.py +48 -40
  222. llama_cloud/types/file_create_params.py +28 -0
  223. llama_cloud/types/file_create_response.py +38 -0
  224. llama_cloud/types/file_delete_params.py +14 -0
  225. llama_cloud/types/file_get_params.py +16 -0
  226. llama_cloud/types/file_list_params.py +40 -0
  227. llama_cloud/types/file_list_response.py +38 -0
  228. llama_cloud/types/file_query_params.py +61 -0
  229. llama_cloud/types/file_query_response.py +47 -27
  230. llama_cloud/types/gemini_embedding.py +40 -39
  231. llama_cloud/types/gemini_embedding_config.py +10 -27
  232. llama_cloud/types/gemini_embedding_config_param.py +17 -0
  233. llama_cloud/types/gemini_embedding_param.py +39 -0
  234. llama_cloud/types/hugging_face_inference_api_embedding.py +62 -46
  235. llama_cloud/types/hugging_face_inference_api_embedding_config.py +11 -28
  236. llama_cloud/types/hugging_face_inference_api_embedding_config_param.py +17 -0
  237. llama_cloud/types/hugging_face_inference_api_embedding_param.py +60 -0
  238. llama_cloud/types/list_item.py +48 -0
  239. llama_cloud/types/llama_parse_parameters.py +251 -130
  240. llama_cloud/types/llama_parse_parameters_param.py +261 -0
  241. llama_cloud/types/llama_parse_supported_file_extensions.py +84 -310
  242. llama_cloud/types/managed_ingestion_status_response.py +39 -37
  243. llama_cloud/types/message_role.py +4 -46
  244. llama_cloud/types/metadata_filters.py +45 -29
  245. llama_cloud/types/metadata_filters_param.py +58 -0
  246. llama_cloud/types/openai_embedding.py +56 -0
  247. llama_cloud/types/openai_embedding_config.py +17 -0
  248. llama_cloud/types/openai_embedding_config_param.py +17 -0
  249. llama_cloud/types/openai_embedding_param.py +55 -0
  250. llama_cloud/types/page_figure_node_with_score.py +32 -29
  251. llama_cloud/types/page_screenshot_node_with_score.py +23 -29
  252. llama_cloud/types/parsing_create_params.py +586 -0
  253. llama_cloud/types/parsing_create_response.py +33 -0
  254. llama_cloud/types/parsing_get_params.py +27 -0
  255. llama_cloud/types/parsing_get_response.py +364 -0
  256. llama_cloud/types/parsing_languages.py +94 -0
  257. llama_cloud/types/parsing_list_params.py +23 -0
  258. llama_cloud/types/parsing_list_response.py +33 -0
  259. llama_cloud/types/parsing_mode.py +13 -46
  260. llama_cloud/types/parsing_upload_file_params.py +14 -0
  261. llama_cloud/types/parsing_upload_file_response.py +33 -0
  262. llama_cloud/types/pipeline.py +180 -62
  263. llama_cloud/types/pipeline_create_params.py +95 -0
  264. llama_cloud/types/pipeline_get_status_params.py +12 -0
  265. llama_cloud/types/pipeline_list_params.py +23 -0
  266. llama_cloud/types/pipeline_list_response.py +12 -0
  267. llama_cloud/types/pipeline_metadata_config.py +9 -30
  268. llama_cloud/types/pipeline_metadata_config_param.py +17 -0
  269. llama_cloud/types/pipeline_retrieve_params.py +74 -0
  270. llama_cloud/types/pipeline_retrieve_response.py +63 -0
  271. llama_cloud/types/pipeline_type.py +4 -18
  272. llama_cloud/types/pipeline_update_params.py +90 -0
  273. llama_cloud/types/pipeline_upsert_params.py +95 -0
  274. llama_cloud/types/pipelines/__init__.py +38 -0
  275. llama_cloud/types/pipelines/cloud_document.py +29 -0
  276. llama_cloud/types/pipelines/cloud_document_create_param.py +30 -0
  277. llama_cloud/types/pipelines/data_source_get_data_sources_response.py +10 -0
  278. llama_cloud/types/pipelines/data_source_sync_params.py +16 -0
  279. llama_cloud/types/pipelines/data_source_update_data_sources_params.py +25 -0
  280. llama_cloud/types/pipelines/data_source_update_data_sources_response.py +10 -0
  281. llama_cloud/types/pipelines/data_source_update_params.py +15 -0
  282. llama_cloud/types/pipelines/document_create_params.py +14 -0
  283. llama_cloud/types/pipelines/document_create_response.py +10 -0
  284. llama_cloud/types/pipelines/document_get_chunks_response.py +10 -0
  285. llama_cloud/types/pipelines/document_list_params.py +22 -0
  286. llama_cloud/types/pipelines/document_upsert_params.py +14 -0
  287. llama_cloud/types/pipelines/document_upsert_response.py +10 -0
  288. llama_cloud/types/pipelines/file_create_params.py +22 -0
  289. llama_cloud/types/pipelines/file_create_response.py +10 -0
  290. llama_cloud/types/pipelines/file_get_status_counts_params.py +14 -0
  291. llama_cloud/types/pipelines/file_get_status_counts_response.py +24 -0
  292. llama_cloud/types/pipelines/file_list_params.py +22 -0
  293. llama_cloud/types/pipelines/file_update_params.py +15 -0
  294. llama_cloud/types/pipelines/image_get_page_figure_params.py +18 -0
  295. llama_cloud/types/pipelines/image_get_page_screenshot_params.py +16 -0
  296. llama_cloud/types/pipelines/image_list_page_figures_params.py +14 -0
  297. llama_cloud/types/pipelines/image_list_page_figures_response.py +34 -0
  298. llama_cloud/types/pipelines/image_list_page_screenshots_params.py +14 -0
  299. llama_cloud/types/pipelines/image_list_page_screenshots_response.py +25 -0
  300. llama_cloud/types/pipelines/metadata_create_params.py +13 -0
  301. llama_cloud/types/pipelines/metadata_create_response.py +8 -0
  302. llama_cloud/types/pipelines/pipeline_data_source.py +96 -0
  303. llama_cloud/types/pipelines/pipeline_file.py +70 -0
  304. llama_cloud/types/pipelines/text_node.py +89 -0
  305. llama_cloud/types/preset_retrieval_params.py +61 -49
  306. llama_cloud/types/preset_retrieval_params_param.py +71 -0
  307. llama_cloud/types/presigned_url.py +13 -29
  308. llama_cloud/types/project.py +24 -36
  309. llama_cloud/types/project_get_params.py +12 -0
  310. llama_cloud/types/project_list_params.py +14 -0
  311. llama_cloud/types/project_list_response.py +10 -0
  312. llama_cloud/types/re_rank_config_param.py +18 -0
  313. llama_cloud/types/retrieval_mode.py +4 -26
  314. llama_cloud/types/retriever.py +31 -38
  315. llama_cloud/types/retriever_create_params.py +26 -0
  316. llama_cloud/types/retriever_get_params.py +14 -0
  317. llama_cloud/types/retriever_list_params.py +16 -0
  318. llama_cloud/types/retriever_list_response.py +12 -0
  319. llama_cloud/types/retriever_pipeline.py +26 -34
  320. llama_cloud/types/retriever_pipeline_param.py +28 -0
  321. llama_cloud/types/retriever_search_params.py +38 -0
  322. llama_cloud/types/retriever_update_params.py +19 -0
  323. llama_cloud/types/retriever_upsert_params.py +26 -0
  324. llama_cloud/types/retrievers/__init__.py +5 -0
  325. llama_cloud/types/retrievers/retriever_search_params.py +32 -0
  326. llama_cloud/types/shared/__init__.py +21 -0
  327. llama_cloud/types/shared/cloud_astra_db_vector_store.py +39 -0
  328. llama_cloud/types/shared/cloud_az_storage_blob_data_source.py +34 -0
  329. llama_cloud/types/shared/cloud_azure_ai_search_vector_store.py +30 -0
  330. llama_cloud/types/shared/cloud_box_data_source.py +31 -0
  331. llama_cloud/types/shared/cloud_confluence_data_source.py +53 -0
  332. llama_cloud/types/shared/cloud_jira_data_source.py +30 -0
  333. llama_cloud/types/shared/cloud_jira_data_source_v2.py +49 -0
  334. llama_cloud/types/shared/cloud_milvus_vector_store.py +21 -0
  335. llama_cloud/types/shared/cloud_mongodb_atlas_vector_search.py +36 -0
  336. llama_cloud/types/shared/cloud_notion_page_data_source.py +19 -0
  337. llama_cloud/types/shared/cloud_one_drive_data_source.py +32 -0
  338. llama_cloud/types/shared/cloud_pinecone_vector_store.py +32 -0
  339. llama_cloud/types/shared/cloud_postgres_vector_store.py +35 -0
  340. llama_cloud/types/shared/cloud_qdrant_vector_store.py +35 -0
  341. llama_cloud/types/shared/cloud_s3_data_source.py +28 -0
  342. llama_cloud/types/shared/cloud_sharepoint_data_source.py +55 -0
  343. llama_cloud/types/shared/cloud_slack_data_source.py +31 -0
  344. llama_cloud/types/shared/failure_handling_config.py +16 -0
  345. llama_cloud/types/shared/pg_vector_hnsw_settings.py +27 -0
  346. llama_cloud/types/shared_params/__init__.py +21 -0
  347. llama_cloud/types/shared_params/cloud_astra_db_vector_store.py +42 -0
  348. llama_cloud/types/shared_params/cloud_az_storage_blob_data_source.py +41 -0
  349. llama_cloud/types/shared_params/cloud_azure_ai_search_vector_store.py +34 -0
  350. llama_cloud/types/shared_params/cloud_box_data_source.py +40 -0
  351. llama_cloud/types/shared_params/cloud_confluence_data_source.py +58 -0
  352. llama_cloud/types/shared_params/cloud_jira_data_source.py +34 -0
  353. llama_cloud/types/shared_params/cloud_jira_data_source_v2.py +54 -0
  354. llama_cloud/types/shared_params/cloud_milvus_vector_store.py +24 -0
  355. llama_cloud/types/shared_params/cloud_mongodb_atlas_vector_search.py +39 -0
  356. llama_cloud/types/shared_params/cloud_notion_page_data_source.py +23 -0
  357. llama_cloud/types/shared_params/cloud_one_drive_data_source.py +37 -0
  358. llama_cloud/types/shared_params/cloud_pinecone_vector_store.py +35 -0
  359. llama_cloud/types/shared_params/cloud_postgres_vector_store.py +39 -0
  360. llama_cloud/types/shared_params/cloud_qdrant_vector_store.py +37 -0
  361. llama_cloud/types/shared_params/cloud_s3_data_source.py +32 -0
  362. llama_cloud/types/shared_params/cloud_sharepoint_data_source.py +60 -0
  363. llama_cloud/types/shared_params/cloud_slack_data_source.py +35 -0
  364. llama_cloud/types/shared_params/failure_handling_config.py +16 -0
  365. llama_cloud/types/shared_params/pg_vector_hnsw_settings.py +26 -0
  366. llama_cloud/types/sparse_model_config.py +16 -30
  367. llama_cloud/types/sparse_model_config_param.py +25 -0
  368. llama_cloud/types/status_enum.py +4 -34
  369. llama_cloud/types/vertex_ai_embedding_config.py +10 -27
  370. llama_cloud/types/vertex_ai_embedding_config_param.py +17 -0
  371. llama_cloud/types/vertex_text_embedding.py +47 -45
  372. llama_cloud/types/vertex_text_embedding_param.py +45 -0
  373. llama_cloud-1.0.0b4.dist-info/METADATA +546 -0
  374. llama_cloud-1.0.0b4.dist-info/RECORD +376 -0
  375. {llama_cloud-0.1.41.dist-info → llama_cloud-1.0.0b4.dist-info}/WHEEL +1 -1
  376. llama_cloud-1.0.0b4.dist-info/licenses/LICENSE +7 -0
  377. llama_cloud/client.py +0 -108
  378. llama_cloud/core/__init__.py +0 -17
  379. llama_cloud/core/api_error.py +0 -15
  380. llama_cloud/core/client_wrapper.py +0 -51
  381. llama_cloud/core/datetime_utils.py +0 -28
  382. llama_cloud/core/jsonable_encoder.py +0 -106
  383. llama_cloud/core/remove_none_from_dict.py +0 -11
  384. llama_cloud/environment.py +0 -7
  385. llama_cloud/errors/__init__.py +0 -5
  386. llama_cloud/errors/unprocessable_entity_error.py +0 -9
  387. llama_cloud/resources/admin/__init__.py +0 -2
  388. llama_cloud/resources/admin/client.py +0 -196
  389. llama_cloud/resources/agent_deployments/__init__.py +0 -2
  390. llama_cloud/resources/agent_deployments/client.py +0 -160
  391. llama_cloud/resources/alpha/__init__.py +0 -2
  392. llama_cloud/resources/alpha/client.py +0 -112
  393. llama_cloud/resources/beta/client.py +0 -2664
  394. llama_cloud/resources/chat_apps/__init__.py +0 -2
  395. llama_cloud/resources/chat_apps/client.py +0 -616
  396. llama_cloud/resources/classifier/client.py +0 -444
  397. llama_cloud/resources/data_sinks/__init__.py +0 -5
  398. llama_cloud/resources/data_sinks/client.py +0 -535
  399. llama_cloud/resources/data_sinks/types/__init__.py +0 -5
  400. llama_cloud/resources/data_sinks/types/data_sink_update_component.py +0 -22
  401. llama_cloud/resources/data_sources/__init__.py +0 -5
  402. llama_cloud/resources/data_sources/client.py +0 -548
  403. llama_cloud/resources/data_sources/types/__init__.py +0 -6
  404. llama_cloud/resources/data_sources/types/data_source_update_component.py +0 -28
  405. llama_cloud/resources/data_sources/types/data_source_update_custom_metadata_value.py +0 -7
  406. llama_cloud/resources/embedding_model_configs/__init__.py +0 -23
  407. llama_cloud/resources/embedding_model_configs/client.py +0 -420
  408. llama_cloud/resources/embedding_model_configs/types/__init__.py +0 -23
  409. llama_cloud/resources/embedding_model_configs/types/embedding_model_config_create_embedding_config.py +0 -89
  410. llama_cloud/resources/evals/__init__.py +0 -2
  411. llama_cloud/resources/evals/client.py +0 -85
  412. llama_cloud/resources/files/__init__.py +0 -5
  413. llama_cloud/resources/files/client.py +0 -1454
  414. llama_cloud/resources/files/types/__init__.py +0 -5
  415. llama_cloud/resources/files/types/file_create_from_url_resource_info_value.py +0 -7
  416. llama_cloud/resources/jobs/__init__.py +0 -2
  417. llama_cloud/resources/jobs/client.py +0 -164
  418. llama_cloud/resources/llama_extract/__init__.py +0 -27
  419. llama_cloud/resources/llama_extract/client.py +0 -2082
  420. llama_cloud/resources/llama_extract/types/__init__.py +0 -25
  421. llama_cloud/resources/llama_extract/types/extract_agent_create_data_schema.py +0 -9
  422. llama_cloud/resources/llama_extract/types/extract_agent_create_data_schema_zero_value.py +0 -7
  423. llama_cloud/resources/llama_extract/types/extract_agent_update_data_schema.py +0 -9
  424. llama_cloud/resources/llama_extract/types/extract_agent_update_data_schema_zero_value.py +0 -7
  425. llama_cloud/resources/llama_extract/types/extract_job_create_batch_data_schema_override.py +0 -9
  426. llama_cloud/resources/llama_extract/types/extract_job_create_batch_data_schema_override_zero_value.py +0 -7
  427. llama_cloud/resources/llama_extract/types/extract_schema_validate_request_data_schema.py +0 -9
  428. llama_cloud/resources/llama_extract/types/extract_schema_validate_request_data_schema_zero_value.py +0 -7
  429. llama_cloud/resources/llama_extract/types/extract_stateless_request_data_schema.py +0 -9
  430. llama_cloud/resources/llama_extract/types/extract_stateless_request_data_schema_zero_value.py +0 -7
  431. llama_cloud/resources/organizations/__init__.py +0 -2
  432. llama_cloud/resources/organizations/client.py +0 -1448
  433. llama_cloud/resources/parsing/__init__.py +0 -2
  434. llama_cloud/resources/parsing/client.py +0 -2392
  435. llama_cloud/resources/pipelines/client.py +0 -3436
  436. llama_cloud/resources/pipelines/types/__init__.py +0 -29
  437. llama_cloud/resources/pipelines/types/pipeline_file_update_custom_metadata_value.py +0 -7
  438. llama_cloud/resources/pipelines/types/pipeline_update_embedding_config.py +0 -89
  439. llama_cloud/resources/pipelines/types/pipeline_update_transform_config.py +0 -8
  440. llama_cloud/resources/pipelines/types/retrieval_params_search_filters_inference_schema_value.py +0 -7
  441. llama_cloud/resources/projects/__init__.py +0 -2
  442. llama_cloud/resources/projects/client.py +0 -636
  443. llama_cloud/resources/retrievers/client.py +0 -837
  444. llama_cloud/resources/users/__init__.py +0 -2
  445. llama_cloud/resources/users/client.py +0 -155
  446. llama_cloud/types/advanced_mode_transform_config_chunking_config.py +0 -67
  447. llama_cloud/types/advanced_mode_transform_config_segmentation_config.py +0 -45
  448. llama_cloud/types/agent_data.py +0 -40
  449. llama_cloud/types/agent_deployment_list.py +0 -32
  450. llama_cloud/types/agent_deployment_summary.py +0 -39
  451. llama_cloud/types/aggregate_group.py +0 -37
  452. llama_cloud/types/azure_open_ai_embedding.py +0 -49
  453. llama_cloud/types/azure_open_ai_embedding_config.py +0 -34
  454. llama_cloud/types/base_plan.py +0 -53
  455. llama_cloud/types/base_plan_metronome_plan_type.py +0 -17
  456. llama_cloud/types/base_plan_name.py +0 -57
  457. llama_cloud/types/base_plan_plan_frequency.py +0 -25
  458. llama_cloud/types/batch.py +0 -47
  459. llama_cloud/types/batch_item.py +0 -40
  460. llama_cloud/types/batch_paginated_list.py +0 -35
  461. llama_cloud/types/batch_public_output.py +0 -36
  462. llama_cloud/types/billing_period.py +0 -32
  463. llama_cloud/types/box_auth_mechanism.py +0 -17
  464. llama_cloud/types/character_chunking_config.py +0 -32
  465. llama_cloud/types/chat_app.py +0 -46
  466. llama_cloud/types/chat_app_response.py +0 -43
  467. llama_cloud/types/chat_data.py +0 -35
  468. llama_cloud/types/chat_message.py +0 -43
  469. llama_cloud/types/chunk_mode.py +0 -29
  470. llama_cloud/types/classification_result.py +0 -39
  471. llama_cloud/types/classifier_rule.py +0 -43
  472. llama_cloud/types/classify_job.py +0 -47
  473. llama_cloud/types/classify_job_results.py +0 -38
  474. llama_cloud/types/classify_parsing_configuration.py +0 -38
  475. llama_cloud/types/cloud_astra_db_vector_store.py +0 -51
  476. llama_cloud/types/cloud_az_storage_blob_data_source.py +0 -41
  477. llama_cloud/types/cloud_azure_ai_search_vector_store.py +0 -45
  478. llama_cloud/types/cloud_box_data_source.py +0 -42
  479. llama_cloud/types/cloud_confluence_data_source.py +0 -59
  480. llama_cloud/types/cloud_document.py +0 -40
  481. llama_cloud/types/cloud_document_create.py +0 -40
  482. llama_cloud/types/cloud_jira_data_source.py +0 -42
  483. llama_cloud/types/cloud_jira_data_source_v_2.py +0 -52
  484. llama_cloud/types/cloud_jira_data_source_v_2_api_version.py +0 -21
  485. llama_cloud/types/cloud_milvus_vector_store.py +0 -40
  486. llama_cloud/types/cloud_mongo_db_atlas_vector_search.py +0 -52
  487. llama_cloud/types/cloud_notion_page_data_source.py +0 -35
  488. llama_cloud/types/cloud_one_drive_data_source.py +0 -39
  489. llama_cloud/types/cloud_pinecone_vector_store.py +0 -49
  490. llama_cloud/types/cloud_postgres_vector_store.py +0 -44
  491. llama_cloud/types/cloud_qdrant_vector_store.py +0 -51
  492. llama_cloud/types/cloud_s_3_data_source.py +0 -39
  493. llama_cloud/types/cloud_sharepoint_data_source.py +0 -42
  494. llama_cloud/types/cloud_slack_data_source.py +0 -39
  495. llama_cloud/types/composite_retrieved_text_node.py +0 -42
  496. llama_cloud/types/composite_retrieved_text_node_with_score.py +0 -34
  497. llama_cloud/types/configurable_data_sink_names.py +0 -41
  498. llama_cloud/types/configurable_data_source_names.py +0 -57
  499. llama_cloud/types/credit_type.py +0 -32
  500. llama_cloud/types/data_sink_component.py +0 -22
  501. llama_cloud/types/data_sink_create.py +0 -39
  502. llama_cloud/types/data_sink_create_component.py +0 -22
  503. llama_cloud/types/data_source_component.py +0 -28
  504. llama_cloud/types/data_source_create.py +0 -41
  505. llama_cloud/types/data_source_create_component.py +0 -28
  506. llama_cloud/types/data_source_create_custom_metadata_value.py +0 -7
  507. llama_cloud/types/data_source_custom_metadata_value.py +0 -7
  508. llama_cloud/types/data_source_reader_version_metadata_reader_version.py +0 -25
  509. llama_cloud/types/data_source_update_dispatcher_config.py +0 -38
  510. llama_cloud/types/delete_params.py +0 -39
  511. llama_cloud/types/document_chunk_mode.py +0 -17
  512. llama_cloud/types/document_ingestion_job_params.py +0 -43
  513. llama_cloud/types/element_segmentation_config.py +0 -29
  514. llama_cloud/types/embedding_model_config.py +0 -43
  515. llama_cloud/types/embedding_model_config_embedding_config.py +0 -89
  516. llama_cloud/types/embedding_model_config_update.py +0 -33
  517. llama_cloud/types/embedding_model_config_update_embedding_config.py +0 -89
  518. llama_cloud/types/eval_execution_params.py +0 -41
  519. llama_cloud/types/extract_agent.py +0 -48
  520. llama_cloud/types/extract_agent_data_schema_value.py +0 -5
  521. llama_cloud/types/extract_config.py +0 -66
  522. llama_cloud/types/extract_config_priority.py +0 -29
  523. llama_cloud/types/extract_job.py +0 -38
  524. llama_cloud/types/extract_job_create.py +0 -46
  525. llama_cloud/types/extract_job_create_data_schema_override.py +0 -9
  526. llama_cloud/types/extract_job_create_data_schema_override_zero_value.py +0 -7
  527. llama_cloud/types/extract_job_create_priority.py +0 -29
  528. llama_cloud/types/extract_mode.py +0 -29
  529. llama_cloud/types/extract_models.py +0 -53
  530. llama_cloud/types/extract_resultset.py +0 -42
  531. llama_cloud/types/extract_resultset_data.py +0 -11
  532. llama_cloud/types/extract_resultset_data_item_value.py +0 -7
  533. llama_cloud/types/extract_resultset_data_zero_value.py +0 -7
  534. llama_cloud/types/extract_resultset_extraction_metadata_value.py +0 -7
  535. llama_cloud/types/extract_run.py +0 -55
  536. llama_cloud/types/extract_run_data.py +0 -11
  537. llama_cloud/types/extract_run_data_item_value.py +0 -5
  538. llama_cloud/types/extract_run_data_schema_value.py +0 -5
  539. llama_cloud/types/extract_run_data_zero_value.py +0 -5
  540. llama_cloud/types/extract_run_extraction_metadata_value.py +0 -7
  541. llama_cloud/types/extract_schema_generate_response.py +0 -38
  542. llama_cloud/types/extract_schema_generate_response_data_schema_value.py +0 -7
  543. llama_cloud/types/extract_schema_validate_response.py +0 -32
  544. llama_cloud/types/extract_schema_validate_response_data_schema_value.py +0 -7
  545. llama_cloud/types/extract_state.py +0 -29
  546. llama_cloud/types/extract_target.py +0 -17
  547. llama_cloud/types/failure_handling_config.py +0 -37
  548. llama_cloud/types/file_classification.py +0 -41
  549. llama_cloud/types/file_count_by_status_response.py +0 -37
  550. llama_cloud/types/file_create.py +0 -41
  551. llama_cloud/types/file_create_permission_info_value.py +0 -7
  552. llama_cloud/types/file_create_resource_info_value.py +0 -5
  553. llama_cloud/types/file_data.py +0 -36
  554. llama_cloud/types/file_filter.py +0 -40
  555. llama_cloud/types/file_id_presigned_url.py +0 -38
  556. llama_cloud/types/file_parse_public.py +0 -36
  557. llama_cloud/types/file_permission_info_value.py +0 -5
  558. llama_cloud/types/file_resource_info_value.py +0 -5
  559. llama_cloud/types/file_store_info_response.py +0 -34
  560. llama_cloud/types/file_store_info_response_status.py +0 -25
  561. llama_cloud/types/filter_condition.py +0 -29
  562. llama_cloud/types/filter_operation.py +0 -46
  563. llama_cloud/types/filter_operation_eq.py +0 -6
  564. llama_cloud/types/filter_operation_gt.py +0 -6
  565. llama_cloud/types/filter_operation_gte.py +0 -6
  566. llama_cloud/types/filter_operation_includes_item.py +0 -6
  567. llama_cloud/types/filter_operation_lt.py +0 -6
  568. llama_cloud/types/filter_operation_lte.py +0 -6
  569. llama_cloud/types/filter_operator.py +0 -73
  570. llama_cloud/types/free_credits_usage.py +0 -34
  571. llama_cloud/types/http_validation_error.py +0 -32
  572. llama_cloud/types/hugging_face_inference_api_embedding_token.py +0 -5
  573. llama_cloud/types/ingestion_error_response.py +0 -34
  574. llama_cloud/types/input_message.py +0 -40
  575. llama_cloud/types/job_name_mapping.py +0 -49
  576. llama_cloud/types/job_names.py +0 -81
  577. llama_cloud/types/job_record.py +0 -58
  578. llama_cloud/types/job_record_parameters.py +0 -111
  579. llama_cloud/types/job_record_with_usage_metrics.py +0 -36
  580. llama_cloud/types/l_lama_parse_transform_config.py +0 -37
  581. llama_cloud/types/legacy_parse_job_config.py +0 -207
  582. llama_cloud/types/license_info_response.py +0 -34
  583. llama_cloud/types/llama_extract_feature_availability.py +0 -34
  584. llama_cloud/types/llama_extract_mode_availability.py +0 -38
  585. llama_cloud/types/llama_extract_mode_availability_status.py +0 -17
  586. llama_cloud/types/llama_extract_settings.py +0 -67
  587. llama_cloud/types/llama_parse_parameters_priority.py +0 -29
  588. llama_cloud/types/llm_model_data.py +0 -38
  589. llama_cloud/types/llm_parameters.py +0 -39
  590. llama_cloud/types/load_files_job_config.py +0 -35
  591. llama_cloud/types/managed_ingestion_status.py +0 -41
  592. llama_cloud/types/managed_open_ai_embedding.py +0 -36
  593. llama_cloud/types/managed_open_ai_embedding_config.py +0 -34
  594. llama_cloud/types/message_annotation.py +0 -33
  595. llama_cloud/types/metadata_filter.py +0 -44
  596. llama_cloud/types/metadata_filter_value.py +0 -5
  597. llama_cloud/types/metadata_filters_filters_item.py +0 -8
  598. llama_cloud/types/multimodal_parse_resolution.py +0 -17
  599. llama_cloud/types/node_relationship.py +0 -44
  600. llama_cloud/types/none_chunking_config.py +0 -29
  601. llama_cloud/types/none_segmentation_config.py +0 -29
  602. llama_cloud/types/object_type.py +0 -33
  603. llama_cloud/types/open_ai_embedding.py +0 -47
  604. llama_cloud/types/open_ai_embedding_config.py +0 -34
  605. llama_cloud/types/organization.py +0 -43
  606. llama_cloud/types/organization_create.py +0 -35
  607. llama_cloud/types/page_figure_metadata.py +0 -37
  608. llama_cloud/types/page_screenshot_metadata.py +0 -34
  609. llama_cloud/types/page_segmentation_config.py +0 -31
  610. llama_cloud/types/paginated_extract_runs_response.py +0 -39
  611. llama_cloud/types/paginated_jobs_history_with_metrics.py +0 -35
  612. llama_cloud/types/paginated_list_cloud_documents_response.py +0 -35
  613. llama_cloud/types/paginated_list_pipeline_files_response.py +0 -35
  614. llama_cloud/types/paginated_response_agent_data.py +0 -34
  615. llama_cloud/types/paginated_response_aggregate_group.py +0 -34
  616. llama_cloud/types/paginated_response_classify_job.py +0 -34
  617. llama_cloud/types/paginated_response_quota_configuration.py +0 -36
  618. llama_cloud/types/parse_configuration.py +0 -44
  619. llama_cloud/types/parse_configuration_create.py +0 -41
  620. llama_cloud/types/parse_configuration_filter.py +0 -40
  621. llama_cloud/types/parse_configuration_query_response.py +0 -38
  622. llama_cloud/types/parse_job_config.py +0 -149
  623. llama_cloud/types/parse_job_config_priority.py +0 -29
  624. llama_cloud/types/parse_plan_level.py +0 -21
  625. llama_cloud/types/parser_languages.py +0 -361
  626. llama_cloud/types/parsing_history_item.py +0 -39
  627. llama_cloud/types/parsing_job.py +0 -35
  628. llama_cloud/types/parsing_job_json_result.py +0 -32
  629. llama_cloud/types/parsing_job_markdown_result.py +0 -32
  630. llama_cloud/types/parsing_job_structured_result.py +0 -32
  631. llama_cloud/types/parsing_job_text_result.py +0 -32
  632. llama_cloud/types/partition_names.py +0 -45
  633. llama_cloud/types/permission.py +0 -40
  634. llama_cloud/types/pg_vector_distance_method.py +0 -43
  635. llama_cloud/types/pg_vector_hnsw_settings.py +0 -45
  636. llama_cloud/types/pg_vector_vector_type.py +0 -35
  637. llama_cloud/types/pipeline_configuration_hashes.py +0 -37
  638. llama_cloud/types/pipeline_create.py +0 -65
  639. llama_cloud/types/pipeline_create_embedding_config.py +0 -89
  640. llama_cloud/types/pipeline_create_transform_config.py +0 -8
  641. llama_cloud/types/pipeline_data_source.py +0 -55
  642. llama_cloud/types/pipeline_data_source_component.py +0 -28
  643. llama_cloud/types/pipeline_data_source_create.py +0 -36
  644. llama_cloud/types/pipeline_data_source_custom_metadata_value.py +0 -7
  645. llama_cloud/types/pipeline_data_source_status.py +0 -33
  646. llama_cloud/types/pipeline_deployment.py +0 -37
  647. llama_cloud/types/pipeline_embedding_config.py +0 -100
  648. llama_cloud/types/pipeline_file.py +0 -58
  649. llama_cloud/types/pipeline_file_config_hash_value.py +0 -5
  650. llama_cloud/types/pipeline_file_create.py +0 -37
  651. llama_cloud/types/pipeline_file_create_custom_metadata_value.py +0 -7
  652. llama_cloud/types/pipeline_file_custom_metadata_value.py +0 -7
  653. llama_cloud/types/pipeline_file_permission_info_value.py +0 -7
  654. llama_cloud/types/pipeline_file_resource_info_value.py +0 -7
  655. llama_cloud/types/pipeline_file_status.py +0 -33
  656. llama_cloud/types/pipeline_file_update_dispatcher_config.py +0 -38
  657. llama_cloud/types/pipeline_file_updater_config.py +0 -44
  658. llama_cloud/types/pipeline_managed_ingestion_job_params.py +0 -37
  659. llama_cloud/types/pipeline_status.py +0 -17
  660. llama_cloud/types/pipeline_transform_config.py +0 -31
  661. llama_cloud/types/plan_limits.py +0 -53
  662. llama_cloud/types/playground_session.py +0 -51
  663. llama_cloud/types/pooling.py +0 -29
  664. llama_cloud/types/preset_composite_retrieval_params.py +0 -37
  665. llama_cloud/types/preset_retrieval_params_search_filters_inference_schema_value.py +0 -7
  666. llama_cloud/types/project_create.py +0 -35
  667. llama_cloud/types/prompt_conf.py +0 -38
  668. llama_cloud/types/public_model_name.py +0 -97
  669. llama_cloud/types/quota_configuration.py +0 -53
  670. llama_cloud/types/quota_configuration_configuration_type.py +0 -33
  671. llama_cloud/types/quota_configuration_status.py +0 -21
  672. llama_cloud/types/quota_rate_limit_configuration_value.py +0 -38
  673. llama_cloud/types/quota_rate_limit_configuration_value_denominator_units.py +0 -29
  674. llama_cloud/types/re_rank_config.py +0 -35
  675. llama_cloud/types/re_ranker_type.py +0 -41
  676. llama_cloud/types/recurring_credit_grant.py +0 -44
  677. llama_cloud/types/related_node_info.py +0 -36
  678. llama_cloud/types/related_node_info_node_type.py +0 -7
  679. llama_cloud/types/retrieve_results.py +0 -56
  680. llama_cloud/types/retriever_create.py +0 -37
  681. llama_cloud/types/role.py +0 -40
  682. llama_cloud/types/schema_generation_availability.py +0 -33
  683. llama_cloud/types/schema_generation_availability_status.py +0 -17
  684. llama_cloud/types/schema_relax_mode.py +0 -25
  685. llama_cloud/types/semantic_chunking_config.py +0 -32
  686. llama_cloud/types/sentence_chunking_config.py +0 -34
  687. llama_cloud/types/sparse_model_type.py +0 -33
  688. llama_cloud/types/struct_mode.py +0 -33
  689. llama_cloud/types/struct_parse_conf.py +0 -63
  690. llama_cloud/types/supported_llm_model.py +0 -40
  691. llama_cloud/types/supported_llm_model_names.py +0 -69
  692. llama_cloud/types/text_node.py +0 -67
  693. llama_cloud/types/text_node_relationships_value.py +0 -7
  694. llama_cloud/types/text_node_with_score.py +0 -39
  695. llama_cloud/types/token_chunking_config.py +0 -33
  696. llama_cloud/types/update_user_response.py +0 -33
  697. llama_cloud/types/usage_and_plan.py +0 -34
  698. llama_cloud/types/usage_metric_response.py +0 -34
  699. llama_cloud/types/usage_response.py +0 -43
  700. llama_cloud/types/usage_response_active_alerts_item.py +0 -37
  701. llama_cloud/types/user_job_record.py +0 -32
  702. llama_cloud/types/user_organization.py +0 -47
  703. llama_cloud/types/user_organization_create.py +0 -38
  704. llama_cloud/types/user_organization_delete.py +0 -37
  705. llama_cloud/types/user_organization_role.py +0 -42
  706. llama_cloud/types/user_summary.py +0 -38
  707. llama_cloud/types/validation_error.py +0 -34
  708. llama_cloud/types/validation_error_loc_item.py +0 -5
  709. llama_cloud/types/vertex_embedding_mode.py +0 -38
  710. llama_cloud/types/webhook_configuration.py +0 -39
  711. llama_cloud/types/webhook_configuration_webhook_events_item.py +0 -57
  712. llama_cloud-0.1.41.dist-info/LICENSE +0 -21
  713. llama_cloud-0.1.41.dist-info/METADATA +0 -106
  714. llama_cloud-0.1.41.dist-info/RECORD +0 -385
@@ -1,2392 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- import urllib.parse
5
- from json.decoder import JSONDecodeError
6
-
7
- from ...core.api_error import ApiError
8
- from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
- from ...core.jsonable_encoder import jsonable_encoder
10
- from ...core.remove_none_from_dict import remove_none_from_dict
11
- from ...errors.unprocessable_entity_error import UnprocessableEntityError
12
- from ...types.fail_page_mode import FailPageMode
13
- from ...types.http_validation_error import HttpValidationError
14
- from ...types.llama_parse_supported_file_extensions import LlamaParseSupportedFileExtensions
15
- from ...types.parser_languages import ParserLanguages
16
- from ...types.parsing_history_item import ParsingHistoryItem
17
- from ...types.parsing_job import ParsingJob
18
- from ...types.parsing_job_json_result import ParsingJobJsonResult
19
- from ...types.parsing_job_markdown_result import ParsingJobMarkdownResult
20
- from ...types.parsing_job_structured_result import ParsingJobStructuredResult
21
- from ...types.parsing_job_text_result import ParsingJobTextResult
22
- from ...types.parsing_mode import ParsingMode
23
- from ...types.presigned_url import PresignedUrl
24
-
25
- try:
26
- import pydantic
27
- if pydantic.__version__.startswith("1."):
28
- raise ImportError
29
- import pydantic.v1 as pydantic # type: ignore
30
- except ImportError:
31
- import pydantic # type: ignore
32
-
33
- # this is used as the default value for optional parameters
34
- OMIT = typing.cast(typing.Any, ...)
35
-
36
-
37
- class ParsingClient:
38
- def __init__(self, *, client_wrapper: SyncClientWrapper):
39
- self._client_wrapper = client_wrapper
40
-
41
- def get_job_image_result(self, job_id: str, name: str) -> None:
42
- """
43
- Get a job by id
44
-
45
- Parameters:
46
- - job_id: str.
47
-
48
- - name: str.
49
- ---
50
- from llama_cloud.client import LlamaCloud
51
-
52
- client = LlamaCloud(
53
- token="YOUR_TOKEN",
54
- )
55
- client.parsing.get_job_image_result(
56
- job_id="string",
57
- name="string",
58
- )
59
- """
60
- _response = self._client_wrapper.httpx_client.request(
61
- "GET",
62
- urllib.parse.urljoin(
63
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/image/{name}"
64
- ),
65
- headers=self._client_wrapper.get_headers(),
66
- timeout=60,
67
- )
68
- if 200 <= _response.status_code < 300:
69
- return
70
- if _response.status_code == 422:
71
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
72
- try:
73
- _response_json = _response.json()
74
- except JSONDecodeError:
75
- raise ApiError(status_code=_response.status_code, body=_response.text)
76
- raise ApiError(status_code=_response.status_code, body=_response_json)
77
-
78
- def get_supported_file_extensions(self) -> typing.List[LlamaParseSupportedFileExtensions]:
79
- """
80
- Get a list of supported file extensions
81
-
82
- ---
83
- from llama_cloud.client import LlamaCloud
84
-
85
- client = LlamaCloud(
86
- token="YOUR_TOKEN",
87
- )
88
- client.parsing.get_supported_file_extensions()
89
- """
90
- _response = self._client_wrapper.httpx_client.request(
91
- "GET",
92
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/supported_file_extensions"),
93
- headers=self._client_wrapper.get_headers(),
94
- timeout=60,
95
- )
96
- if 200 <= _response.status_code < 300:
97
- return pydantic.parse_obj_as(typing.List[LlamaParseSupportedFileExtensions], _response.json()) # type: ignore
98
- try:
99
- _response_json = _response.json()
100
- except JSONDecodeError:
101
- raise ApiError(status_code=_response.status_code, body=_response.text)
102
- raise ApiError(status_code=_response.status_code, body=_response_json)
103
-
104
- def screenshot(
105
- self,
106
- *,
107
- organization_id: typing.Optional[str] = None,
108
- project_id: typing.Optional[str] = None,
109
- file: typing.Optional[str] = OMIT,
110
- do_not_cache: bool,
111
- http_proxy: str,
112
- input_s_3_path: str,
113
- input_s_3_region: str,
114
- input_url: str,
115
- invalidate_cache: bool,
116
- max_pages: typing.Optional[int] = OMIT,
117
- output_s_3_path_prefix: str,
118
- output_s_3_region: str,
119
- target_pages: str,
120
- webhook_url: str,
121
- webhook_configurations: str,
122
- job_timeout_in_seconds: float,
123
- job_timeout_extra_time_per_page_in_seconds: float,
124
- ) -> ParsingJob:
125
- """
126
- Parameters:
127
- - organization_id: typing.Optional[str].
128
-
129
- - project_id: typing.Optional[str].
130
-
131
- - file: typing.Optional[str].
132
-
133
- - do_not_cache: bool.
134
-
135
- - http_proxy: str.
136
-
137
- - input_s_3_path: str.
138
-
139
- - input_s_3_region: str.
140
-
141
- - input_url: str.
142
-
143
- - invalidate_cache: bool.
144
-
145
- - max_pages: typing.Optional[int].
146
-
147
- - output_s_3_path_prefix: str.
148
-
149
- - output_s_3_region: str.
150
-
151
- - target_pages: str.
152
-
153
- - webhook_url: str.
154
-
155
- - webhook_configurations: str.
156
-
157
- - job_timeout_in_seconds: float.
158
-
159
- - job_timeout_extra_time_per_page_in_seconds: float.
160
- """
161
- _request: typing.Dict[str, typing.Any] = {
162
- "do_not_cache": do_not_cache,
163
- "http_proxy": http_proxy,
164
- "input_s3_path": input_s_3_path,
165
- "input_s3_region": input_s_3_region,
166
- "input_url": input_url,
167
- "invalidate_cache": invalidate_cache,
168
- "output_s3_path_prefix": output_s_3_path_prefix,
169
- "output_s3_region": output_s_3_region,
170
- "target_pages": target_pages,
171
- "webhook_url": webhook_url,
172
- "webhook_configurations": webhook_configurations,
173
- "job_timeout_in_seconds": job_timeout_in_seconds,
174
- "job_timeout_extra_time_per_page_in_seconds": job_timeout_extra_time_per_page_in_seconds,
175
- }
176
- if file is not OMIT:
177
- _request["file"] = file
178
- if max_pages is not OMIT:
179
- _request["max_pages"] = max_pages
180
- _response = self._client_wrapper.httpx_client.request(
181
- "POST",
182
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/screenshot"),
183
- params=remove_none_from_dict({"organization_id": organization_id, "project_id": project_id}),
184
- json=jsonable_encoder(_request),
185
- headers=self._client_wrapper.get_headers(),
186
- timeout=60,
187
- )
188
- if 200 <= _response.status_code < 300:
189
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
190
- if _response.status_code == 422:
191
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
192
- try:
193
- _response_json = _response.json()
194
- except JSONDecodeError:
195
- raise ApiError(status_code=_response.status_code, body=_response.text)
196
- raise ApiError(status_code=_response.status_code, body=_response_json)
197
-
198
- def upload_file(
199
- self,
200
- *,
201
- organization_id: typing.Optional[str] = None,
202
- project_id: typing.Optional[str] = None,
203
- file: typing.Optional[str] = OMIT,
204
- adaptive_long_table: bool,
205
- annotate_links: bool,
206
- auto_mode: bool,
207
- auto_mode_trigger_on_image_in_page: bool,
208
- auto_mode_trigger_on_table_in_page: bool,
209
- auto_mode_trigger_on_text_in_page: str,
210
- auto_mode_trigger_on_regexp_in_page: str,
211
- auto_mode_configuration_json: str,
212
- azure_openai_api_version: str,
213
- azure_openai_deployment_name: str,
214
- azure_openai_endpoint: str,
215
- azure_openai_key: str,
216
- bbox_bottom: float,
217
- bbox_left: float,
218
- bbox_right: float,
219
- bbox_top: float,
220
- compact_markdown_table: bool,
221
- disable_ocr: bool,
222
- disable_reconstruction: bool,
223
- disable_image_extraction: bool,
224
- do_not_cache: bool,
225
- do_not_unroll_columns: bool,
226
- extract_charts: bool,
227
- guess_xlsx_sheet_name: bool,
228
- high_res_ocr: bool,
229
- html_make_all_elements_visible: bool,
230
- layout_aware: bool,
231
- html_remove_fixed_elements: bool,
232
- html_remove_navigation_elements: bool,
233
- http_proxy: str,
234
- input_s_3_path: str,
235
- input_s_3_region: str,
236
- input_url: str,
237
- invalidate_cache: bool,
238
- language: typing.List[ParserLanguages],
239
- extract_layout: bool,
240
- max_pages: typing.Optional[int] = OMIT,
241
- merge_tables_across_pages_in_markdown: bool,
242
- outlined_table_extraction: bool,
243
- output_pdf_of_document: bool,
244
- output_s_3_path_prefix: str,
245
- output_s_3_region: str,
246
- page_prefix: str,
247
- page_separator: str,
248
- page_suffix: str,
249
- preserve_layout_alignment_across_pages: bool,
250
- preserve_very_small_text: bool,
251
- skip_diagonal_text: bool,
252
- spreadsheet_extract_sub_tables: bool,
253
- structured_output: bool,
254
- structured_output_json_schema: str,
255
- structured_output_json_schema_name: str,
256
- take_screenshot: bool,
257
- target_pages: str,
258
- vendor_multimodal_api_key: str,
259
- vendor_multimodal_model_name: str,
260
- model: str,
261
- webhook_url: str,
262
- webhook_configurations: str,
263
- preset: str,
264
- parse_mode: typing.Optional[ParsingMode] = OMIT,
265
- page_error_tolerance: float,
266
- replace_failed_page_mode: typing.Optional[FailPageMode] = OMIT,
267
- replace_failed_page_with_error_message_prefix: str,
268
- replace_failed_page_with_error_message_suffix: str,
269
- system_prompt: str,
270
- system_prompt_append: str,
271
- user_prompt: str,
272
- job_timeout_in_seconds: float,
273
- job_timeout_extra_time_per_page_in_seconds: float,
274
- strict_mode_image_extraction: bool,
275
- strict_mode_image_ocr: bool,
276
- strict_mode_reconstruction: bool,
277
- strict_mode_buggy_font: bool,
278
- save_images: bool,
279
- ignore_document_elements_for_layout_detection: bool,
280
- output_tables_as_html: bool,
281
- markdown_table_multiline_header_separator: str,
282
- use_vendor_multimodal_model: bool,
283
- bounding_box: str,
284
- gpt_4_o_mode: bool,
285
- gpt_4_o_api_key: str,
286
- complemental_formatting_instruction: str,
287
- content_guideline_instruction: str,
288
- premium_mode: bool,
289
- is_formatting_instruction: bool,
290
- continuous_mode: bool,
291
- parsing_instruction: str,
292
- fast_mode: bool,
293
- formatting_instruction: str,
294
- hide_headers: bool,
295
- hide_footers: bool,
296
- page_header_prefix: str,
297
- page_header_suffix: str,
298
- page_footer_prefix: str,
299
- page_footer_suffix: str,
300
- ) -> ParsingJob:
301
- """
302
- Parameters:
303
- - organization_id: typing.Optional[str].
304
-
305
- - project_id: typing.Optional[str].
306
-
307
- - file: typing.Optional[str].
308
-
309
- - adaptive_long_table: bool.
310
-
311
- - annotate_links: bool.
312
-
313
- - auto_mode: bool.
314
-
315
- - auto_mode_trigger_on_image_in_page: bool.
316
-
317
- - auto_mode_trigger_on_table_in_page: bool.
318
-
319
- - auto_mode_trigger_on_text_in_page: str.
320
-
321
- - auto_mode_trigger_on_regexp_in_page: str.
322
-
323
- - auto_mode_configuration_json: str.
324
-
325
- - azure_openai_api_version: str.
326
-
327
- - azure_openai_deployment_name: str.
328
-
329
- - azure_openai_endpoint: str.
330
-
331
- - azure_openai_key: str.
332
-
333
- - bbox_bottom: float.
334
-
335
- - bbox_left: float.
336
-
337
- - bbox_right: float.
338
-
339
- - bbox_top: float.
340
-
341
- - compact_markdown_table: bool.
342
-
343
- - disable_ocr: bool.
344
-
345
- - disable_reconstruction: bool.
346
-
347
- - disable_image_extraction: bool.
348
-
349
- - do_not_cache: bool.
350
-
351
- - do_not_unroll_columns: bool.
352
-
353
- - extract_charts: bool.
354
-
355
- - guess_xlsx_sheet_name: bool.
356
-
357
- - high_res_ocr: bool.
358
-
359
- - html_make_all_elements_visible: bool.
360
-
361
- - layout_aware: bool.
362
-
363
- - html_remove_fixed_elements: bool.
364
-
365
- - html_remove_navigation_elements: bool.
366
-
367
- - http_proxy: str.
368
-
369
- - input_s_3_path: str.
370
-
371
- - input_s_3_region: str.
372
-
373
- - input_url: str.
374
-
375
- - invalidate_cache: bool.
376
-
377
- - language: typing.List[ParserLanguages].
378
-
379
- - extract_layout: bool.
380
-
381
- - max_pages: typing.Optional[int].
382
-
383
- - merge_tables_across_pages_in_markdown: bool.
384
-
385
- - outlined_table_extraction: bool.
386
-
387
- - output_pdf_of_document: bool.
388
-
389
- - output_s_3_path_prefix: str.
390
-
391
- - output_s_3_region: str.
392
-
393
- - page_prefix: str.
394
-
395
- - page_separator: str.
396
-
397
- - page_suffix: str.
398
-
399
- - preserve_layout_alignment_across_pages: bool.
400
-
401
- - preserve_very_small_text: bool.
402
-
403
- - skip_diagonal_text: bool.
404
-
405
- - spreadsheet_extract_sub_tables: bool.
406
-
407
- - structured_output: bool.
408
-
409
- - structured_output_json_schema: str.
410
-
411
- - structured_output_json_schema_name: str.
412
-
413
- - take_screenshot: bool.
414
-
415
- - target_pages: str.
416
-
417
- - vendor_multimodal_api_key: str.
418
-
419
- - vendor_multimodal_model_name: str.
420
-
421
- - model: str.
422
-
423
- - webhook_url: str.
424
-
425
- - webhook_configurations: str.
426
-
427
- - preset: str.
428
-
429
- - parse_mode: typing.Optional[ParsingMode].
430
-
431
- - page_error_tolerance: float.
432
-
433
- - replace_failed_page_mode: typing.Optional[FailPageMode].
434
-
435
- - replace_failed_page_with_error_message_prefix: str.
436
-
437
- - replace_failed_page_with_error_message_suffix: str.
438
-
439
- - system_prompt: str.
440
-
441
- - system_prompt_append: str.
442
-
443
- - user_prompt: str.
444
-
445
- - job_timeout_in_seconds: float.
446
-
447
- - job_timeout_extra_time_per_page_in_seconds: float.
448
-
449
- - strict_mode_image_extraction: bool.
450
-
451
- - strict_mode_image_ocr: bool.
452
-
453
- - strict_mode_reconstruction: bool.
454
-
455
- - strict_mode_buggy_font: bool.
456
-
457
- - save_images: bool.
458
-
459
- - ignore_document_elements_for_layout_detection: bool.
460
-
461
- - output_tables_as_html: bool.
462
-
463
- - markdown_table_multiline_header_separator: str.
464
-
465
- - use_vendor_multimodal_model: bool.
466
-
467
- - bounding_box: str.
468
-
469
- - gpt_4_o_mode: bool.
470
-
471
- - gpt_4_o_api_key: str.
472
-
473
- - complemental_formatting_instruction: str.
474
-
475
- - content_guideline_instruction: str.
476
-
477
- - premium_mode: bool.
478
-
479
- - is_formatting_instruction: bool.
480
-
481
- - continuous_mode: bool.
482
-
483
- - parsing_instruction: str.
484
-
485
- - fast_mode: bool.
486
-
487
- - formatting_instruction: str.
488
-
489
- - hide_headers: bool.
490
-
491
- - hide_footers: bool.
492
-
493
- - page_header_prefix: str.
494
-
495
- - page_header_suffix: str.
496
-
497
- - page_footer_prefix: str.
498
-
499
- - page_footer_suffix: str.
500
- """
501
- _request: typing.Dict[str, typing.Any] = {
502
- "adaptive_long_table": adaptive_long_table,
503
- "annotate_links": annotate_links,
504
- "auto_mode": auto_mode,
505
- "auto_mode_trigger_on_image_in_page": auto_mode_trigger_on_image_in_page,
506
- "auto_mode_trigger_on_table_in_page": auto_mode_trigger_on_table_in_page,
507
- "auto_mode_trigger_on_text_in_page": auto_mode_trigger_on_text_in_page,
508
- "auto_mode_trigger_on_regexp_in_page": auto_mode_trigger_on_regexp_in_page,
509
- "auto_mode_configuration_json": auto_mode_configuration_json,
510
- "azure_openai_api_version": azure_openai_api_version,
511
- "azure_openai_deployment_name": azure_openai_deployment_name,
512
- "azure_openai_endpoint": azure_openai_endpoint,
513
- "azure_openai_key": azure_openai_key,
514
- "bbox_bottom": bbox_bottom,
515
- "bbox_left": bbox_left,
516
- "bbox_right": bbox_right,
517
- "bbox_top": bbox_top,
518
- "compact_markdown_table": compact_markdown_table,
519
- "disable_ocr": disable_ocr,
520
- "disable_reconstruction": disable_reconstruction,
521
- "disable_image_extraction": disable_image_extraction,
522
- "do_not_cache": do_not_cache,
523
- "do_not_unroll_columns": do_not_unroll_columns,
524
- "extract_charts": extract_charts,
525
- "guess_xlsx_sheet_name": guess_xlsx_sheet_name,
526
- "high_res_ocr": high_res_ocr,
527
- "html_make_all_elements_visible": html_make_all_elements_visible,
528
- "layout_aware": layout_aware,
529
- "html_remove_fixed_elements": html_remove_fixed_elements,
530
- "html_remove_navigation_elements": html_remove_navigation_elements,
531
- "http_proxy": http_proxy,
532
- "input_s3_path": input_s_3_path,
533
- "input_s3_region": input_s_3_region,
534
- "input_url": input_url,
535
- "invalidate_cache": invalidate_cache,
536
- "language": language,
537
- "extract_layout": extract_layout,
538
- "merge_tables_across_pages_in_markdown": merge_tables_across_pages_in_markdown,
539
- "outlined_table_extraction": outlined_table_extraction,
540
- "output_pdf_of_document": output_pdf_of_document,
541
- "output_s3_path_prefix": output_s_3_path_prefix,
542
- "output_s3_region": output_s_3_region,
543
- "page_prefix": page_prefix,
544
- "page_separator": page_separator,
545
- "page_suffix": page_suffix,
546
- "preserve_layout_alignment_across_pages": preserve_layout_alignment_across_pages,
547
- "preserve_very_small_text": preserve_very_small_text,
548
- "skip_diagonal_text": skip_diagonal_text,
549
- "spreadsheet_extract_sub_tables": spreadsheet_extract_sub_tables,
550
- "structured_output": structured_output,
551
- "structured_output_json_schema": structured_output_json_schema,
552
- "structured_output_json_schema_name": structured_output_json_schema_name,
553
- "take_screenshot": take_screenshot,
554
- "target_pages": target_pages,
555
- "vendor_multimodal_api_key": vendor_multimodal_api_key,
556
- "vendor_multimodal_model_name": vendor_multimodal_model_name,
557
- "model": model,
558
- "webhook_url": webhook_url,
559
- "webhook_configurations": webhook_configurations,
560
- "preset": preset,
561
- "page_error_tolerance": page_error_tolerance,
562
- "replace_failed_page_with_error_message_prefix": replace_failed_page_with_error_message_prefix,
563
- "replace_failed_page_with_error_message_suffix": replace_failed_page_with_error_message_suffix,
564
- "system_prompt": system_prompt,
565
- "system_prompt_append": system_prompt_append,
566
- "user_prompt": user_prompt,
567
- "job_timeout_in_seconds": job_timeout_in_seconds,
568
- "job_timeout_extra_time_per_page_in_seconds": job_timeout_extra_time_per_page_in_seconds,
569
- "strict_mode_image_extraction": strict_mode_image_extraction,
570
- "strict_mode_image_ocr": strict_mode_image_ocr,
571
- "strict_mode_reconstruction": strict_mode_reconstruction,
572
- "strict_mode_buggy_font": strict_mode_buggy_font,
573
- "save_images": save_images,
574
- "ignore_document_elements_for_layout_detection": ignore_document_elements_for_layout_detection,
575
- "output_tables_as_HTML": output_tables_as_html,
576
- "markdown_table_multiline_header_separator": markdown_table_multiline_header_separator,
577
- "use_vendor_multimodal_model": use_vendor_multimodal_model,
578
- "bounding_box": bounding_box,
579
- "gpt4o_mode": gpt_4_o_mode,
580
- "gpt4o_api_key": gpt_4_o_api_key,
581
- "complemental_formatting_instruction": complemental_formatting_instruction,
582
- "content_guideline_instruction": content_guideline_instruction,
583
- "premium_mode": premium_mode,
584
- "is_formatting_instruction": is_formatting_instruction,
585
- "continuous_mode": continuous_mode,
586
- "parsing_instruction": parsing_instruction,
587
- "fast_mode": fast_mode,
588
- "formatting_instruction": formatting_instruction,
589
- "hide_headers": hide_headers,
590
- "hide_footers": hide_footers,
591
- "page_header_prefix": page_header_prefix,
592
- "page_header_suffix": page_header_suffix,
593
- "page_footer_prefix": page_footer_prefix,
594
- "page_footer_suffix": page_footer_suffix,
595
- }
596
- if file is not OMIT:
597
- _request["file"] = file
598
- if max_pages is not OMIT:
599
- _request["max_pages"] = max_pages
600
- if parse_mode is not OMIT:
601
- _request["parse_mode"] = parse_mode
602
- if replace_failed_page_mode is not OMIT:
603
- _request["replace_failed_page_mode"] = replace_failed_page_mode
604
- _response = self._client_wrapper.httpx_client.request(
605
- "POST",
606
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/upload"),
607
- params=remove_none_from_dict({"organization_id": organization_id, "project_id": project_id}),
608
- json=jsonable_encoder(_request),
609
- headers=self._client_wrapper.get_headers(),
610
- timeout=60,
611
- )
612
- if 200 <= _response.status_code < 300:
613
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
614
- if _response.status_code == 422:
615
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
616
- try:
617
- _response_json = _response.json()
618
- except JSONDecodeError:
619
- raise ApiError(status_code=_response.status_code, body=_response.text)
620
- raise ApiError(status_code=_response.status_code, body=_response_json)
621
-
622
- def get_job(self, job_id: str) -> ParsingJob:
623
- """
624
- Get a job by id
625
-
626
- Parameters:
627
- - job_id: str.
628
- ---
629
- from llama_cloud.client import LlamaCloud
630
-
631
- client = LlamaCloud(
632
- token="YOUR_TOKEN",
633
- )
634
- client.parsing.get_job(
635
- job_id="string",
636
- )
637
- """
638
- _response = self._client_wrapper.httpx_client.request(
639
- "GET",
640
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
641
- headers=self._client_wrapper.get_headers(),
642
- timeout=60,
643
- )
644
- if 200 <= _response.status_code < 300:
645
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
646
- if _response.status_code == 422:
647
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
648
- try:
649
- _response_json = _response.json()
650
- except JSONDecodeError:
651
- raise ApiError(status_code=_response.status_code, body=_response.text)
652
- raise ApiError(status_code=_response.status_code, body=_response_json)
653
-
654
- def get_job_parameters(self, job_id: str) -> typing.Any:
655
- """
656
- Get a job by id
657
-
658
- Parameters:
659
- - job_id: str.
660
- ---
661
- from llama_cloud.client import LlamaCloud
662
-
663
- client = LlamaCloud(
664
- token="YOUR_TOKEN",
665
- )
666
- client.parsing.get_job_parameters(
667
- job_id="string",
668
- )
669
- """
670
- _response = self._client_wrapper.httpx_client.request(
671
- "GET",
672
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/parameters"),
673
- headers=self._client_wrapper.get_headers(),
674
- timeout=60,
675
- )
676
- if 200 <= _response.status_code < 300:
677
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
678
- if _response.status_code == 422:
679
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
680
- try:
681
- _response_json = _response.json()
682
- except JSONDecodeError:
683
- raise ApiError(status_code=_response.status_code, body=_response.text)
684
- raise ApiError(status_code=_response.status_code, body=_response_json)
685
-
686
- def get_parsing_job_details(self, job_id: str) -> typing.Any:
687
- """
688
- Get a job by id
689
-
690
- Parameters:
691
- - job_id: str.
692
- ---
693
- from llama_cloud.client import LlamaCloud
694
-
695
- client = LlamaCloud(
696
- token="YOUR_TOKEN",
697
- )
698
- client.parsing.get_parsing_job_details(
699
- job_id="string",
700
- )
701
- """
702
- _response = self._client_wrapper.httpx_client.request(
703
- "GET",
704
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/details"),
705
- headers=self._client_wrapper.get_headers(),
706
- timeout=60,
707
- )
708
- if 200 <= _response.status_code < 300:
709
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
710
- if _response.status_code == 422:
711
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
712
- try:
713
- _response_json = _response.json()
714
- except JSONDecodeError:
715
- raise ApiError(status_code=_response.status_code, body=_response.text)
716
- raise ApiError(status_code=_response.status_code, body=_response_json)
717
-
718
- def get_job_text_result(self, job_id: str, *, organization_id: typing.Optional[str] = None) -> ParsingJobTextResult:
719
- """
720
- Get a job by id
721
-
722
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
723
- and will be removed in a future release.
724
-
725
- Parameters:
726
- - job_id: str.
727
-
728
- - organization_id: typing.Optional[str].
729
- ---
730
- from llama_cloud.client import LlamaCloud
731
-
732
- client = LlamaCloud(
733
- token="YOUR_TOKEN",
734
- )
735
- client.parsing.get_job_text_result(
736
- job_id="string",
737
- )
738
- """
739
- _response = self._client_wrapper.httpx_client.request(
740
- "GET",
741
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/text"),
742
- params=remove_none_from_dict({"organization_id": organization_id}),
743
- headers=self._client_wrapper.get_headers(),
744
- timeout=60,
745
- )
746
- if 200 <= _response.status_code < 300:
747
- return pydantic.parse_obj_as(ParsingJobTextResult, _response.json()) # type: ignore
748
- if _response.status_code == 422:
749
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
750
- try:
751
- _response_json = _response.json()
752
- except JSONDecodeError:
753
- raise ApiError(status_code=_response.status_code, body=_response.text)
754
- raise ApiError(status_code=_response.status_code, body=_response_json)
755
-
756
- def get_job_raw_text_result_raw(self, job_id: str) -> typing.Any:
757
- """
758
- Get a job by id
759
-
760
- Parameters:
761
- - job_id: str.
762
- ---
763
- from llama_cloud.client import LlamaCloud
764
-
765
- client = LlamaCloud(
766
- token="YOUR_TOKEN",
767
- )
768
- client.parsing.get_job_raw_text_result_raw(
769
- job_id="string",
770
- )
771
- """
772
- _response = self._client_wrapper.httpx_client.request(
773
- "GET",
774
- urllib.parse.urljoin(
775
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/text"
776
- ),
777
- headers=self._client_wrapper.get_headers(),
778
- timeout=60,
779
- )
780
- if 200 <= _response.status_code < 300:
781
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
782
- if _response.status_code == 422:
783
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
784
- try:
785
- _response_json = _response.json()
786
- except JSONDecodeError:
787
- raise ApiError(status_code=_response.status_code, body=_response.text)
788
- raise ApiError(status_code=_response.status_code, body=_response_json)
789
-
790
- def get_job_raw_text_result(self, job_id: str) -> typing.Any:
791
- """
792
- Get a job by id
793
-
794
- Parameters:
795
- - job_id: str.
796
- ---
797
- from llama_cloud.client import LlamaCloud
798
-
799
- client = LlamaCloud(
800
- token="YOUR_TOKEN",
801
- )
802
- client.parsing.get_job_raw_text_result(
803
- job_id="string",
804
- )
805
- """
806
- _response = self._client_wrapper.httpx_client.request(
807
- "GET",
808
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/pdf"),
809
- headers=self._client_wrapper.get_headers(),
810
- timeout=60,
811
- )
812
- if 200 <= _response.status_code < 300:
813
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
814
- if _response.status_code == 422:
815
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
816
- try:
817
- _response_json = _response.json()
818
- except JSONDecodeError:
819
- raise ApiError(status_code=_response.status_code, body=_response.text)
820
- raise ApiError(status_code=_response.status_code, body=_response_json)
821
-
822
- def get_job_raw_text_result_raw_pdf(self, job_id: str) -> typing.Any:
823
- """
824
- Get a job by id
825
-
826
- Parameters:
827
- - job_id: str.
828
- ---
829
- from llama_cloud.client import LlamaCloud
830
-
831
- client = LlamaCloud(
832
- token="YOUR_TOKEN",
833
- )
834
- client.parsing.get_job_raw_text_result_raw_pdf(
835
- job_id="string",
836
- )
837
- """
838
- _response = self._client_wrapper.httpx_client.request(
839
- "GET",
840
- urllib.parse.urljoin(
841
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/pdf"
842
- ),
843
- headers=self._client_wrapper.get_headers(),
844
- timeout=60,
845
- )
846
- if 200 <= _response.status_code < 300:
847
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
848
- if _response.status_code == 422:
849
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
850
- try:
851
- _response_json = _response.json()
852
- except JSONDecodeError:
853
- raise ApiError(status_code=_response.status_code, body=_response.text)
854
- raise ApiError(status_code=_response.status_code, body=_response_json)
855
-
856
- def get_job_structured_result(
857
- self, job_id: str, *, organization_id: typing.Optional[str] = None
858
- ) -> ParsingJobStructuredResult:
859
- """
860
- Get a job by id
861
-
862
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
863
- and will be removed in a future release.
864
-
865
- Parameters:
866
- - job_id: str.
867
-
868
- - organization_id: typing.Optional[str].
869
- ---
870
- from llama_cloud.client import LlamaCloud
871
-
872
- client = LlamaCloud(
873
- token="YOUR_TOKEN",
874
- )
875
- client.parsing.get_job_structured_result(
876
- job_id="string",
877
- )
878
- """
879
- _response = self._client_wrapper.httpx_client.request(
880
- "GET",
881
- urllib.parse.urljoin(
882
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/structured"
883
- ),
884
- params=remove_none_from_dict({"organization_id": organization_id}),
885
- headers=self._client_wrapper.get_headers(),
886
- timeout=60,
887
- )
888
- if 200 <= _response.status_code < 300:
889
- return pydantic.parse_obj_as(ParsingJobStructuredResult, _response.json()) # type: ignore
890
- if _response.status_code == 422:
891
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
892
- try:
893
- _response_json = _response.json()
894
- except JSONDecodeError:
895
- raise ApiError(status_code=_response.status_code, body=_response.text)
896
- raise ApiError(status_code=_response.status_code, body=_response_json)
897
-
898
- def get_job_raw_structured_result(self, job_id: str) -> typing.Any:
899
- """
900
- Get a job by id
901
-
902
- Parameters:
903
- - job_id: str.
904
- ---
905
- from llama_cloud.client import LlamaCloud
906
-
907
- client = LlamaCloud(
908
- token="YOUR_TOKEN",
909
- )
910
- client.parsing.get_job_raw_structured_result(
911
- job_id="string",
912
- )
913
- """
914
- _response = self._client_wrapper.httpx_client.request(
915
- "GET",
916
- urllib.parse.urljoin(
917
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/structured"
918
- ),
919
- headers=self._client_wrapper.get_headers(),
920
- timeout=60,
921
- )
922
- if 200 <= _response.status_code < 300:
923
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
924
- if _response.status_code == 422:
925
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
926
- try:
927
- _response_json = _response.json()
928
- except JSONDecodeError:
929
- raise ApiError(status_code=_response.status_code, body=_response.text)
930
- raise ApiError(status_code=_response.status_code, body=_response_json)
931
-
932
- def get_job_raw_xlsx_result(self, job_id: str) -> typing.Any:
933
- """
934
- Get a job by id
935
-
936
- Parameters:
937
- - job_id: str.
938
- ---
939
- from llama_cloud.client import LlamaCloud
940
-
941
- client = LlamaCloud(
942
- token="YOUR_TOKEN",
943
- )
944
- client.parsing.get_job_raw_xlsx_result(
945
- job_id="string",
946
- )
947
- """
948
- _response = self._client_wrapper.httpx_client.request(
949
- "GET",
950
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/xlsx"),
951
- headers=self._client_wrapper.get_headers(),
952
- timeout=60,
953
- )
954
- if 200 <= _response.status_code < 300:
955
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
956
- if _response.status_code == 422:
957
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
958
- try:
959
- _response_json = _response.json()
960
- except JSONDecodeError:
961
- raise ApiError(status_code=_response.status_code, body=_response.text)
962
- raise ApiError(status_code=_response.status_code, body=_response_json)
963
-
964
- def get_job_raw_xlsx_result_raw(self, job_id: str) -> typing.Any:
965
- """
966
- Get a job by id
967
-
968
- Parameters:
969
- - job_id: str.
970
- ---
971
- from llama_cloud.client import LlamaCloud
972
-
973
- client = LlamaCloud(
974
- token="YOUR_TOKEN",
975
- )
976
- client.parsing.get_job_raw_xlsx_result_raw(
977
- job_id="string",
978
- )
979
- """
980
- _response = self._client_wrapper.httpx_client.request(
981
- "GET",
982
- urllib.parse.urljoin(
983
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/xlsx"
984
- ),
985
- headers=self._client_wrapper.get_headers(),
986
- timeout=60,
987
- )
988
- if 200 <= _response.status_code < 300:
989
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
990
- if _response.status_code == 422:
991
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
992
- try:
993
- _response_json = _response.json()
994
- except JSONDecodeError:
995
- raise ApiError(status_code=_response.status_code, body=_response.text)
996
- raise ApiError(status_code=_response.status_code, body=_response_json)
997
-
998
- def get_job_result(self, job_id: str, *, organization_id: typing.Optional[str] = None) -> ParsingJobMarkdownResult:
999
- """
1000
- Get a job by id
1001
-
1002
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
1003
- and will be removed in a future release.
1004
-
1005
- Parameters:
1006
- - job_id: str.
1007
-
1008
- - organization_id: typing.Optional[str].
1009
- ---
1010
- from llama_cloud.client import LlamaCloud
1011
-
1012
- client = LlamaCloud(
1013
- token="YOUR_TOKEN",
1014
- )
1015
- client.parsing.get_job_result(
1016
- job_id="string",
1017
- )
1018
- """
1019
- _response = self._client_wrapper.httpx_client.request(
1020
- "GET",
1021
- urllib.parse.urljoin(
1022
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/markdown"
1023
- ),
1024
- params=remove_none_from_dict({"organization_id": organization_id}),
1025
- headers=self._client_wrapper.get_headers(),
1026
- timeout=60,
1027
- )
1028
- if 200 <= _response.status_code < 300:
1029
- return pydantic.parse_obj_as(ParsingJobMarkdownResult, _response.json()) # type: ignore
1030
- if _response.status_code == 422:
1031
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1032
- try:
1033
- _response_json = _response.json()
1034
- except JSONDecodeError:
1035
- raise ApiError(status_code=_response.status_code, body=_response.text)
1036
- raise ApiError(status_code=_response.status_code, body=_response_json)
1037
-
1038
- def get_job_raw_md_result(self, job_id: str) -> typing.Any:
1039
- """
1040
- Get a job by id
1041
-
1042
- Parameters:
1043
- - job_id: str.
1044
- ---
1045
- from llama_cloud.client import LlamaCloud
1046
-
1047
- client = LlamaCloud(
1048
- token="YOUR_TOKEN",
1049
- )
1050
- client.parsing.get_job_raw_md_result(
1051
- job_id="string",
1052
- )
1053
- """
1054
- _response = self._client_wrapper.httpx_client.request(
1055
- "GET",
1056
- urllib.parse.urljoin(
1057
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/markdown"
1058
- ),
1059
- headers=self._client_wrapper.get_headers(),
1060
- timeout=60,
1061
- )
1062
- if 200 <= _response.status_code < 300:
1063
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1064
- if _response.status_code == 422:
1065
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1066
- try:
1067
- _response_json = _response.json()
1068
- except JSONDecodeError:
1069
- raise ApiError(status_code=_response.status_code, body=_response.text)
1070
- raise ApiError(status_code=_response.status_code, body=_response_json)
1071
-
1072
- def get_job_json_result(self, job_id: str, *, organization_id: typing.Optional[str] = None) -> ParsingJobJsonResult:
1073
- """
1074
- Get a job by id
1075
-
1076
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
1077
- and will be removed in a future release.
1078
-
1079
- Parameters:
1080
- - job_id: str.
1081
-
1082
- - organization_id: typing.Optional[str].
1083
- ---
1084
- from llama_cloud.client import LlamaCloud
1085
-
1086
- client = LlamaCloud(
1087
- token="YOUR_TOKEN",
1088
- )
1089
- client.parsing.get_job_json_result(
1090
- job_id="string",
1091
- )
1092
- """
1093
- _response = self._client_wrapper.httpx_client.request(
1094
- "GET",
1095
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/json"),
1096
- params=remove_none_from_dict({"organization_id": organization_id}),
1097
- headers=self._client_wrapper.get_headers(),
1098
- timeout=60,
1099
- )
1100
- if 200 <= _response.status_code < 300:
1101
- return pydantic.parse_obj_as(ParsingJobJsonResult, _response.json()) # type: ignore
1102
- if _response.status_code == 422:
1103
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1104
- try:
1105
- _response_json = _response.json()
1106
- except JSONDecodeError:
1107
- raise ApiError(status_code=_response.status_code, body=_response.text)
1108
- raise ApiError(status_code=_response.status_code, body=_response_json)
1109
-
1110
- def get_job_json_raw_result(self, job_id: str) -> typing.Any:
1111
- """
1112
- Get a job by id
1113
-
1114
- Parameters:
1115
- - job_id: str.
1116
- ---
1117
- from llama_cloud.client import LlamaCloud
1118
-
1119
- client = LlamaCloud(
1120
- token="YOUR_TOKEN",
1121
- )
1122
- client.parsing.get_job_json_raw_result(
1123
- job_id="string",
1124
- )
1125
- """
1126
- _response = self._client_wrapper.httpx_client.request(
1127
- "GET",
1128
- urllib.parse.urljoin(
1129
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/json"
1130
- ),
1131
- headers=self._client_wrapper.get_headers(),
1132
- timeout=60,
1133
- )
1134
- if 200 <= _response.status_code < 300:
1135
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1136
- if _response.status_code == 422:
1137
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1138
- try:
1139
- _response_json = _response.json()
1140
- except JSONDecodeError:
1141
- raise ApiError(status_code=_response.status_code, body=_response.text)
1142
- raise ApiError(status_code=_response.status_code, body=_response_json)
1143
-
1144
- def get_parsing_history_result(self) -> typing.List[ParsingHistoryItem]:
1145
- """
1146
- Get parsing history for user
1147
-
1148
- This endpoint is deprecated.
1149
- Use /api/v1/jobs/?job_name=parsing&project_id=YOUR_PROJECT_ID instead.
1150
-
1151
- ---
1152
- from llama_cloud.client import LlamaCloud
1153
-
1154
- client = LlamaCloud(
1155
- token="YOUR_TOKEN",
1156
- )
1157
- client.parsing.get_parsing_history_result()
1158
- """
1159
- _response = self._client_wrapper.httpx_client.request(
1160
- "GET",
1161
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/history"),
1162
- headers=self._client_wrapper.get_headers(),
1163
- timeout=60,
1164
- )
1165
- if 200 <= _response.status_code < 300:
1166
- return pydantic.parse_obj_as(typing.List[ParsingHistoryItem], _response.json()) # type: ignore
1167
- if _response.status_code == 422:
1168
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1169
- try:
1170
- _response_json = _response.json()
1171
- except JSONDecodeError:
1172
- raise ApiError(status_code=_response.status_code, body=_response.text)
1173
- raise ApiError(status_code=_response.status_code, body=_response_json)
1174
-
1175
- def generate_presigned_url(self, job_id: str, filename: str) -> PresignedUrl:
1176
- """
1177
- Generate a presigned URL for a job
1178
-
1179
- Parameters:
1180
- - job_id: str.
1181
-
1182
- - filename: str.
1183
- ---
1184
- from llama_cloud.client import LlamaCloud
1185
-
1186
- client = LlamaCloud(
1187
- token="YOUR_TOKEN",
1188
- )
1189
- client.parsing.generate_presigned_url(
1190
- job_id="string",
1191
- filename="string",
1192
- )
1193
- """
1194
- _response = self._client_wrapper.httpx_client.request(
1195
- "GET",
1196
- urllib.parse.urljoin(
1197
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/read/{filename}"
1198
- ),
1199
- headers=self._client_wrapper.get_headers(),
1200
- timeout=60,
1201
- )
1202
- if 200 <= _response.status_code < 300:
1203
- return pydantic.parse_obj_as(PresignedUrl, _response.json()) # type: ignore
1204
- if _response.status_code == 422:
1205
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1206
- try:
1207
- _response_json = _response.json()
1208
- except JSONDecodeError:
1209
- raise ApiError(status_code=_response.status_code, body=_response.text)
1210
- raise ApiError(status_code=_response.status_code, body=_response_json)
1211
-
1212
-
1213
- class AsyncParsingClient:
1214
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
1215
- self._client_wrapper = client_wrapper
1216
-
1217
- async def get_job_image_result(self, job_id: str, name: str) -> None:
1218
- """
1219
- Get a job by id
1220
-
1221
- Parameters:
1222
- - job_id: str.
1223
-
1224
- - name: str.
1225
- ---
1226
- from llama_cloud.client import AsyncLlamaCloud
1227
-
1228
- client = AsyncLlamaCloud(
1229
- token="YOUR_TOKEN",
1230
- )
1231
- await client.parsing.get_job_image_result(
1232
- job_id="string",
1233
- name="string",
1234
- )
1235
- """
1236
- _response = await self._client_wrapper.httpx_client.request(
1237
- "GET",
1238
- urllib.parse.urljoin(
1239
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/image/{name}"
1240
- ),
1241
- headers=self._client_wrapper.get_headers(),
1242
- timeout=60,
1243
- )
1244
- if 200 <= _response.status_code < 300:
1245
- return
1246
- if _response.status_code == 422:
1247
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1248
- try:
1249
- _response_json = _response.json()
1250
- except JSONDecodeError:
1251
- raise ApiError(status_code=_response.status_code, body=_response.text)
1252
- raise ApiError(status_code=_response.status_code, body=_response_json)
1253
-
1254
- async def get_supported_file_extensions(self) -> typing.List[LlamaParseSupportedFileExtensions]:
1255
- """
1256
- Get a list of supported file extensions
1257
-
1258
- ---
1259
- from llama_cloud.client import AsyncLlamaCloud
1260
-
1261
- client = AsyncLlamaCloud(
1262
- token="YOUR_TOKEN",
1263
- )
1264
- await client.parsing.get_supported_file_extensions()
1265
- """
1266
- _response = await self._client_wrapper.httpx_client.request(
1267
- "GET",
1268
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/supported_file_extensions"),
1269
- headers=self._client_wrapper.get_headers(),
1270
- timeout=60,
1271
- )
1272
- if 200 <= _response.status_code < 300:
1273
- return pydantic.parse_obj_as(typing.List[LlamaParseSupportedFileExtensions], _response.json()) # type: ignore
1274
- try:
1275
- _response_json = _response.json()
1276
- except JSONDecodeError:
1277
- raise ApiError(status_code=_response.status_code, body=_response.text)
1278
- raise ApiError(status_code=_response.status_code, body=_response_json)
1279
-
1280
- async def screenshot(
1281
- self,
1282
- *,
1283
- organization_id: typing.Optional[str] = None,
1284
- project_id: typing.Optional[str] = None,
1285
- file: typing.Optional[str] = OMIT,
1286
- do_not_cache: bool,
1287
- http_proxy: str,
1288
- input_s_3_path: str,
1289
- input_s_3_region: str,
1290
- input_url: str,
1291
- invalidate_cache: bool,
1292
- max_pages: typing.Optional[int] = OMIT,
1293
- output_s_3_path_prefix: str,
1294
- output_s_3_region: str,
1295
- target_pages: str,
1296
- webhook_url: str,
1297
- webhook_configurations: str,
1298
- job_timeout_in_seconds: float,
1299
- job_timeout_extra_time_per_page_in_seconds: float,
1300
- ) -> ParsingJob:
1301
- """
1302
- Parameters:
1303
- - organization_id: typing.Optional[str].
1304
-
1305
- - project_id: typing.Optional[str].
1306
-
1307
- - file: typing.Optional[str].
1308
-
1309
- - do_not_cache: bool.
1310
-
1311
- - http_proxy: str.
1312
-
1313
- - input_s_3_path: str.
1314
-
1315
- - input_s_3_region: str.
1316
-
1317
- - input_url: str.
1318
-
1319
- - invalidate_cache: bool.
1320
-
1321
- - max_pages: typing.Optional[int].
1322
-
1323
- - output_s_3_path_prefix: str.
1324
-
1325
- - output_s_3_region: str.
1326
-
1327
- - target_pages: str.
1328
-
1329
- - webhook_url: str.
1330
-
1331
- - webhook_configurations: str.
1332
-
1333
- - job_timeout_in_seconds: float.
1334
-
1335
- - job_timeout_extra_time_per_page_in_seconds: float.
1336
- """
1337
- _request: typing.Dict[str, typing.Any] = {
1338
- "do_not_cache": do_not_cache,
1339
- "http_proxy": http_proxy,
1340
- "input_s3_path": input_s_3_path,
1341
- "input_s3_region": input_s_3_region,
1342
- "input_url": input_url,
1343
- "invalidate_cache": invalidate_cache,
1344
- "output_s3_path_prefix": output_s_3_path_prefix,
1345
- "output_s3_region": output_s_3_region,
1346
- "target_pages": target_pages,
1347
- "webhook_url": webhook_url,
1348
- "webhook_configurations": webhook_configurations,
1349
- "job_timeout_in_seconds": job_timeout_in_seconds,
1350
- "job_timeout_extra_time_per_page_in_seconds": job_timeout_extra_time_per_page_in_seconds,
1351
- }
1352
- if file is not OMIT:
1353
- _request["file"] = file
1354
- if max_pages is not OMIT:
1355
- _request["max_pages"] = max_pages
1356
- _response = await self._client_wrapper.httpx_client.request(
1357
- "POST",
1358
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/screenshot"),
1359
- params=remove_none_from_dict({"organization_id": organization_id, "project_id": project_id}),
1360
- json=jsonable_encoder(_request),
1361
- headers=self._client_wrapper.get_headers(),
1362
- timeout=60,
1363
- )
1364
- if 200 <= _response.status_code < 300:
1365
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
1366
- if _response.status_code == 422:
1367
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1368
- try:
1369
- _response_json = _response.json()
1370
- except JSONDecodeError:
1371
- raise ApiError(status_code=_response.status_code, body=_response.text)
1372
- raise ApiError(status_code=_response.status_code, body=_response_json)
1373
-
1374
- async def upload_file(
1375
- self,
1376
- *,
1377
- organization_id: typing.Optional[str] = None,
1378
- project_id: typing.Optional[str] = None,
1379
- file: typing.Optional[str] = OMIT,
1380
- adaptive_long_table: bool,
1381
- annotate_links: bool,
1382
- auto_mode: bool,
1383
- auto_mode_trigger_on_image_in_page: bool,
1384
- auto_mode_trigger_on_table_in_page: bool,
1385
- auto_mode_trigger_on_text_in_page: str,
1386
- auto_mode_trigger_on_regexp_in_page: str,
1387
- auto_mode_configuration_json: str,
1388
- azure_openai_api_version: str,
1389
- azure_openai_deployment_name: str,
1390
- azure_openai_endpoint: str,
1391
- azure_openai_key: str,
1392
- bbox_bottom: float,
1393
- bbox_left: float,
1394
- bbox_right: float,
1395
- bbox_top: float,
1396
- compact_markdown_table: bool,
1397
- disable_ocr: bool,
1398
- disable_reconstruction: bool,
1399
- disable_image_extraction: bool,
1400
- do_not_cache: bool,
1401
- do_not_unroll_columns: bool,
1402
- extract_charts: bool,
1403
- guess_xlsx_sheet_name: bool,
1404
- high_res_ocr: bool,
1405
- html_make_all_elements_visible: bool,
1406
- layout_aware: bool,
1407
- html_remove_fixed_elements: bool,
1408
- html_remove_navigation_elements: bool,
1409
- http_proxy: str,
1410
- input_s_3_path: str,
1411
- input_s_3_region: str,
1412
- input_url: str,
1413
- invalidate_cache: bool,
1414
- language: typing.List[ParserLanguages],
1415
- extract_layout: bool,
1416
- max_pages: typing.Optional[int] = OMIT,
1417
- merge_tables_across_pages_in_markdown: bool,
1418
- outlined_table_extraction: bool,
1419
- output_pdf_of_document: bool,
1420
- output_s_3_path_prefix: str,
1421
- output_s_3_region: str,
1422
- page_prefix: str,
1423
- page_separator: str,
1424
- page_suffix: str,
1425
- preserve_layout_alignment_across_pages: bool,
1426
- preserve_very_small_text: bool,
1427
- skip_diagonal_text: bool,
1428
- spreadsheet_extract_sub_tables: bool,
1429
- structured_output: bool,
1430
- structured_output_json_schema: str,
1431
- structured_output_json_schema_name: str,
1432
- take_screenshot: bool,
1433
- target_pages: str,
1434
- vendor_multimodal_api_key: str,
1435
- vendor_multimodal_model_name: str,
1436
- model: str,
1437
- webhook_url: str,
1438
- webhook_configurations: str,
1439
- preset: str,
1440
- parse_mode: typing.Optional[ParsingMode] = OMIT,
1441
- page_error_tolerance: float,
1442
- replace_failed_page_mode: typing.Optional[FailPageMode] = OMIT,
1443
- replace_failed_page_with_error_message_prefix: str,
1444
- replace_failed_page_with_error_message_suffix: str,
1445
- system_prompt: str,
1446
- system_prompt_append: str,
1447
- user_prompt: str,
1448
- job_timeout_in_seconds: float,
1449
- job_timeout_extra_time_per_page_in_seconds: float,
1450
- strict_mode_image_extraction: bool,
1451
- strict_mode_image_ocr: bool,
1452
- strict_mode_reconstruction: bool,
1453
- strict_mode_buggy_font: bool,
1454
- save_images: bool,
1455
- ignore_document_elements_for_layout_detection: bool,
1456
- output_tables_as_html: bool,
1457
- markdown_table_multiline_header_separator: str,
1458
- use_vendor_multimodal_model: bool,
1459
- bounding_box: str,
1460
- gpt_4_o_mode: bool,
1461
- gpt_4_o_api_key: str,
1462
- complemental_formatting_instruction: str,
1463
- content_guideline_instruction: str,
1464
- premium_mode: bool,
1465
- is_formatting_instruction: bool,
1466
- continuous_mode: bool,
1467
- parsing_instruction: str,
1468
- fast_mode: bool,
1469
- formatting_instruction: str,
1470
- hide_headers: bool,
1471
- hide_footers: bool,
1472
- page_header_prefix: str,
1473
- page_header_suffix: str,
1474
- page_footer_prefix: str,
1475
- page_footer_suffix: str,
1476
- ) -> ParsingJob:
1477
- """
1478
- Parameters:
1479
- - organization_id: typing.Optional[str].
1480
-
1481
- - project_id: typing.Optional[str].
1482
-
1483
- - file: typing.Optional[str].
1484
-
1485
- - adaptive_long_table: bool.
1486
-
1487
- - annotate_links: bool.
1488
-
1489
- - auto_mode: bool.
1490
-
1491
- - auto_mode_trigger_on_image_in_page: bool.
1492
-
1493
- - auto_mode_trigger_on_table_in_page: bool.
1494
-
1495
- - auto_mode_trigger_on_text_in_page: str.
1496
-
1497
- - auto_mode_trigger_on_regexp_in_page: str.
1498
-
1499
- - auto_mode_configuration_json: str.
1500
-
1501
- - azure_openai_api_version: str.
1502
-
1503
- - azure_openai_deployment_name: str.
1504
-
1505
- - azure_openai_endpoint: str.
1506
-
1507
- - azure_openai_key: str.
1508
-
1509
- - bbox_bottom: float.
1510
-
1511
- - bbox_left: float.
1512
-
1513
- - bbox_right: float.
1514
-
1515
- - bbox_top: float.
1516
-
1517
- - compact_markdown_table: bool.
1518
-
1519
- - disable_ocr: bool.
1520
-
1521
- - disable_reconstruction: bool.
1522
-
1523
- - disable_image_extraction: bool.
1524
-
1525
- - do_not_cache: bool.
1526
-
1527
- - do_not_unroll_columns: bool.
1528
-
1529
- - extract_charts: bool.
1530
-
1531
- - guess_xlsx_sheet_name: bool.
1532
-
1533
- - high_res_ocr: bool.
1534
-
1535
- - html_make_all_elements_visible: bool.
1536
-
1537
- - layout_aware: bool.
1538
-
1539
- - html_remove_fixed_elements: bool.
1540
-
1541
- - html_remove_navigation_elements: bool.
1542
-
1543
- - http_proxy: str.
1544
-
1545
- - input_s_3_path: str.
1546
-
1547
- - input_s_3_region: str.
1548
-
1549
- - input_url: str.
1550
-
1551
- - invalidate_cache: bool.
1552
-
1553
- - language: typing.List[ParserLanguages].
1554
-
1555
- - extract_layout: bool.
1556
-
1557
- - max_pages: typing.Optional[int].
1558
-
1559
- - merge_tables_across_pages_in_markdown: bool.
1560
-
1561
- - outlined_table_extraction: bool.
1562
-
1563
- - output_pdf_of_document: bool.
1564
-
1565
- - output_s_3_path_prefix: str.
1566
-
1567
- - output_s_3_region: str.
1568
-
1569
- - page_prefix: str.
1570
-
1571
- - page_separator: str.
1572
-
1573
- - page_suffix: str.
1574
-
1575
- - preserve_layout_alignment_across_pages: bool.
1576
-
1577
- - preserve_very_small_text: bool.
1578
-
1579
- - skip_diagonal_text: bool.
1580
-
1581
- - spreadsheet_extract_sub_tables: bool.
1582
-
1583
- - structured_output: bool.
1584
-
1585
- - structured_output_json_schema: str.
1586
-
1587
- - structured_output_json_schema_name: str.
1588
-
1589
- - take_screenshot: bool.
1590
-
1591
- - target_pages: str.
1592
-
1593
- - vendor_multimodal_api_key: str.
1594
-
1595
- - vendor_multimodal_model_name: str.
1596
-
1597
- - model: str.
1598
-
1599
- - webhook_url: str.
1600
-
1601
- - webhook_configurations: str.
1602
-
1603
- - preset: str.
1604
-
1605
- - parse_mode: typing.Optional[ParsingMode].
1606
-
1607
- - page_error_tolerance: float.
1608
-
1609
- - replace_failed_page_mode: typing.Optional[FailPageMode].
1610
-
1611
- - replace_failed_page_with_error_message_prefix: str.
1612
-
1613
- - replace_failed_page_with_error_message_suffix: str.
1614
-
1615
- - system_prompt: str.
1616
-
1617
- - system_prompt_append: str.
1618
-
1619
- - user_prompt: str.
1620
-
1621
- - job_timeout_in_seconds: float.
1622
-
1623
- - job_timeout_extra_time_per_page_in_seconds: float.
1624
-
1625
- - strict_mode_image_extraction: bool.
1626
-
1627
- - strict_mode_image_ocr: bool.
1628
-
1629
- - strict_mode_reconstruction: bool.
1630
-
1631
- - strict_mode_buggy_font: bool.
1632
-
1633
- - save_images: bool.
1634
-
1635
- - ignore_document_elements_for_layout_detection: bool.
1636
-
1637
- - output_tables_as_html: bool.
1638
-
1639
- - markdown_table_multiline_header_separator: str.
1640
-
1641
- - use_vendor_multimodal_model: bool.
1642
-
1643
- - bounding_box: str.
1644
-
1645
- - gpt_4_o_mode: bool.
1646
-
1647
- - gpt_4_o_api_key: str.
1648
-
1649
- - complemental_formatting_instruction: str.
1650
-
1651
- - content_guideline_instruction: str.
1652
-
1653
- - premium_mode: bool.
1654
-
1655
- - is_formatting_instruction: bool.
1656
-
1657
- - continuous_mode: bool.
1658
-
1659
- - parsing_instruction: str.
1660
-
1661
- - fast_mode: bool.
1662
-
1663
- - formatting_instruction: str.
1664
-
1665
- - hide_headers: bool.
1666
-
1667
- - hide_footers: bool.
1668
-
1669
- - page_header_prefix: str.
1670
-
1671
- - page_header_suffix: str.
1672
-
1673
- - page_footer_prefix: str.
1674
-
1675
- - page_footer_suffix: str.
1676
- """
1677
- _request: typing.Dict[str, typing.Any] = {
1678
- "adaptive_long_table": adaptive_long_table,
1679
- "annotate_links": annotate_links,
1680
- "auto_mode": auto_mode,
1681
- "auto_mode_trigger_on_image_in_page": auto_mode_trigger_on_image_in_page,
1682
- "auto_mode_trigger_on_table_in_page": auto_mode_trigger_on_table_in_page,
1683
- "auto_mode_trigger_on_text_in_page": auto_mode_trigger_on_text_in_page,
1684
- "auto_mode_trigger_on_regexp_in_page": auto_mode_trigger_on_regexp_in_page,
1685
- "auto_mode_configuration_json": auto_mode_configuration_json,
1686
- "azure_openai_api_version": azure_openai_api_version,
1687
- "azure_openai_deployment_name": azure_openai_deployment_name,
1688
- "azure_openai_endpoint": azure_openai_endpoint,
1689
- "azure_openai_key": azure_openai_key,
1690
- "bbox_bottom": bbox_bottom,
1691
- "bbox_left": bbox_left,
1692
- "bbox_right": bbox_right,
1693
- "bbox_top": bbox_top,
1694
- "compact_markdown_table": compact_markdown_table,
1695
- "disable_ocr": disable_ocr,
1696
- "disable_reconstruction": disable_reconstruction,
1697
- "disable_image_extraction": disable_image_extraction,
1698
- "do_not_cache": do_not_cache,
1699
- "do_not_unroll_columns": do_not_unroll_columns,
1700
- "extract_charts": extract_charts,
1701
- "guess_xlsx_sheet_name": guess_xlsx_sheet_name,
1702
- "high_res_ocr": high_res_ocr,
1703
- "html_make_all_elements_visible": html_make_all_elements_visible,
1704
- "layout_aware": layout_aware,
1705
- "html_remove_fixed_elements": html_remove_fixed_elements,
1706
- "html_remove_navigation_elements": html_remove_navigation_elements,
1707
- "http_proxy": http_proxy,
1708
- "input_s3_path": input_s_3_path,
1709
- "input_s3_region": input_s_3_region,
1710
- "input_url": input_url,
1711
- "invalidate_cache": invalidate_cache,
1712
- "language": language,
1713
- "extract_layout": extract_layout,
1714
- "merge_tables_across_pages_in_markdown": merge_tables_across_pages_in_markdown,
1715
- "outlined_table_extraction": outlined_table_extraction,
1716
- "output_pdf_of_document": output_pdf_of_document,
1717
- "output_s3_path_prefix": output_s_3_path_prefix,
1718
- "output_s3_region": output_s_3_region,
1719
- "page_prefix": page_prefix,
1720
- "page_separator": page_separator,
1721
- "page_suffix": page_suffix,
1722
- "preserve_layout_alignment_across_pages": preserve_layout_alignment_across_pages,
1723
- "preserve_very_small_text": preserve_very_small_text,
1724
- "skip_diagonal_text": skip_diagonal_text,
1725
- "spreadsheet_extract_sub_tables": spreadsheet_extract_sub_tables,
1726
- "structured_output": structured_output,
1727
- "structured_output_json_schema": structured_output_json_schema,
1728
- "structured_output_json_schema_name": structured_output_json_schema_name,
1729
- "take_screenshot": take_screenshot,
1730
- "target_pages": target_pages,
1731
- "vendor_multimodal_api_key": vendor_multimodal_api_key,
1732
- "vendor_multimodal_model_name": vendor_multimodal_model_name,
1733
- "model": model,
1734
- "webhook_url": webhook_url,
1735
- "webhook_configurations": webhook_configurations,
1736
- "preset": preset,
1737
- "page_error_tolerance": page_error_tolerance,
1738
- "replace_failed_page_with_error_message_prefix": replace_failed_page_with_error_message_prefix,
1739
- "replace_failed_page_with_error_message_suffix": replace_failed_page_with_error_message_suffix,
1740
- "system_prompt": system_prompt,
1741
- "system_prompt_append": system_prompt_append,
1742
- "user_prompt": user_prompt,
1743
- "job_timeout_in_seconds": job_timeout_in_seconds,
1744
- "job_timeout_extra_time_per_page_in_seconds": job_timeout_extra_time_per_page_in_seconds,
1745
- "strict_mode_image_extraction": strict_mode_image_extraction,
1746
- "strict_mode_image_ocr": strict_mode_image_ocr,
1747
- "strict_mode_reconstruction": strict_mode_reconstruction,
1748
- "strict_mode_buggy_font": strict_mode_buggy_font,
1749
- "save_images": save_images,
1750
- "ignore_document_elements_for_layout_detection": ignore_document_elements_for_layout_detection,
1751
- "output_tables_as_HTML": output_tables_as_html,
1752
- "markdown_table_multiline_header_separator": markdown_table_multiline_header_separator,
1753
- "use_vendor_multimodal_model": use_vendor_multimodal_model,
1754
- "bounding_box": bounding_box,
1755
- "gpt4o_mode": gpt_4_o_mode,
1756
- "gpt4o_api_key": gpt_4_o_api_key,
1757
- "complemental_formatting_instruction": complemental_formatting_instruction,
1758
- "content_guideline_instruction": content_guideline_instruction,
1759
- "premium_mode": premium_mode,
1760
- "is_formatting_instruction": is_formatting_instruction,
1761
- "continuous_mode": continuous_mode,
1762
- "parsing_instruction": parsing_instruction,
1763
- "fast_mode": fast_mode,
1764
- "formatting_instruction": formatting_instruction,
1765
- "hide_headers": hide_headers,
1766
- "hide_footers": hide_footers,
1767
- "page_header_prefix": page_header_prefix,
1768
- "page_header_suffix": page_header_suffix,
1769
- "page_footer_prefix": page_footer_prefix,
1770
- "page_footer_suffix": page_footer_suffix,
1771
- }
1772
- if file is not OMIT:
1773
- _request["file"] = file
1774
- if max_pages is not OMIT:
1775
- _request["max_pages"] = max_pages
1776
- if parse_mode is not OMIT:
1777
- _request["parse_mode"] = parse_mode
1778
- if replace_failed_page_mode is not OMIT:
1779
- _request["replace_failed_page_mode"] = replace_failed_page_mode
1780
- _response = await self._client_wrapper.httpx_client.request(
1781
- "POST",
1782
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/upload"),
1783
- params=remove_none_from_dict({"organization_id": organization_id, "project_id": project_id}),
1784
- json=jsonable_encoder(_request),
1785
- headers=self._client_wrapper.get_headers(),
1786
- timeout=60,
1787
- )
1788
- if 200 <= _response.status_code < 300:
1789
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
1790
- if _response.status_code == 422:
1791
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1792
- try:
1793
- _response_json = _response.json()
1794
- except JSONDecodeError:
1795
- raise ApiError(status_code=_response.status_code, body=_response.text)
1796
- raise ApiError(status_code=_response.status_code, body=_response_json)
1797
-
1798
- async def get_job(self, job_id: str) -> ParsingJob:
1799
- """
1800
- Get a job by id
1801
-
1802
- Parameters:
1803
- - job_id: str.
1804
- ---
1805
- from llama_cloud.client import AsyncLlamaCloud
1806
-
1807
- client = AsyncLlamaCloud(
1808
- token="YOUR_TOKEN",
1809
- )
1810
- await client.parsing.get_job(
1811
- job_id="string",
1812
- )
1813
- """
1814
- _response = await self._client_wrapper.httpx_client.request(
1815
- "GET",
1816
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
1817
- headers=self._client_wrapper.get_headers(),
1818
- timeout=60,
1819
- )
1820
- if 200 <= _response.status_code < 300:
1821
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
1822
- if _response.status_code == 422:
1823
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1824
- try:
1825
- _response_json = _response.json()
1826
- except JSONDecodeError:
1827
- raise ApiError(status_code=_response.status_code, body=_response.text)
1828
- raise ApiError(status_code=_response.status_code, body=_response_json)
1829
-
1830
- async def get_job_parameters(self, job_id: str) -> typing.Any:
1831
- """
1832
- Get a job by id
1833
-
1834
- Parameters:
1835
- - job_id: str.
1836
- ---
1837
- from llama_cloud.client import AsyncLlamaCloud
1838
-
1839
- client = AsyncLlamaCloud(
1840
- token="YOUR_TOKEN",
1841
- )
1842
- await client.parsing.get_job_parameters(
1843
- job_id="string",
1844
- )
1845
- """
1846
- _response = await self._client_wrapper.httpx_client.request(
1847
- "GET",
1848
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/parameters"),
1849
- headers=self._client_wrapper.get_headers(),
1850
- timeout=60,
1851
- )
1852
- if 200 <= _response.status_code < 300:
1853
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1854
- if _response.status_code == 422:
1855
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1856
- try:
1857
- _response_json = _response.json()
1858
- except JSONDecodeError:
1859
- raise ApiError(status_code=_response.status_code, body=_response.text)
1860
- raise ApiError(status_code=_response.status_code, body=_response_json)
1861
-
1862
- async def get_parsing_job_details(self, job_id: str) -> typing.Any:
1863
- """
1864
- Get a job by id
1865
-
1866
- Parameters:
1867
- - job_id: str.
1868
- ---
1869
- from llama_cloud.client import AsyncLlamaCloud
1870
-
1871
- client = AsyncLlamaCloud(
1872
- token="YOUR_TOKEN",
1873
- )
1874
- await client.parsing.get_parsing_job_details(
1875
- job_id="string",
1876
- )
1877
- """
1878
- _response = await self._client_wrapper.httpx_client.request(
1879
- "GET",
1880
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/details"),
1881
- headers=self._client_wrapper.get_headers(),
1882
- timeout=60,
1883
- )
1884
- if 200 <= _response.status_code < 300:
1885
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1886
- if _response.status_code == 422:
1887
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1888
- try:
1889
- _response_json = _response.json()
1890
- except JSONDecodeError:
1891
- raise ApiError(status_code=_response.status_code, body=_response.text)
1892
- raise ApiError(status_code=_response.status_code, body=_response_json)
1893
-
1894
- async def get_job_text_result(
1895
- self, job_id: str, *, organization_id: typing.Optional[str] = None
1896
- ) -> ParsingJobTextResult:
1897
- """
1898
- Get a job by id
1899
-
1900
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
1901
- and will be removed in a future release.
1902
-
1903
- Parameters:
1904
- - job_id: str.
1905
-
1906
- - organization_id: typing.Optional[str].
1907
- ---
1908
- from llama_cloud.client import AsyncLlamaCloud
1909
-
1910
- client = AsyncLlamaCloud(
1911
- token="YOUR_TOKEN",
1912
- )
1913
- await client.parsing.get_job_text_result(
1914
- job_id="string",
1915
- )
1916
- """
1917
- _response = await self._client_wrapper.httpx_client.request(
1918
- "GET",
1919
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/text"),
1920
- params=remove_none_from_dict({"organization_id": organization_id}),
1921
- headers=self._client_wrapper.get_headers(),
1922
- timeout=60,
1923
- )
1924
- if 200 <= _response.status_code < 300:
1925
- return pydantic.parse_obj_as(ParsingJobTextResult, _response.json()) # type: ignore
1926
- if _response.status_code == 422:
1927
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1928
- try:
1929
- _response_json = _response.json()
1930
- except JSONDecodeError:
1931
- raise ApiError(status_code=_response.status_code, body=_response.text)
1932
- raise ApiError(status_code=_response.status_code, body=_response_json)
1933
-
1934
- async def get_job_raw_text_result_raw(self, job_id: str) -> typing.Any:
1935
- """
1936
- Get a job by id
1937
-
1938
- Parameters:
1939
- - job_id: str.
1940
- ---
1941
- from llama_cloud.client import AsyncLlamaCloud
1942
-
1943
- client = AsyncLlamaCloud(
1944
- token="YOUR_TOKEN",
1945
- )
1946
- await client.parsing.get_job_raw_text_result_raw(
1947
- job_id="string",
1948
- )
1949
- """
1950
- _response = await self._client_wrapper.httpx_client.request(
1951
- "GET",
1952
- urllib.parse.urljoin(
1953
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/text"
1954
- ),
1955
- headers=self._client_wrapper.get_headers(),
1956
- timeout=60,
1957
- )
1958
- if 200 <= _response.status_code < 300:
1959
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1960
- if _response.status_code == 422:
1961
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1962
- try:
1963
- _response_json = _response.json()
1964
- except JSONDecodeError:
1965
- raise ApiError(status_code=_response.status_code, body=_response.text)
1966
- raise ApiError(status_code=_response.status_code, body=_response_json)
1967
-
1968
- async def get_job_raw_text_result(self, job_id: str) -> typing.Any:
1969
- """
1970
- Get a job by id
1971
-
1972
- Parameters:
1973
- - job_id: str.
1974
- ---
1975
- from llama_cloud.client import AsyncLlamaCloud
1976
-
1977
- client = AsyncLlamaCloud(
1978
- token="YOUR_TOKEN",
1979
- )
1980
- await client.parsing.get_job_raw_text_result(
1981
- job_id="string",
1982
- )
1983
- """
1984
- _response = await self._client_wrapper.httpx_client.request(
1985
- "GET",
1986
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/pdf"),
1987
- headers=self._client_wrapper.get_headers(),
1988
- timeout=60,
1989
- )
1990
- if 200 <= _response.status_code < 300:
1991
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1992
- if _response.status_code == 422:
1993
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1994
- try:
1995
- _response_json = _response.json()
1996
- except JSONDecodeError:
1997
- raise ApiError(status_code=_response.status_code, body=_response.text)
1998
- raise ApiError(status_code=_response.status_code, body=_response_json)
1999
-
2000
- async def get_job_raw_text_result_raw_pdf(self, job_id: str) -> typing.Any:
2001
- """
2002
- Get a job by id
2003
-
2004
- Parameters:
2005
- - job_id: str.
2006
- ---
2007
- from llama_cloud.client import AsyncLlamaCloud
2008
-
2009
- client = AsyncLlamaCloud(
2010
- token="YOUR_TOKEN",
2011
- )
2012
- await client.parsing.get_job_raw_text_result_raw_pdf(
2013
- job_id="string",
2014
- )
2015
- """
2016
- _response = await self._client_wrapper.httpx_client.request(
2017
- "GET",
2018
- urllib.parse.urljoin(
2019
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/pdf"
2020
- ),
2021
- headers=self._client_wrapper.get_headers(),
2022
- timeout=60,
2023
- )
2024
- if 200 <= _response.status_code < 300:
2025
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2026
- if _response.status_code == 422:
2027
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2028
- try:
2029
- _response_json = _response.json()
2030
- except JSONDecodeError:
2031
- raise ApiError(status_code=_response.status_code, body=_response.text)
2032
- raise ApiError(status_code=_response.status_code, body=_response_json)
2033
-
2034
- async def get_job_structured_result(
2035
- self, job_id: str, *, organization_id: typing.Optional[str] = None
2036
- ) -> ParsingJobStructuredResult:
2037
- """
2038
- Get a job by id
2039
-
2040
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
2041
- and will be removed in a future release.
2042
-
2043
- Parameters:
2044
- - job_id: str.
2045
-
2046
- - organization_id: typing.Optional[str].
2047
- ---
2048
- from llama_cloud.client import AsyncLlamaCloud
2049
-
2050
- client = AsyncLlamaCloud(
2051
- token="YOUR_TOKEN",
2052
- )
2053
- await client.parsing.get_job_structured_result(
2054
- job_id="string",
2055
- )
2056
- """
2057
- _response = await self._client_wrapper.httpx_client.request(
2058
- "GET",
2059
- urllib.parse.urljoin(
2060
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/structured"
2061
- ),
2062
- params=remove_none_from_dict({"organization_id": organization_id}),
2063
- headers=self._client_wrapper.get_headers(),
2064
- timeout=60,
2065
- )
2066
- if 200 <= _response.status_code < 300:
2067
- return pydantic.parse_obj_as(ParsingJobStructuredResult, _response.json()) # type: ignore
2068
- if _response.status_code == 422:
2069
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2070
- try:
2071
- _response_json = _response.json()
2072
- except JSONDecodeError:
2073
- raise ApiError(status_code=_response.status_code, body=_response.text)
2074
- raise ApiError(status_code=_response.status_code, body=_response_json)
2075
-
2076
- async def get_job_raw_structured_result(self, job_id: str) -> typing.Any:
2077
- """
2078
- Get a job by id
2079
-
2080
- Parameters:
2081
- - job_id: str.
2082
- ---
2083
- from llama_cloud.client import AsyncLlamaCloud
2084
-
2085
- client = AsyncLlamaCloud(
2086
- token="YOUR_TOKEN",
2087
- )
2088
- await client.parsing.get_job_raw_structured_result(
2089
- job_id="string",
2090
- )
2091
- """
2092
- _response = await self._client_wrapper.httpx_client.request(
2093
- "GET",
2094
- urllib.parse.urljoin(
2095
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/structured"
2096
- ),
2097
- headers=self._client_wrapper.get_headers(),
2098
- timeout=60,
2099
- )
2100
- if 200 <= _response.status_code < 300:
2101
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2102
- if _response.status_code == 422:
2103
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2104
- try:
2105
- _response_json = _response.json()
2106
- except JSONDecodeError:
2107
- raise ApiError(status_code=_response.status_code, body=_response.text)
2108
- raise ApiError(status_code=_response.status_code, body=_response_json)
2109
-
2110
- async def get_job_raw_xlsx_result(self, job_id: str) -> typing.Any:
2111
- """
2112
- Get a job by id
2113
-
2114
- Parameters:
2115
- - job_id: str.
2116
- ---
2117
- from llama_cloud.client import AsyncLlamaCloud
2118
-
2119
- client = AsyncLlamaCloud(
2120
- token="YOUR_TOKEN",
2121
- )
2122
- await client.parsing.get_job_raw_xlsx_result(
2123
- job_id="string",
2124
- )
2125
- """
2126
- _response = await self._client_wrapper.httpx_client.request(
2127
- "GET",
2128
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/xlsx"),
2129
- headers=self._client_wrapper.get_headers(),
2130
- timeout=60,
2131
- )
2132
- if 200 <= _response.status_code < 300:
2133
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2134
- if _response.status_code == 422:
2135
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2136
- try:
2137
- _response_json = _response.json()
2138
- except JSONDecodeError:
2139
- raise ApiError(status_code=_response.status_code, body=_response.text)
2140
- raise ApiError(status_code=_response.status_code, body=_response_json)
2141
-
2142
- async def get_job_raw_xlsx_result_raw(self, job_id: str) -> typing.Any:
2143
- """
2144
- Get a job by id
2145
-
2146
- Parameters:
2147
- - job_id: str.
2148
- ---
2149
- from llama_cloud.client import AsyncLlamaCloud
2150
-
2151
- client = AsyncLlamaCloud(
2152
- token="YOUR_TOKEN",
2153
- )
2154
- await client.parsing.get_job_raw_xlsx_result_raw(
2155
- job_id="string",
2156
- )
2157
- """
2158
- _response = await self._client_wrapper.httpx_client.request(
2159
- "GET",
2160
- urllib.parse.urljoin(
2161
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/xlsx"
2162
- ),
2163
- headers=self._client_wrapper.get_headers(),
2164
- timeout=60,
2165
- )
2166
- if 200 <= _response.status_code < 300:
2167
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2168
- if _response.status_code == 422:
2169
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2170
- try:
2171
- _response_json = _response.json()
2172
- except JSONDecodeError:
2173
- raise ApiError(status_code=_response.status_code, body=_response.text)
2174
- raise ApiError(status_code=_response.status_code, body=_response_json)
2175
-
2176
- async def get_job_result(
2177
- self, job_id: str, *, organization_id: typing.Optional[str] = None
2178
- ) -> ParsingJobMarkdownResult:
2179
- """
2180
- Get a job by id
2181
-
2182
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
2183
- and will be removed in a future release.
2184
-
2185
- Parameters:
2186
- - job_id: str.
2187
-
2188
- - organization_id: typing.Optional[str].
2189
- ---
2190
- from llama_cloud.client import AsyncLlamaCloud
2191
-
2192
- client = AsyncLlamaCloud(
2193
- token="YOUR_TOKEN",
2194
- )
2195
- await client.parsing.get_job_result(
2196
- job_id="string",
2197
- )
2198
- """
2199
- _response = await self._client_wrapper.httpx_client.request(
2200
- "GET",
2201
- urllib.parse.urljoin(
2202
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/markdown"
2203
- ),
2204
- params=remove_none_from_dict({"organization_id": organization_id}),
2205
- headers=self._client_wrapper.get_headers(),
2206
- timeout=60,
2207
- )
2208
- if 200 <= _response.status_code < 300:
2209
- return pydantic.parse_obj_as(ParsingJobMarkdownResult, _response.json()) # type: ignore
2210
- if _response.status_code == 422:
2211
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2212
- try:
2213
- _response_json = _response.json()
2214
- except JSONDecodeError:
2215
- raise ApiError(status_code=_response.status_code, body=_response.text)
2216
- raise ApiError(status_code=_response.status_code, body=_response_json)
2217
-
2218
- async def get_job_raw_md_result(self, job_id: str) -> typing.Any:
2219
- """
2220
- Get a job by id
2221
-
2222
- Parameters:
2223
- - job_id: str.
2224
- ---
2225
- from llama_cloud.client import AsyncLlamaCloud
2226
-
2227
- client = AsyncLlamaCloud(
2228
- token="YOUR_TOKEN",
2229
- )
2230
- await client.parsing.get_job_raw_md_result(
2231
- job_id="string",
2232
- )
2233
- """
2234
- _response = await self._client_wrapper.httpx_client.request(
2235
- "GET",
2236
- urllib.parse.urljoin(
2237
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/markdown"
2238
- ),
2239
- headers=self._client_wrapper.get_headers(),
2240
- timeout=60,
2241
- )
2242
- if 200 <= _response.status_code < 300:
2243
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2244
- if _response.status_code == 422:
2245
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2246
- try:
2247
- _response_json = _response.json()
2248
- except JSONDecodeError:
2249
- raise ApiError(status_code=_response.status_code, body=_response.text)
2250
- raise ApiError(status_code=_response.status_code, body=_response_json)
2251
-
2252
- async def get_job_json_result(
2253
- self, job_id: str, *, organization_id: typing.Optional[str] = None
2254
- ) -> ParsingJobJsonResult:
2255
- """
2256
- Get a job by id
2257
-
2258
- Note: The 'credits_used' and 'job_credits_usage' fields in the response metadata are deprecated
2259
- and will be removed in a future release.
2260
-
2261
- Parameters:
2262
- - job_id: str.
2263
-
2264
- - organization_id: typing.Optional[str].
2265
- ---
2266
- from llama_cloud.client import AsyncLlamaCloud
2267
-
2268
- client = AsyncLlamaCloud(
2269
- token="YOUR_TOKEN",
2270
- )
2271
- await client.parsing.get_job_json_result(
2272
- job_id="string",
2273
- )
2274
- """
2275
- _response = await self._client_wrapper.httpx_client.request(
2276
- "GET",
2277
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/json"),
2278
- params=remove_none_from_dict({"organization_id": organization_id}),
2279
- headers=self._client_wrapper.get_headers(),
2280
- timeout=60,
2281
- )
2282
- if 200 <= _response.status_code < 300:
2283
- return pydantic.parse_obj_as(ParsingJobJsonResult, _response.json()) # type: ignore
2284
- if _response.status_code == 422:
2285
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2286
- try:
2287
- _response_json = _response.json()
2288
- except JSONDecodeError:
2289
- raise ApiError(status_code=_response.status_code, body=_response.text)
2290
- raise ApiError(status_code=_response.status_code, body=_response_json)
2291
-
2292
- async def get_job_json_raw_result(self, job_id: str) -> typing.Any:
2293
- """
2294
- Get a job by id
2295
-
2296
- Parameters:
2297
- - job_id: str.
2298
- ---
2299
- from llama_cloud.client import AsyncLlamaCloud
2300
-
2301
- client = AsyncLlamaCloud(
2302
- token="YOUR_TOKEN",
2303
- )
2304
- await client.parsing.get_job_json_raw_result(
2305
- job_id="string",
2306
- )
2307
- """
2308
- _response = await self._client_wrapper.httpx_client.request(
2309
- "GET",
2310
- urllib.parse.urljoin(
2311
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/result/raw/json"
2312
- ),
2313
- headers=self._client_wrapper.get_headers(),
2314
- timeout=60,
2315
- )
2316
- if 200 <= _response.status_code < 300:
2317
- return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
2318
- if _response.status_code == 422:
2319
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2320
- try:
2321
- _response_json = _response.json()
2322
- except JSONDecodeError:
2323
- raise ApiError(status_code=_response.status_code, body=_response.text)
2324
- raise ApiError(status_code=_response.status_code, body=_response_json)
2325
-
2326
- async def get_parsing_history_result(self) -> typing.List[ParsingHistoryItem]:
2327
- """
2328
- Get parsing history for user
2329
-
2330
- This endpoint is deprecated.
2331
- Use /api/v1/jobs/?job_name=parsing&project_id=YOUR_PROJECT_ID instead.
2332
-
2333
- ---
2334
- from llama_cloud.client import AsyncLlamaCloud
2335
-
2336
- client = AsyncLlamaCloud(
2337
- token="YOUR_TOKEN",
2338
- )
2339
- await client.parsing.get_parsing_history_result()
2340
- """
2341
- _response = await self._client_wrapper.httpx_client.request(
2342
- "GET",
2343
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/history"),
2344
- headers=self._client_wrapper.get_headers(),
2345
- timeout=60,
2346
- )
2347
- if 200 <= _response.status_code < 300:
2348
- return pydantic.parse_obj_as(typing.List[ParsingHistoryItem], _response.json()) # type: ignore
2349
- if _response.status_code == 422:
2350
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2351
- try:
2352
- _response_json = _response.json()
2353
- except JSONDecodeError:
2354
- raise ApiError(status_code=_response.status_code, body=_response.text)
2355
- raise ApiError(status_code=_response.status_code, body=_response_json)
2356
-
2357
- async def generate_presigned_url(self, job_id: str, filename: str) -> PresignedUrl:
2358
- """
2359
- Generate a presigned URL for a job
2360
-
2361
- Parameters:
2362
- - job_id: str.
2363
-
2364
- - filename: str.
2365
- ---
2366
- from llama_cloud.client import AsyncLlamaCloud
2367
-
2368
- client = AsyncLlamaCloud(
2369
- token="YOUR_TOKEN",
2370
- )
2371
- await client.parsing.generate_presigned_url(
2372
- job_id="string",
2373
- filename="string",
2374
- )
2375
- """
2376
- _response = await self._client_wrapper.httpx_client.request(
2377
- "GET",
2378
- urllib.parse.urljoin(
2379
- f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/read/{filename}"
2380
- ),
2381
- headers=self._client_wrapper.get_headers(),
2382
- timeout=60,
2383
- )
2384
- if 200 <= _response.status_code < 300:
2385
- return pydantic.parse_obj_as(PresignedUrl, _response.json()) # type: ignore
2386
- if _response.status_code == 422:
2387
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2388
- try:
2389
- _response_json = _response.json()
2390
- except JSONDecodeError:
2391
- raise ApiError(status_code=_response.status_code, body=_response.text)
2392
- raise ApiError(status_code=_response.status_code, body=_response_json)