Enhance extract.ai schema guidance and add web search - #1142
Open
ebhills wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds richer extract.ai schema guidance, record examples, renamed instructions, and optional OpenAI web-search provenance.
Changes:
- Adds Responses API web search and per-row source metadata.
- Introduces
record_examples, metadata, and compatibility aliases. - Expands schema documentation and focused tests.
Recommended disposition: Request changes
Next steps
- PR assignee: Initialize
response_jsonbefore parsing and add a malformed-JSON response regression test. - Reviewer: Verify the fix, resolve the thread, and submit a fresh approval.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
wrangles/extract.py |
Adds web-search orchestration and API aliases. |
wrangles/openai_responses.py |
Extracts provenance from Responses results. |
wrangles/ai_definition.py |
Supports example names and notes. |
wrangles/recipe_wrangles/extract.py |
Exposes recipe options and source columns. |
tests/test_openai_extract_ai.py |
Tests transport, caching, and aliases. |
tests/test_ai_definition.py |
Tests example compilation and recipes. |
tests/recipes/wrangles/test_extract.py |
Tests recipe source-column behavior. |
tests/recipes/wrangles/test_main.py |
Validates schema documentation. |
tests/samples/extract ai judge example.wrgl.yml |
Updates sample parameter names. |
docs/extract_ai_configuration.md |
Documents instructions and examples. |
docs/examples/extract_ai/extract_ai_recipe_examples.ipynb |
Adds usage examples and web search. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if response is not None and response.ok: | ||
| try: | ||
| output_text = extract_response_text(response.json()) | ||
| response_json = response.json() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extract.airecipe schema hints so the WranglesXL editor explains the supported output schema, runtime parameters, and example formsweb_search_sourcesprovenancerecord_examplesfrom field-levelexamplesmessagesoption toinstructionsBehavior and API impact
web_search: trueenables the native Responses API web-search tool and always adds aweb_search_sourcesoutput column{title, url}; duplicates are removed while preserving source order, and rows with no sources receive an empty listweb_search_sourcesis reserved when web search is enabledrecord_examplesdescribe complete input/output recordsexamplescontinue to accept scalar or list value guidance and may also use pairedinput/outputobjectsnameandnotesinstructionssupplies guidance that applies to every input rowCompatibility
examplesremain backward compatibleexamples=remains an alias forrecord_examples=messagesremains accepted by Python and recipe execution as an alias forinstructions, but is no longer advertised in the recipe schemaValidation
72 passedacross the focused definition compiler, Responses transport, cache, web-search recipe wrapper, and schema contract testsinstructionskey with web search and returned 17 sourcesgit diff --check origin/main...HEADpassedRisk and rollback
Web search is opt-in, so existing calls do not change unless they use a renamed schema option. Source provenance is returned alongside cached extraction results and can be bypassed with
cache: falsewhen freshness is required. Rollback is the three feature commits on this branch.