morphik 0.2.5__py3-none-any.whl → 0.2.6__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.
morphik/__init__.py
CHANGED
morphik/_internal.py
CHANGED
@@ -254,6 +254,7 @@ class _MorphikClientLogic:
|
|
254
254
|
chat_id: Optional[str] = None,
|
255
255
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
256
256
|
llm_config: Optional[Dict[str, Any]] = None,
|
257
|
+
padding: int = 0,
|
257
258
|
) -> Dict[str, Any]:
|
258
259
|
"""Prepare request for query endpoint"""
|
259
260
|
payload = {
|
@@ -277,6 +278,8 @@ class _MorphikClientLogic:
|
|
277
278
|
payload["chat_id"] = chat_id
|
278
279
|
if llm_config:
|
279
280
|
payload["llm_config"] = llm_config
|
281
|
+
if padding > 0:
|
282
|
+
payload["padding"] = padding
|
280
283
|
|
281
284
|
# Add schema to payload if provided
|
282
285
|
if schema:
|
morphik/async_.py
CHANGED
@@ -359,6 +359,7 @@ class AsyncFolder:
|
|
359
359
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
360
360
|
chat_id: Optional[str] = None,
|
361
361
|
llm_config: Optional[Dict[str, Any]] = None,
|
362
|
+
padding: int = 0,
|
362
363
|
) -> CompletionResponse:
|
363
364
|
"""
|
364
365
|
Generate completion using relevant chunks as context within this folder.
|
@@ -377,6 +378,7 @@ class AsyncFolder:
|
|
377
378
|
prompt_overrides: Optional customizations for entity extraction, resolution, and query prompts
|
378
379
|
schema: Optional schema for structured output
|
379
380
|
additional_folders: Optional list of additional folder names to further scope operations
|
381
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
380
382
|
|
381
383
|
Returns:
|
382
384
|
CompletionResponse: Generated completion or structured output
|
@@ -399,6 +401,7 @@ class AsyncFolder:
|
|
399
401
|
chat_id,
|
400
402
|
schema,
|
401
403
|
llm_config,
|
404
|
+
padding,
|
402
405
|
)
|
403
406
|
|
404
407
|
# Add schema to payload if provided
|
@@ -899,6 +902,7 @@ class AsyncUserScope:
|
|
899
902
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
900
903
|
chat_id: Optional[str] = None,
|
901
904
|
llm_config: Optional[Dict[str, Any]] = None,
|
905
|
+
padding: int = 0,
|
902
906
|
) -> CompletionResponse:
|
903
907
|
"""
|
904
908
|
Generate completion using relevant chunks as context, scoped to the end user.
|
@@ -917,6 +921,7 @@ class AsyncUserScope:
|
|
917
921
|
prompt_overrides: Optional customizations for entity extraction, resolution, and query prompts
|
918
922
|
schema: Optional schema for structured output
|
919
923
|
additional_folders: Optional list of additional folder names to further scope operations
|
924
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
920
925
|
|
921
926
|
Returns:
|
922
927
|
CompletionResponse: Generated completion or structured output
|
@@ -939,6 +944,7 @@ class AsyncUserScope:
|
|
939
944
|
chat_id,
|
940
945
|
schema,
|
941
946
|
llm_config,
|
947
|
+
padding,
|
942
948
|
)
|
943
949
|
|
944
950
|
# Add schema to payload if provided
|
@@ -1568,6 +1574,7 @@ class AsyncMorphik:
|
|
1568
1574
|
chat_id: Optional[str] = None,
|
1569
1575
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
1570
1576
|
llm_config: Optional[Dict[str, Any]] = None,
|
1577
|
+
padding: int = 0,
|
1571
1578
|
) -> CompletionResponse:
|
1572
1579
|
"""
|
1573
1580
|
Generate completion using relevant chunks as context.
|
@@ -1588,6 +1595,7 @@ class AsyncMorphik:
|
|
1588
1595
|
Either a QueryPromptOverrides object or a dictionary with the same structure
|
1589
1596
|
schema: Optional schema for structured output, can be a Pydantic model or a JSON schema dict
|
1590
1597
|
llm_config: Optional LiteLLM-compatible model configuration (e.g., model name, API key, base URL)
|
1598
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
1591
1599
|
Returns:
|
1592
1600
|
CompletionResponse
|
1593
1601
|
|
@@ -1676,6 +1684,7 @@ class AsyncMorphik:
|
|
1676
1684
|
chat_id,
|
1677
1685
|
schema,
|
1678
1686
|
llm_config,
|
1687
|
+
padding,
|
1679
1688
|
)
|
1680
1689
|
|
1681
1690
|
# Add schema to payload if provided
|
morphik/sync.py
CHANGED
@@ -366,6 +366,7 @@ class Folder:
|
|
366
366
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
367
367
|
chat_id: Optional[str] = None,
|
368
368
|
llm_config: Optional[Dict[str, Any]] = None,
|
369
|
+
padding: int = 0,
|
369
370
|
) -> CompletionResponse:
|
370
371
|
"""
|
371
372
|
Generate completion using relevant chunks as context within this folder.
|
@@ -384,6 +385,7 @@ class Folder:
|
|
384
385
|
prompt_overrides: Optional customizations for entity extraction, resolution, and query prompts
|
385
386
|
additional_folders: Optional list of extra folders to include in the scope
|
386
387
|
schema: Optional schema for structured output
|
388
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
387
389
|
|
388
390
|
Returns:
|
389
391
|
CompletionResponse: Generated completion
|
@@ -406,6 +408,7 @@ class Folder:
|
|
406
408
|
chat_id,
|
407
409
|
schema,
|
408
410
|
llm_config,
|
411
|
+
padding,
|
409
412
|
)
|
410
413
|
|
411
414
|
# Add schema to payload if provided
|
@@ -942,6 +945,7 @@ class UserScope:
|
|
942
945
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
943
946
|
chat_id: Optional[str] = None,
|
944
947
|
llm_config: Optional[Dict[str, Any]] = None,
|
948
|
+
padding: int = 0,
|
945
949
|
) -> CompletionResponse:
|
946
950
|
"""
|
947
951
|
Generate completion using relevant chunks as context as this end user.
|
@@ -960,6 +964,7 @@ class UserScope:
|
|
960
964
|
prompt_overrides: Optional customizations for entity extraction, resolution, and query prompts
|
961
965
|
additional_folders: Optional list of extra folders to include in the scope
|
962
966
|
schema: Optional schema for structured output
|
967
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
963
968
|
|
964
969
|
Returns:
|
965
970
|
CompletionResponse: Generated completion
|
@@ -982,6 +987,7 @@ class UserScope:
|
|
982
987
|
chat_id,
|
983
988
|
schema,
|
984
989
|
llm_config,
|
990
|
+
padding,
|
985
991
|
)
|
986
992
|
|
987
993
|
# Add schema to payload if provided
|
@@ -1693,6 +1699,7 @@ class Morphik:
|
|
1693
1699
|
chat_id: Optional[str] = None,
|
1694
1700
|
schema: Optional[Union[Type[BaseModel], Dict[str, Any]]] = None,
|
1695
1701
|
llm_config: Optional[Dict[str, Any]] = None,
|
1702
|
+
padding: int = 0,
|
1696
1703
|
) -> CompletionResponse:
|
1697
1704
|
"""
|
1698
1705
|
Generate completion using relevant chunks as context.
|
@@ -1714,6 +1721,7 @@ class Morphik:
|
|
1714
1721
|
folder_name: Optional folder name to further scope operations
|
1715
1722
|
schema: Optional schema for structured output, can be a Pydantic model or a JSON schema dict
|
1716
1723
|
llm_config: Optional LiteLLM-compatible model configuration (e.g., model name, API key, base URL)
|
1724
|
+
padding: Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only, default: 0)
|
1717
1725
|
Returns:
|
1718
1726
|
CompletionResponse
|
1719
1727
|
|
@@ -1802,6 +1810,7 @@ class Morphik:
|
|
1802
1810
|
chat_id,
|
1803
1811
|
schema,
|
1804
1812
|
llm_config,
|
1813
|
+
padding,
|
1805
1814
|
)
|
1806
1815
|
|
1807
1816
|
# Add schema to payload if provided
|
@@ -1,10 +1,10 @@
|
|
1
|
-
morphik/__init__.py,sha256=
|
2
|
-
morphik/_internal.py,sha256=
|
3
|
-
morphik/async_.py,sha256=
|
1
|
+
morphik/__init__.py,sha256=7KPSkMj9I2u7RG8i4Yir4QW9kbsxY6LqVOOwK9lSHcU,242
|
2
|
+
morphik/_internal.py,sha256=otuoehqH-TX14SwFKLPEftfy3vT54wZIlXV7FY1OKJA,19955
|
3
|
+
morphik/async_.py,sha256=xk1S7qXKzxu5wT7IOc7Crk711PBcY5VnguWEXjgplJw,103756
|
4
4
|
morphik/exceptions.py,sha256=v4XGmfq5B0KrZEF6M1ID8A50-45-SRAQZTrXGXM6n0Q,260
|
5
5
|
morphik/models.py,sha256=kbQtPgMZmc8IwF_-S8DyjIeijntTyQsUl1PmUku6SVM,20942
|
6
6
|
morphik/rules.py,sha256=z3YUx0f_b9O7BLbsevAkyMiQg03iUjwfx6OCh7xGKF0,3344
|
7
|
-
morphik/sync.py,sha256=
|
7
|
+
morphik/sync.py,sha256=L0ZRxECsJbakWeSpDcmHb4abcYR1mcQL-9rLYAiy8_A,108085
|
8
8
|
morphik/tests/README.md,sha256=jtJDDK8cS5E4SbygFQDy7t6Y-kQwNYtZajRwVJDR62U,1069
|
9
9
|
morphik/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
morphik/tests/example_usage.py,sha256=ls8n7355q-8gY43pZLKd4SzI-01MdFeXbT8bZ4U8MCg,11561
|
@@ -13,6 +13,6 @@ morphik/tests/test_sync.py,sha256=Reqa25Q259mCr-tzWzc1RDcs5KZuDfBkJRKOyyxhDtE,13
|
|
13
13
|
morphik/tests/test_docs/sample1.txt,sha256=Fx6TElSiKdxyFeBp1iHthzHctFVZm38DrqcbdZMoidY,507
|
14
14
|
morphik/tests/test_docs/sample2.txt,sha256=PE97gPv59J27A7CSNvi_0tRBIN3Mj6pyTFElCLfs3TE,686
|
15
15
|
morphik/tests/test_docs/sample3.txt,sha256=OzrnJ_XsDUntEV0jk-ansa3_KIa6GnpvS5EVmlh6BHo,732
|
16
|
-
morphik-0.2.
|
17
|
-
morphik-0.2.
|
18
|
-
morphik-0.2.
|
16
|
+
morphik-0.2.6.dist-info/METADATA,sha256=opfrKGS_Gv4ksngVXGNk1Q8eyLlDwwz0wy7a6NmKXus,3377
|
17
|
+
morphik-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
18
|
+
morphik-0.2.6.dist-info/RECORD,,
|
File without changes
|