Skip to content

LW-406 [FIX] send whisper params under the names the service reads - #34

Open
chandrasekharan-zipstack wants to merge 2 commits into
mainfrom
LW-406-deprecate-misspelled-params
Open

LW-406 [FIX] send whisper params under the names the service reads#34
chandrasekharan-zipstack wants to merge 2 commits into
mainfrom
LW-406-deprecate-misspelled-params

Conversation

@chandrasekharan-zipstack

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

Copy link
Copy Markdown
Collaborator

Draft: do not merge until unstract-llm-whisperer#721 is released. This PR sends page_separator on the wire, which only works on a service build that accepts it.

What

whisper() gains line_splitter_strategy, file_name and page_separator. The existing line_spitter_strategy, filename and page_seperator still work, log a warning and raise DeprecationWarning.

Why

LW-406. Two of these params were sent under query keys the service does not read. Flask drops unknown params, so the request returned 200 and the caller believed the setting applied:

param client sent service reads effect
line_spitter_strategy line_spitter_strategy line_splitter_strategy always left-priority
filename filename file_name usage rows always sample.pdf
page_seperator page_seperator page_seperator works, but the service key itself is misspelled

Removing the old kwargs would raise TypeError in code that runs today, so they stay until a future major.

How

_resolve_deprecated_param() picks between the two spellings.

filename and page_seperator forward to their replacements. Worst case for filename is that a report shows the real filename instead of sample.pdf; page_seperator already worked, so forwarding keeps it working.

line_spitter_strategy stays dead — it warns, and its value is still not applied. Forwarding it would silently change extraction output on a patch upgrade for anyone who set mid-priority or right-priority. Callers opt in by renaming.

Passing both spellings of the same param raises LLMWhispererClientException rather than silently picking one.

New params are appended at the end of the signature so positional callers are unaffected, and the deprecated ones default to None so "passed" is distinguishable from "left at the default".

Relevant Docs

  • Docs PR updating the param tables: to follow in llmwhisperer-docs

Related Issues or PRs

  • unstract-llm-whisperer#721 — service-side page_separator support, blocks this PR
  • UN-3987 — the Unstract LLMWhisperer adapter hits the same bug independently, and will start emitting these deprecation warnings on every extraction once it picks up this release

Dependencies Versions / Env Variables

  • None

Notes on Testing

8 unit tests cover corrected names on the wire, unchanged defaults, forwarding, the dead param, and the both-spellings error.

One integration test proves line_splitter_strategy actually reaches the service: an unknown value now returns 400 Invalid line splitter strategy selected, which can only happen if the param arrives. Verified live against llmwhisperer-api.globe.unstract.com. Costs no pages — validation rejects before processing.

Not covered automatically:

  • file_namewhisper-detail does not expose document_name, so a round trip is not observable through the API. Needs a manual check of the usage report.
  • page_separator — needs #721 deployed to the test environment first.

Behaviour changes worth calling out in the release notes

  • An invalid line_splitter_strategy used to be silently ignored and now returns a hard 400.
  • file_name now reaches usage reports, which previously always recorded sample.pdf.

Screenshots

n/a

Checklist

I have read and understood the Contribution Guidelines.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG

line_spitter_strategy and filename were sent under query keys the service
does not read, so the values were silently dropped and the service defaults
were used instead. page_seperator works but is misspelled.

Adds line_splitter_strategy, file_name and page_separator. The old names are
still accepted and warn. filename and page_seperator forward to their
replacements; line_spitter_strategy does not, since applying it now would
silently change extraction output for callers who set it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
@chandrasekharan-zipstack
chandrasekharan-zipstack marked this pull request as ready for review August 11, 2026 07:49
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds corrected public parameter names and sends them under the query keys consumed by the service while retaining deprecated aliases for compatibility.

  • Resolves corrected and deprecated parameter names through a shared helper.
  • Forwards deprecated page_seperator and filename values but intentionally ignores deprecated line_spitter_strategy.
  • Adds unit coverage for defaults, forwarding, corrected wire names, and conflicts, plus an integration check for line_splitter_strategy.

Confidence Score: 5/5

The client changes appear safe to merge once the explicitly documented service-side page_separator dependency is released.

The alias resolver preserves the established defaults and intentionally documented deprecated behavior, while the corrected values are emitted under the service-facing query names and covered by focused tests.

Important Files Changed

Filename Overview
src/unstract/llmwhisperer/client_v2.py Adds alias resolution, deprecation warnings, conflict validation, and corrected service query keys without an unacknowledged actionable defect.
tests/unit/client_v2_test.py Covers corrected query keys, unchanged effective defaults, deprecated aliases, intentionally ignored input, and conflicting spellings.
tests/integration/client_v2_test.py Verifies that the corrected line-splitter key reaches the service validation path.

Reviews (1): Last reviewed commit: "test: verify line_splitter_strategy reac..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants