v1.1.0 - High-Performance JSON Source Generators
What's New
This release introduces System.Text.Json source generators for high-performance, AOT-compatible JSON serialization. This eliminates runtime reflection overhead and significantly improves API call latency.
Performance Improvements
| Improvement | Benefit |
|---|---|
| Zero-reflection serialization | 2-5ms latency reduction per API call |
| Cached type metadata | Reduced GC pressure |
| Compile-time validation | Catch property name mismatches at build time |
New Features
- AOT Compatibility - Full support for ahead-of-time compilation scenarios
- IL Trimming Support - Smaller deployment sizes with
IsTrimmable=true - Public
CompactifAIJsonContext- Advanced users can access the source-generated context directly
Breaking Changes
ToolFunction.Parameterschanged fromobject?toJsonElement?- Use
JsonSerializer.SerializeToElement()to create parameter values - Example:
var parameters = JsonSerializer.SerializeToElement(new { type = "object", properties = new { location = new { type = "string" } } });
- Use
Installation
dotnet add package CompactifAI.Client --version 1.1.0Or via Package Manager:
Install-Package CompactifAI.Client -Version 1.1.0Full Changelog
- Add System.Text.Json source generators for all 16 DTO types
- Update CompactifAIClient to use source-generated context
- Add
IsTrimmableandIsAotCompatibleproject flags - Add proper AOT warning attributes to configuration-binding methods