add TextChunker Service for AI Project ...
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using xAiApi.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace xAiApi.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// a Service for Splitting Long Texts into Overlapping Chunks
|
||||
/// which Suitable for Embedding ...
|
||||
/// </summary>
|
||||
public interface IXTextChunker
|
||||
{
|
||||
/// <summary>
|
||||
/// Split Text into Chunks ...
|
||||
/// </summary>
|
||||
/// <param name="text">Source Text</param>
|
||||
/// <param name="source">Source Name (e.g. File Name) used for Identifier</param>
|
||||
/// <returns></returns>
|
||||
IList<XTextChunk> Chunk(
|
||||
string text,
|
||||
string source = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Split Text into Chunks and Return only Texts ...
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
IList<string> ChunkTexts(
|
||||
string text
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user