Add Extract-AI schema authoring and General Instructions compatibility - #1184
Merged
Merged
Conversation
mborodii-prog
approved these changes
Sep 15, 2026
14 tasks
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.
Linked issue
Closes #1182.
Companion Excel changes: https://github.com/wrangleworks/WranglesXL/pull/1250.
What changes
train.extractpreviously required the legacy seven-column AI table. It now follows Excel's authoring contract, allowing the optional schema columns needed for nested objects, arrays, paired examples, and smaller valid definitions. Model updates preserve content-level AI settings while applying explicit overrides.Settings.GeneralInstructions, use General Instructions in schemas and documentation, and keepinstructionsas the Python/recipe parameter.The connector accepts
settingsand usesvariant: aiwhen creating a model. The lower-level SDK accepts a fullColumns/Data/Settingsdocument withvariant="extract-ai". Pattern-model behavior, the legacy seven-value SDK list input, and the SDK HTTP-response return contract remain supported.How it was verified
tests/connectors/test_train_extract_ai.py,tests/test_ai_definition.py, the saved-model instruction transport test intests/test_openai_extract_ai.py,TestWrangleSchema, and focused legacy train connector/SDK tests.v1.20.2and the updated reader.git diff --checkpassed.These are local, offline checks. GitHub CI and live Excel/service verification are separate release checks; no live saved models were changed by these tests.
Compatibility and risk
Only
Findis universally required at authoring time. Save-time validation preserves unknown columns, blank rows, and original cell values; runtime compilation remains stricter. A successful save does not establish that a definition will execute successfully. Updates replace the submitted schema table rather than merging omitted rows or columns back in.Saved instruction aliases are read in this order:
GeneralInstructions,AdditionalMessages,instructions,messages, ignoring case/spaces/punctuation. An explicitly present empty string, null, or empty list clears instructions. An explicit update through any alias overrides the existing setting; conflicting aliases within one supplied document use the stated precedence. Call-levelinstructionsare appended to the saved instructions and remain distinct from saved-setting overrides.New saves synchronize
GeneralInstructionsand an identicalAdditionalMessagescompatibility copy, removing other instruction aliases and preserving unrelated settings. This keeps older Python readers working without a bulk model migration or API-Core change.Rollout and rollback
Release the updated XL authoring paths first, then PY in the following release window. Reload existing Excel task panes before releasing the new Python reader: an old editor can change only
AdditionalMessagesand leave a staleGeneralInstructionsvalue, which the new reader will prefer.Before release, verify creating, editing, clearing, saving, reopening, and extracting with a disposable model. After publishing Python, separately promote the package in Lambda-Recipes and verify both Excel and recipe execution.
Keep the compatibility copy until all supported readers and writers have migrated. Reader rollback remains supported by
AdditionalMessages. If an older writer or rollback introduces conflicting copies, reconcile the intended value through an updated save path before using the new reader.Ready-for-review checklist
mainand has no merge conflictsSee the pull request workflow.