Skip to content

Commit a3d6788

Browse files
authored
Update README.md
1 parent b4cc852 commit a3d6788

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# SWEN3.Paperless.RabbitMq
77

8-
RabbitMQ messaging library for .NET with SSE support.
8+
RabbitMQ messaging library for .NET with SSE support and AI-powered document summarization.
99

1010
## Configuration
1111

@@ -30,7 +30,7 @@ RabbitMQ messaging library for .NET with SSE support.
3030
builder.Services.AddPaperlessRabbitMq(builder.Configuration);
3131

3232
// With SSE support
33-
builder.Services.AddPaperlessRabbitMq(configuration, includeOcrResultStream: true);
33+
services.AddPaperlessRabbitMq(config, includeOcrResultStream: true, includeGenAiResultStream: true);
3434
```
3535

3636
### Publishing
@@ -76,11 +76,37 @@ eventSource.addEventListener('ocr-completed', (event) => {
7676
});
7777
```
7878

79+
### GenAI Support (v1.0.4+)
80+
81+
```csharp
82+
// Enable GenAI features
83+
builder.Services.AddPaperlessRabbitMq(configuration,
84+
includeOcrResultStream: true,
85+
includeGenAiResultStream: true);
86+
87+
// Configure Gemini
88+
builder.Services.Configure<GeminiOptions>(configuration.GetSection("Gemini"));
89+
builder.Services.AddHttpClient<ITextSummarizer, GeminiService>();
90+
builder.Services.AddHostedService<GenAIWorker>();
91+
92+
// Publish GenAI command
93+
var genAiCommand = new GenAICommand(request.JobId, result.Text!);
94+
await _publisher.PublishGenAICommandAsync(genAiCommand);
95+
{
96+
"Gemini": {
97+
"ApiKey": "your-api-key",
98+
"Model": "gemini-2.0-flash"
99+
}
100+
}
101+
```
102+
79103
## Message Types
80104

81105
```csharp
82106
public record OcrCommand(Guid JobId, string FileName, string FilePath);
83107
public record OcrEvent(Guid JobId, string Status, string? Text, DateTimeOffset ProcessedAt);
108+
public record GenAICommand(Guid DocumentId, string Text);
109+
public record GenAIEvent(Guid DocumentId, string? Summary, DateTimeOffset ProcessedAt, string? ErrorMessage = null);
84110
```
85111

86112
## Installation

0 commit comments

Comments
 (0)