cog
39a0ad79 - feat: add Image type for image-specific file handling

Commit
113 days ago
feat: add Image type for image-specific file handling This PR adds a new `cog.Image` type that extends `cog.Path` to provide image-specific handling in model inputs and outputs. The Image type works identically to Path but produces OpenAPI schemas with `format: "uri"` and `x-cog-type: "image"`, following the same pattern as streaming outputs that use `x-cog-array-type: "iterator"`. This allows UIs to provide image-specific widgets while correctly identifying the value as a URI. Changes: - Add Image class in cog/types.py with Pydantic v1 and v2 support - Export Image from cog package - Update AST-based OpenAPI schema generation to handle Image type - Add comprehensive unit and integration tests - Update documentation with Image type examples
Author
Parents
Loading