Skip to content

Polish Google + Parallel enrichment cookbook for publication - #70

Merged
georgeatparallel merged 1 commit into
mainfrom
docs/google-enrichment-cookbook
Sep 11, 2026
Merged

Polish Google + Parallel enrichment cookbook for publication#70
georgeatparallel merged 1 commit into
mainfrom
docs/google-enrichment-cookbook

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

This notebook shows how to fill missing fields in a record using web research. Starting with a company name and website, it makes one request through Google's SDK with Parallel search enabled. A second request takes the research answer and its source list and extracts a typed record. Python then checks the record before returning it to the caller.

That workflow already existed, but the tutorial started with an unrelated financial question, had no introduction, and still pointed readers toward an older REST wrapper it no longer used. Some of its claims were also stronger than its checks: “All citations verified” meant the URLs appeared in the search results, not that the sources proved the facts.

This change follows one company from input to result, with a real before-and-after example at the top. It removes the street-address field, keeps people and products as shorter extensions, and moves inline citation formatting to an optional section. The product example now includes its known official URL and asks for list price separately from discounts or trade-in offers. The README and catalog describe the same workflow, with the older client reference still available separately.

The code changes address a few ways the example could fail or return a misleading result:

  • Missing answer text, source metadata, or a parsed record now produces an explicit error. A missing parsed result previously reached code that assumed it was a valid object.
  • Record checks now reject changed input identities and citations naming nonexistent fields. Citation URLs must still match the retrieved list exactly, including the original URL scheme.
  • Inline citations now use byte offsets within the response part they belong to. Previously, offsets were applied to the combined answer and could put a marker beside the wrong text. Malformed Unicode gets a printable fallback without citation markers on that part, so altered bytes aren't used with the original offsets.
  • Requests use default sampling and thinking settings. The inherited numeric thinking-budget setting caused a 400 error during live validation; removing it let extraction complete. Notebook installs now match the package versions in the lockfile.

The checks still don't establish factual accuracy or enforce date and number formats beyond their string types. The tutorial makes that distinction explicit and asks readers to review sources before using the data.

Validation: 44 tests pass, including tests that execute the notebook's actual helper definitions for identity, missing-result, and citation failures. Ruff and notebook/catalog validation pass. A fresh run with a Parallel API key completed all ten cells with default sampling, and the saved results and cited pages were reviewed. The later Unicode fallback was tested with failing-before/passing-after regressions. Marketplace configuration is covered offline but hasn't been tested live.

Read the notebook and saved outputs.

@georgeatparallel
georgeatparallel marked this pull request as ready for review September 10, 2026 21:42
@georgeatparallel
georgeatparallel requested a review from a team September 10, 2026 21:42
@georgeatparallel
georgeatparallel merged commit 0388b10 into main Sep 11, 2026
1 check passed
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