docs: improve documentation for input/output types#2864
Open
markphelps wants to merge 4 commits intomainfrom
Open
docs: improve documentation for input/output types#2864markphelps wants to merge 4 commits intomainfrom
markphelps wants to merge 4 commits intomainfrom
Conversation
Rewrite the Input and output types section in docs/python.md to comprehensively document all supported types, wrapper types, and structured output patterns. Changes: - Add primitive types reference table with JSON Schema mappings - Document dict as input/output type - Document Optional with both Optional[T] and T | None syntax - Document list as both input and output type with examples - Add structured output section covering cog.BaseModel and Pydantic BaseModel - Add BaseModel field types reference table - Add type limitations section (nested generics, unions, etc.) - Fix AsyncIterator import (use typing.AsyncIterator, not cog) - Remove incorrect claim that output class must be named Output - Note that os.PathLike subclasses are accepted as cog.Path - Regenerate docs/llms.txt
Enforce baseline Markdown hygiene across tracked docs with markdownlint tasks and a CI gate, while keeping rule scope narrow to avoid broad formatting churn.
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
docs/python.mdinput/output type documentation into a complete reference with examples and limitationsdocs/llms.txtmarkdownlint-cli2in mise and CIFixes #2854
Documentation updates (
docs/python.md)Optional[T]andT | Nonelist[T](input and output)dict(opaque JSON object)cog.BaseModelBaseModelBaseModelfield typesAsyncIteratorshould be imported fromtyping(notcog)Outputos.PathLikecompatibility notesMarkdown linting/tooling updates
markdownlint-cli2as a mise-managed tool (npm:markdownlint-cli2).markdownlint-cli2.yamlwith scoped baseline rules and excludeslint:docs,lint:docs:fixfmt:docs,fmt:docs:fixnow run markdownlint-cli2lintandlint:fix*.mdfilelint-docsjoblint-docsin the finalci-completegate--fix