dwani 0.1.17__tar.gz → 0.1.18__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dwani
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Multimodal API for Indian + European languages (Chat, Vision, TTS, ASR, Translate, Docs)
5
5
  Author-email: sachin <python@dwani.ai>
6
6
  License: MIT License
@@ -67,14 +67,15 @@ def document_ocr_all(client, file_path, model="gemma3"):
67
67
  return resp.json()
68
68
 
69
69
 
70
- def document_ocr_number(client, file_path, page_number=1, model="gemma3"):
70
+ def document_ocr_number(client, file_path, page_number, model="gemma3"):
71
71
  """OCR a document (image/PDF) and return extracted text."""
72
72
  logger.debug(f"Calling document_ocr: file_path={file_path}, model={model}")
73
73
  validate_model(model)
74
74
 
75
75
  data = {"model": model,
76
- "page_number": str(page_number)}
77
-
76
+ "page_number": page_number}
77
+
78
+ params = {"model": data["model"], "page_number": data["page_number"]}
78
79
  with open(file_path, "rb") as f:
79
80
  mime_type = "application/pdf" if file_path.lower().endswith('.pdf') else "image/png"
80
81
  files = {"file": (file_path, f, mime_type)}
@@ -83,7 +84,7 @@ def document_ocr_number(client, file_path, page_number=1, model="gemma3"):
83
84
  f"{client.api_base}/v1/extract-text",
84
85
  headers=client._headers(),
85
86
  files=files,
86
- data=data,
87
+ params=params,
87
88
  timeout=60
88
89
  )
89
90
  resp.raise_for_status()
@@ -281,10 +282,10 @@ def doc_query_kannada(
281
282
 
282
283
  class Documents:
283
284
  @staticmethod
284
- def run_ocr_number(file_path, page_number=1,model="gemma3"):
285
+ def run_ocr_number(file_path, page_number=2,model="gemma3"):
285
286
  from .client import DwaniClient
286
287
  client = DwaniClient()
287
- return document_ocr_number(client, file_path, page_number=page_number, model=model)
288
+ return document_ocr_number(client, file_path, page_number, model)
288
289
  @staticmethod
289
290
  def run_ocr_all(file_path, model="gemma3"):
290
291
  from .client import DwaniClient
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "dwani"
7
7
 
8
- version = "0.1.17"
8
+ version = "0.1.18"
9
9
  description = "Multimodal API for Indian + European languages (Chat, Vision, TTS, ASR, Translate, Docs)"
10
10
  authors = [
11
11
  { name="sachin", email="python@dwani.ai" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes