Skip to content

Nutrient DWS: ask for inline formatting in the hosted Markdown - #2

Open
etienne-alby wants to merge 3 commits into
mainfrom
etienne/nutrient-dws-inline-formatting
Open

etienne-alby wants to merge 3 commits into
mainfrom
etienne/nutrient-dws-inline-formatting

Conversation

@etienne-alby

@etienne-alby etienne-alby commented Oct 22, 2026 •

Copy link
Copy Markdown

The Nutrient DWS provider now asks DWS to write bold, italic, underline, strikethrough, superscript and subscript into its Markdown. DWS leaves them out unless the request sets enableInlineFormatting, which the provider never sent. A run that grades DWS's own Markdown (body_source: "hosted") therefore scored no inline styles.

When the hosted Markdown is the graded body, the provider also asks for running headers, footers and the words inside pictures. The default graph body already keeps that text, so the two bodies are now asked for the same content and can be compared fairly.

Changes

  • In the spatial modes (structure, understand, agentic), output now carries "enableInlineFormatting": true next to includeWords.
  • With body_source: "hosted", output also carries "includeHeadersAndFooters": true and "extractWordsFromPictures": true. Both default to false in the public DWS contract.
  • The default graph body doesn't change. It is rebuilt from the elements and styled from the word flags, and none of the new options reach it. Its request is the same as before apart from enableInlineFormatting, which affects only output.markdown.
  • Text mode is unchanged. It runs on a different backend, and I haven't checked that it supports these options.

The NativeSDK Maestro benchmark uses this branch through PSPDFKit/GdPicture#3838. That PR pins PARSEBENCH_REF and makes the local DWS shim pass the options to maestrod. The pin should move to this PR's head, or to the squash commit if this PR is squash-merged.

Testing

  • New tests check the exact options each mode sends: words and inline formatting in the spatial modes, the two extra options with the hosted body (from config or NUTRIENT_DWS_BODY_SOURCE), only the Markdown format in text mode.
  • test_nutrient_dws_errors.py and test_nutrient_dws_markdown.py: 33 passed.
  • ruff check and ruff format --check pass on both changed files.
  • I didn't run the benchmark against hosted DWS. The NativeSDK CI run goes through the local shim and maestrod.

🤖 Generated with Claude Code

…WS's defaults

All five Markdown switches are in the public contract now; hosted pins the
documented defaults for the four the provider doesn't send. Move the
instruction tests above the main guard.
…e words

When output.markdown is the graded body, send includeHeadersAndFooters and extractWordsFromPictures. The graph body keeps that text, so both bodies are asked for the same content. The graph request is unchanged.
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