mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Update content decoding and validation logic
- Changed `PageNumber` in `Chunk` to nullable `int?` in `IContentDecoder` and updated related logic in `TextContentDecoder`. - Revised citation rules in `ChatService` for stricter placement and formatting. - Introduced `QuestionValidator` class with validation rules for `Question` model's `Text` property.
This commit is contained in:
@@ -5,4 +5,4 @@ public interface IContentDecoder
|
||||
Task<IEnumerable<Chunk>> DecodeAsync(Stream stream, string contentType, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public record class Chunk(int PageNumber, int IndexOnPage, string Content);
|
||||
public record class Chunk(int? PageNumber, int IndexOnPage, string Content);
|
||||
@@ -12,6 +12,6 @@ public class TextContentDecoder(IServiceProvider serviceProvider) : IContentDeco
|
||||
var content = await readStream.ReadToEndAsync(cancellationToken);
|
||||
|
||||
var paragraphs = textChunker.Split(content);
|
||||
return paragraphs.Select((text, index) => new Chunk(1, index, text)).ToList();
|
||||
return paragraphs.Select((text, index) => new Chunk(null, index, text)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user