dart_json_schema_prompt 1.0.1
dart_json_schema_prompt: ^1.0.1 copied to clipboard
A powerful Dart package for creating structured prompts with JSON schema specifications and parsing AI responses into strongly-typed objects. Supports both single objects and arrays with validation.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 - 2025-01-17 #
Added #
- π Automated Publishing: Implemented trusted publishing with GitHub Actions using OIDC authentication
- π Comprehensive Documentation: Added detailed PUBLISHING.md guide for automated releases
- π CI/CD Pipeline: Multi-platform testing and validation workflows
- π Release Management: Automated GitHub releases with changelog integration
- π‘οΈ Security: Modern OIDC-based authentication (no credential secrets required)
Improved #
- π¦ Publishing Process: Streamlined from manual to fully automated releases
- π Validation: Enhanced pre-publish checks and package validation
- π Documentation: Updated publishing guides following official Dart guidelines
- β‘ Developer Experience: Simplified release process with git tag triggers
Technical #
- Updated GitHub Actions workflow to use
dart-lang/setup-dart@v1
- Implemented proper OIDC permissions for trusted publishing
- Added comprehensive troubleshooting guides for common publishing issues
- Professional Git Flow workflow implementation
- Better developer experience with clear contribution guidelines
1.0.0 - 2025-10-15 #
Added #
- Initial release of dart_json_schema_prompt package
JsonSchemaPrompt
class for creating structured prompts with JSON schema specificationsJsonSchemaParser
class for parsing and validating JSON responsesPropertyBuilder
utility class for creating property definitions- Support for object, array, and primitive data types
- Schema validation with detailed error reporting
- JSON extraction from mixed text responses (handles AI responses with extra text)
- Comprehensive error handling with custom exception types
- Support for complex nested objects and arrays
- Built-in property constraints (min/max values, enum values, etc.)
- Zero external dependencies - pure Dart implementation
Features #
- Create prompts for single objects, arrays, or arrays of objects
- Automatic JSON schema generation from property definitions
- Validate JSON responses against defined schemas
- Extract clean JSON from AI responses that may contain additional text
- Support for required fields and optional properties
- Rich property types: string, number, integer, boolean, array, object
- Property constraints: minimum/maximum values, enum validation, format specification
- Comprehensive test coverage
- Detailed documentation and examples
Developer Experience #
- Simple, intuitive API design
- Extensive documentation with real-world examples
- Complete test coverage
- Ready for pub.flutter-io.cn publication
- Example integration with AI APIs (Google Gemini, OpenAI, etc.)