| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Content types like TextContent and ImageContent have single-value Literal type fields (e.g., type: Literal["text"]) that now default automatically so users don't have to pass them explicitly. Before: TextContent(type="text", text="hello") After: TextContent(text="hello") Github-Issue: #1731
| Back | FazBrowse Home | New Git URL |
Summary
Add default values to single-value Literal type fields in content types so users don't have to pass them explicitly.
Motivation and Context
Content types like TextContent and ImageContent have single-value Literal type fields (e.g., type: Literal["text"]) that should default automatically since there's only one valid value.
Before:
After:
Fixes #1731
How Has This Been Tested?
Added regression test test_content_type_literal_defaults in tests/test_types.py covering representative types (TextContent, ImageContent, PromptReference).
Breaking Changes
None. Existing code that explicitly passes the type field will continue to work.
Types of changes
Checklist
Additional context
Affected types:
This follows the same pattern as PR #1292 which added defaults for method: Literal fields on request/notification types.