Files
SqlDatabaseVectorSearch/SqlDatabaseVectorSearch/ContentDecoders/TextContentDecoder.cs
T
Marco Minerva af9158873f Add support for DOCX and TXT files, update error handling
Updated README.md to reflect support for PDF, DOCX, and TXT files.
Removed commented-out code in DocxContentDecoder.cs.
Added TextContentDecoder service in Program.cs and updated exception handling middleware.
Updated document upload endpoint description in Program.cs.
Modified VectorSearchService to throw NotSupportedException for unsupported content types.
Added TextContentDecoder class in TextContentDecoder.cs.
2025-01-29 09:58:22 +01:00

13 lines
337 B
C#

namespace SqlDatabaseVectorSearch.ContentDecoders;
public class TextContentDecoder : IContentDecoder
{
public async Task<string> DecodeAsync(Stream stream, string contentType)
{
using var readStream = new StreamReader(stream);
var content = await readStream.ReadToEndAsync();
return content;
}
}