parallex 0.3.1__tar.gz → 0.3.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {parallex-0.3.1 → parallex-0.3.2}/PKG-INFO +1 -1
  2. {parallex-0.3.1 → parallex-0.3.2}/parallex/ai/open_ai_client.py +1 -0
  3. {parallex-0.3.1 → parallex-0.3.2}/parallex/parallex.py +5 -2
  4. {parallex-0.3.1 → parallex-0.3.2}/pyproject.toml +1 -1
  5. {parallex-0.3.1 → parallex-0.3.2}/LICENSE +0 -0
  6. {parallex-0.3.1 → parallex-0.3.2}/README.md +0 -0
  7. {parallex-0.3.1 → parallex-0.3.2}/parallex/__init__.py +0 -0
  8. {parallex-0.3.1 → parallex-0.3.2}/parallex/ai/batch_processor.py +0 -0
  9. {parallex-0.3.1 → parallex-0.3.2}/parallex/ai/output_processor.py +0 -0
  10. {parallex-0.3.1 → parallex-0.3.2}/parallex/ai/uploader.py +0 -0
  11. {parallex-0.3.1 → parallex-0.3.2}/parallex/file_management/converter.py +0 -0
  12. {parallex-0.3.1 → parallex-0.3.2}/parallex/file_management/file_finder.py +0 -0
  13. {parallex-0.3.1 → parallex-0.3.2}/parallex/file_management/remote_file_handler.py +0 -0
  14. {parallex-0.3.1 → parallex-0.3.2}/parallex/file_management/utils.py +0 -0
  15. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/batch_file.py +0 -0
  16. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/image_file.py +0 -0
  17. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/page_response.py +0 -0
  18. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/parallex_callable_output.py +0 -0
  19. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/parallex_prompts_callable_output.py +0 -0
  20. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/prompt_response.py +0 -0
  21. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/raw_file.py +0 -0
  22. {parallex-0.3.1 → parallex-0.3.2}/parallex/models/upload_batch.py +0 -0
  23. {parallex-0.3.1 → parallex-0.3.2}/parallex/utils/constants.py +0 -0
  24. {parallex-0.3.1 → parallex-0.3.2}/parallex/utils/logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parallex
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: PDF to markdown using Azure OpenAI batch processing
5
5
  Home-page: https://github.com/Summed-AI/parallex
6
6
  Author: Jeff Hostetler
@@ -18,6 +18,7 @@ class OpenAIClient:
18
18
  azure_endpoint=os.getenv("AZURE_API_BASE"),
19
19
  api_key=os.getenv("AZURE_API_KEY"),
20
20
  api_version=os.getenv("AZURE_API_VERSION"),
21
+ timeout=3000,
21
22
  )
22
23
 
23
24
  async def upload(self, file_path: str) -> FileObject:
@@ -106,8 +106,11 @@ async def _prompts_execute(
106
106
  process_semaphore = asyncio.Semaphore(concurrency)
107
107
  prompt_tasks = []
108
108
  for batch in batch_jobs:
109
+ logger.info(
110
+ f"waiting for batch to complete - {batch.id} - {batch.trace_id}"
111
+ )
109
112
  prompt_task = asyncio.create_task(
110
- _wait_and_create_prompt_responses(batch=batch, client=open_ai_client, semaphore=process_semaphore)
113
+ await _wait_and_create_prompt_responses(batch=batch, client=open_ai_client, semaphore=process_semaphore)
111
114
  )
112
115
  prompt_tasks.append(prompt_task)
113
116
  prompt_response_groups = await asyncio.gather(*prompt_tasks)
@@ -174,7 +177,7 @@ async def _execute(
174
177
 
175
178
  pages = [page for batch_pages in page_groups for page in batch_pages]
176
179
  logger.info(f"pages done. total pages- {len(pages)} - {trace_id}")
177
- sorted_pages = sorted(pages, key=lambda x: x.prompt_index)
180
+ sorted_pages = sorted(pages, key=lambda x: x.page_number)
178
181
 
179
182
  # TODO add combined version of MD to output / save to file system
180
183
  callable_output = ParallexCallableOutput(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "parallex"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "PDF to markdown using Azure OpenAI batch processing"
5
5
  authors = ["Jeff Hostetler <jeff@summed.ai>", "Kevin Bao <kevin@summed.ai>"]
6
6
  repository = "https://github.com/Summed-AI/parallex"
File without changes
File without changes
File without changes