Skip to content

v1.1.0 - High-Performance JSON Source Generators

Choose a tag to compare

@GmausDev GmausDev released this 04 Dec 09:46
· 4 commits to main since this release

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.Parameters changed from object? to JsonElement?
    • Use JsonSerializer.SerializeToElement() to create parameter values
    • Example:
      var parameters = JsonSerializer.SerializeToElement(new { 
          type = "object", 
          properties = new { location = new { type = "string" } } 
      });

Installation

dotnet add package CompactifAI.Client --version 1.1.0

Or via Package Manager:

Install-Package CompactifAI.Client -Version 1.1.0

Full Changelog

  • Add System.Text.Json source generators for all 16 DTO types
  • Update CompactifAIClient to use source-generated context
  • Add IsTrimmable and IsAotCompatible project flags
  • Add proper AOT warning attributes to configuration-binding methods