Skip to content

Docs sweep: standardize extraction example blocks (3.1.0 release) - #41

Merged
tyler5673 merged 2 commits into
mainfrom
chore/docs-sweep-3.1.0
Aug 12, 2026
Merged

Docs sweep: standardize extraction example blocks (3.1.0 release)#41
tyler5673 merged 2 commits into
mainfrom
chore/docs-sweep-3.1.0

Conversation

@tyler5673

Copy link
Copy Markdown
Contributor

Summary

Forward-ports the docs sweep from dx-719-python-sdk-extraction onto main ahead of the 3.1.0 release: switches the extraction parameter in three primary discoverable docs (README, docs/models/extraction.md, USAGE) to use the strict Extraction(...) model form everywhere. Adds a one-sentence teaching note on each so readers still learn the ExtractionTypedDict dict alternative.

MIGRATION.md "3.0.0 → 3.1.0" Before/after keeps both forms by design (explicitly labeled for pedagogical contrast).

Verification

  • 88 unit tests pass.
  • mypy clean across 81 source files.

Upstream

Lands on top of 0135a8b (PR #40 merge) as merge commit a90ba76. Tagged v3.1.0 after this PR merges.

tyler5673 and others added 2 commits August 12, 2026 09:32
A surface sweep flagged that three docs showed the `extraction`
parameter using a mix of two valid forms within or across code
blocks — `Extraction(extraction_mode=ExtractionMode.HIGHLIGHTS, ...)`
(the model's strict, validated form) and `extraction={"extraction_mode":
"highlights", ...}` (a dict matching `ExtractionTypedDict`). The
mixed-form presentation reads as an inconsistency to a first-time
reader, even though both forms are equivalent on the wire.

Standardized the three primary discoverable docs to the model form,
which has the most type-safety and IDE help:

* `README.md` "Page content extraction": both `you.search(...)` calls
  in the snippet now use `Extraction(...)`. Added `ExtractionFormat`
  to the import.
* `docs/models/extraction.md` Example Usage: same. Added
  `ExtractionFormat` to the import.
* `USAGE.md` `<!-- extraction -->` snippet: switched the single
  `you.search(...)` call from dict form to `Extraction(...)`,
  matching the README + docs page. Imports updated.

`MIGRATION.md` "3.0.0 → 3.1.0" Before/after keeps both forms by
design — the section is explicitly labeled "After (3.1.0): extraction"
(model) and then "Or as a plain dict (the SDK normalizes at the
method layer)" (dict) as a teaching comparison. Left as-is.

Each of the standardized docs gets one added sentence in the prose
("You can also pass a dict matching `ExtractionTypedDict`; the SDK
normalizes at the method layer.") so callers still learn the
alternative form without copy/paste confusion.

Verified locally:
* 88 unit tests pass (extraction, search, param_normalization, shims).
* mypy clean across 81 source files.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-droid

factory-droid Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Droid finished @tyler5673's task —— View job


Review complete.

Docs updates look good and the examples remain copy-paste runnable with timeout_ms. One README sentence is misleading about dict normalization for ExtractionTypedDict and could cause avoidable ValidationErrors.

@tyler5673
tyler5673 merged commit b7eb08a into main Aug 12, 2026
7 checks passed
Comment thread README.md
Comment on lines +131 to +132
You can also pass a dict matching `ExtractionTypedDict` — the SDK
normalizes at the method layer. `extraction` replaces the deprecated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Fix misleading “normalizes” claim for ExtractionTypedDict

The README currently says the SDK “normalizes at the method layer”, but the implementation validates via Extraction.model_validate(...) and does not perform casing normalization, so dict inputs must use the exact enum value spellings (e.g., "full_page", "markdown") or enums or callers will hit a ValidationError.

Suggested change
You can also pass a dict matching `ExtractionTypedDict` — the SDK
normalizes at the method layer. `extraction` replaces the deprecated
You can also pass a dict matching `ExtractionTypedDict` — the SDK
validates it via Pydantic (strings must match the enum values). `extraction` replaces the deprecated

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.

1 participant