Skip to content

Commit f923730

Browse files
berkecanrizaiManul from Pathway
authored andcommitted
add cache option to unstructured parser (#7653)
GitOrigin-RevId: b18a2e2449552fd5e80e13c331c52b733075fc06
1 parent ffe2fc7 commit f923730

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/pathway/xpacks/llm/parsers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ class ParseUnstructured(pw.UDF):
9191

9292
def __init__(
9393
self,
94-
mode: str = "single",
94+
mode: Literal["single", "elements", "paged"] = "single",
9595
post_processors: list[Callable] | None = None,
96+
cache_strategy: udfs.CacheStrategy | None = None,
9697
**unstructured_kwargs: Any,
9798
):
9899
with optional_imports("xpack-llm-docs"):
99100
import unstructured.partition.auto # noqa:F401
100101

101-
super().__init__()
102+
super().__init__(cache_strategy=cache_strategy)
102103
_valid_modes = {"single", "elements", "paged"}
103104
if mode not in _valid_modes:
104105
raise ValueError(

0 commit comments

Comments
 (0)