Repository navigation
Document Python schema metadata and compatible TypedDict imports - #511
Merged
Merged
Conversation
Recover the candidate from workflow run 41493733655 and repair the explicit result type for its dynamically loaded guide schemas. Preserve the actual runtime schema and strict negative validation checks. Addresses #220 without changing runtime conversion, dependencies, or the minimum Python version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the TypedDict documentation and example-test changes.
No open issues 🎉
What changed in this PR
Documents compatible Python TypedDict imports and field metadata within the accepted scope of #220, without changing runtime behavior or dependencies.
Changes:
- Explains Python 3.11’s Pydantic import restriction and provides complete
Docand plain-string examples. - Clarifies inline-comment source requirements and explicit-metadata precedence.
- Adds deterministic tests that execute both guide examples and check exact schema output, valid values, invalid literals, and required fields.
| File | Description |
|---|---|
site/src/docs/python/basic-usage.md |
Documents compatible imports and supported field-description styles. |
python/tests/test_schema_documentation.py |
Verifies the documented examples’ schema generation and validation behavior. |
Review effort: Balanced
Tal Zaccai (TalZaccai)
approved these changes
Nov 2, 2026
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
Implement the documentation-only scope accepted for #220.
typing.TypedDict, with a complete example importingTypedDictandDocfromtyping_extensionsandAnnotated/Literalfromtyping.Docand plain-string field descriptions and explain that both document the generated schema.No runtime conversion/validation, dependency, minimum-Python-version, or blanket import migration changes. This does not duplicate the runtime work in #466.
Provenance and manual recovery
The documentation and tests originated in owner-authorized build run 41493733655, based on
81a9b902686723908a8be5ec5216bec19f5ccc64.That run completed generation and threat detection and passed 107 Python tests with 3 skipped, but strict Pyright rejected three propagated unknown types in the new test. Automated publication was correctly blocked. The owner then approved manual recovery and this separate review PR.
The sole manual code change is the explicit
TypeChatValidator[dict[str, str]]result type. The actual runtime schema argument and all negative validation assertions remain unchanged. The guide is byte-for-byte the original generated candidate. This is a manually recovered PR, not a successful automated publication; the original scan is not presented as validation of the subsequent manual edit.Validation
npm run check: 0 errors and 0 warnings.npm run buildpasses on Node 24.22.1 after restoring its existing locked dependencies.Existing contributions
Builds on the existing documentation and schema support in #237 and #364, preserves the history of #245, and retains #466 as related but separate work. Accepted scope and contributor credit are unchanged. No automatic merge or issue closure is requested.