Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

UN-3987 [FIX] Send LLMWhisperer V2 params under the correct names - #205

Closed
chandrasekharan-zipstack wants to merge 2 commits into
mainfrom
UN-3987-fix-line-splitter-strategy-key
Closed

UN-3987 [FIX] Send LLMWhisperer V2 params under the correct names#205
chandrasekharan-zipstack wants to merge 2 commits into
mainfrom
UN-3987-fix-line-splitter-strategy-key

Conversation

@chandrasekharan-zipstack

@chandrasekharan-zipstack chandrasekharan-zipstack commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

The LLMWhisperer V2 adapter's line splitter strategy setting has never been applied. Two breaks stacked:

  1. Config key mismatch. The adapter's JSON schema stores the choice under line_splitter_strategy, but WhispererConfig.LINE_SPLITTER_STRATEGY was "line_spitter_strategy", so config.get() never matched and the left-priority default was always used.
  2. Wrong wire param. That same misspelled key was passed as a whisper() kwarg, so the client sent query param line_spitter_strategy, which the service does not read and Flask drops silently.

Fixing either alone changes nothing.

Changes

  • LINE_SPLITTER_STRATEGY is now "line_splitter_strategy" — matches the schema key and the wire param.
  • New WhispererParam class holds the two client kwargs whose names differ from the config key. page_seperator stays as the config key (existing adapter configs in the DB are stored under it, no migration needed) but is now sent as page_separator.
  • file_name is now sent, set to the basename of the file being extracted. Previously the adapter never sent it, so every Unstract-originated row in LLMWhisperer usage reports showed the service default. Separate commit if you'd rather drop it.
  • llmwhisperer-client pinned to >=2.8.0.

Blocked on the client release

>=2.8.0 does not exist yet — it is the release that carries Zipstack/llm-whisperer-python-client#34, which adds the correctly-named line_splitter_strategy, page_separator and file_name kwargs. On an older client these kwargs raise TypeError, so this must not merge before that release. Draft until then. On un-drafting: confirm the actual version number and regenerate the lockfiles.

Ordering: unstract-llm-whisperer#721 (service accepts page_separator) → llm-whisperer-python-client#34 release → this PR.

Behaviour change to expect

The service validates the strategy and returns 400 for anything outside left-priority / right-priority / mid-priority. Previously an out-of-range value was silently ignored, so a bad stored value becomes a hard error once the value actually arrives.

Users who never touched the setting are unaffected — adapter, client and service all default to left-priority.

Verification

By inspection only. This repo has no pytest job in CI, so the regression test for the same logic lives in the monorepo's vendored copy (unstract/sdk1/tests/test_llm_whisperer_v2_params.py) — 2 tests, both pass there.

Not verified end to end: the extraction-output change needs the client release and a run against a deployed service.

Related: Zipstack/unstract#2236 — same fix in the vendored unstract/sdk1 copy.

Jira: UN-3987, LW-406

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG

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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant