From 189d45463c757d385c51237aa754abce57b221d4 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Tue, 11 Aug 2026 13:28:42 +0530 Subject: [PATCH 1/2] fix: send LLMWhisperer V2 params under the correct names The adapter read the line splitter strategy under `line_spitter_strategy` while its JSON schema stores it as `line_splitter_strategy`, so the user's choice never applied. The same misspelling was also passed to the client, which forwarded a query param the service does not read. The page separator keeps its misspelled config key since existing adapter configs are stored under it, but is now sent under the client's corrected kwarg. Both need llmwhisperer-client 2.8.0 or newer. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG --- pyproject.toml | 2 +- .../adapters/x2text/llm_whisperer_v2/src/constants.py | 10 +++++++++- .../sdk/adapters/x2text/llm_whisperer_v2/src/helper.py | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f004a1d..7f8c4a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ dependencies = [ "httpx>=0.25.2", "pdfplumber>=0.11.2", "redis>=5.2.1", - "llmwhisperer-client>=2.5.0", + "llmwhisperer-client>=2.8.0", ] [project.optional-dependencies] diff --git a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/constants.py b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/constants.py index 8c46ead..98d203d 100644 --- a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/constants.py +++ b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/constants.py @@ -57,11 +57,12 @@ class WhispererConfig: MEDIAN_FILTER_SIZE = "median_filter_size" GAUSSIAN_BLUR_RADIUS = "gaussian_blur_radius" LINE_SPLITTER_TOLERANCE = "line_splitter_tolerance" - LINE_SPLITTER_STRATEGY = "line_spitter_strategy" + LINE_SPLITTER_STRATEGY = "line_splitter_strategy" HORIZONTAL_STRETCH_FACTOR = "horizontal_stretch_factor" PAGES_TO_EXTRACT = "pages_to_extract" MARK_VERTICAL_LINES = "mark_vertical_lines" MARK_HORIZONTAL_LINES = "mark_horizontal_lines" + # Misspelling retained: it is the key existing adapter configs are stored under PAGE_SEPARATOR = "page_seperator" URL_IN_POST = "url_in_post" TAG = "tag" @@ -77,6 +78,13 @@ class WhispererConfig: LINES = "lines" +class WhispererParam: + """Params passed to the client whose name differs from the config key.""" + + PAGE_SEPARATOR = "page_separator" + FILE_NAME = "file_name" + + class WhisperStatus: """Values returned / used by /whisper-status endpoint.""" diff --git a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py index 1e887a9..8c3f15e 100644 --- a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py +++ b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py @@ -20,6 +20,7 @@ WhispererConfig, WhispererDefaults, WhispererHeader, + WhispererParam, WhisperStatus, ) from unstract.sdk.adapters.x2text.llm_whisperer_v2.src.dto import WhispererRequestParams @@ -196,7 +197,7 @@ def get_whisperer_params( WhispererConfig.MARK_HORIZONTAL_LINES, WhispererDefaults.MARK_HORIZONTAL_LINES, ), - WhispererConfig.PAGE_SEPARATOR: config.get( + WhispererParam.PAGE_SEPARATOR: config.get( WhispererConfig.PAGE_SEPARATOR, WhispererDefaults.PAGE_SEPARATOR, ), From fa60fe8d8d4180d90aed597f2de175dad737a4cd Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Tue, 11 Aug 2026 13:29:06 +0530 Subject: [PATCH 2/2] feat: send the file name being extracted to LLMWhisperer Without it, usage reports record the service default for every Unstract-originated extraction, leaving no way to cross reference a row back to a document. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG --- src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py index 8c3f15e..1dd9bba 100644 --- a/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py +++ b/src/unstract/sdk/adapters/x2text/llm_whisperer_v2/src/helper.py @@ -245,6 +245,8 @@ def send_whisper_request( params = LLMWhispererHelper.get_whisperer_params( config=config, extra_params=extra_params ) + # Recorded against the extraction for cross referencing in usage reports + params[WhispererParam.FILE_NAME] = Path(input_file_path).name response: requests.Response try: input_file_data = BytesIO(fs.read(path=input_file_path, mode="rb"))