Skip to content

v1.0.4 - GenAI Integration & Quality Improvements

Latest
Compare
Choose a tag to compare
@ANcpLua ANcpLua released this 09 Sep 10:00
· 1 commit to main since this release

What's New in v1.0.4

Features

  • GenAI integration: document summarization via Google Gemini API

    • GenAIWorker background service for summarization commands
    • GeminiService with configurable retries and timeout handling
    • GenAI event streaming via Server-Sent Events (SSE)
    • New message types: GenAICommand, GenAIEvent

Dependencies

  • NEW: Polly 8.6.3 (retry policies)
  • RabbitMQ.Client 7.1.2
  • .NET 10.0 Preview 7

Configuration

Configure the Gemini API by either method.

Option 1: Environment variables (.env)

GENAI__GEMINI__APIKEY=API key from https://aistudio.google.com/app/apikey
GENAI__GEMINI__MODEL=gemini-2.0-flash
GENAI__GEMINI__MAXRETRIES=3
GENAI__GEMINI__TIMEOUTSECONDS=30

Option 2: appsettings.json

{
  "Gemini": {
    "ApiKey": "your-api-key",
    "Model": "gemini-2.0-flash",
    "MaxRetries": 3,
    "TimeoutSeconds": 30
  }
}

Note

Environment variables use double underscores (__) as hierarchy separators in .NET configuration.

Usage

// Event streaming
services.AddPaperlessRabbitMq(config, includeOcrResultStream: true, includeGenAiResultStream: true);


// Gemini Worker 
services.AddPaperlessRabbitMq(configuration);
services.AddHttpClient<ITextSummarizer, GeminiService>();
services.AddHostedService<GenAIWorker>();

Breaking Changes

None.

Contributors