33 lines
887 B
C#
33 lines
887 B
C#
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
|
|
);
|
|
}
|
|
}
|