fix file content extractor mechanism ...

This commit is contained in:
2026-10-02 00:07:58 +03:30
parent f32972b55f
commit 4521a53734
13 changed files with 157 additions and 83 deletions
@@ -0,0 +1,26 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace xAiApi.Interfaces.Extractors
{
/// <summary>
/// a Service for Extracting File Content ...
/// </summary>
public interface IXFileContentExtractor
{
/// <summary>
/// Check if this extractor supports the specified MIME type ...
/// </summary>
bool CanExtract(string mimeType);
/// <summary>
/// Extract text content from file stream ...
/// </summary>
Task<string> ExtractAsync(
Stream fileStream,
string mimeType,
CancellationToken cancellationToken = default
);
}
}
@@ -0,0 +1,5 @@
namespace xAiApi.Interfaces.Extractors
{
public interface IXPdfFileContentExtractor : IXFileContentExtractor
{ }
}
@@ -0,0 +1,5 @@
namespace xAiApi.Interfaces.Extractors
{
public interface IXPlainTextFileContentExtractor : IXFileContentExtractor
{ }
}