mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-08 07:10:32 +00:00
31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
|
namespace Gpt4All;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Interface for text prediction services
|
|||
|
/// </summary>
|
|||
|
public interface ITextPrediction
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Get prediction results for the prompt and provided options.
|
|||
|
/// </summary>
|
|||
|
/// <param name="text">The text to complete</param>
|
|||
|
/// <param name="opts">The prediction settings</param>
|
|||
|
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
|||
|
/// <returns>The prediction result generated by the model</returns>
|
|||
|
Task<ITextPredictionResult> GetPredictionAsync(
|
|||
|
string text,
|
|||
|
PredictRequestOptions opts,
|
|||
|
CancellationToken cancellation = default);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Get streaming prediction results for the prompt and provided options.
|
|||
|
/// </summary>
|
|||
|
/// <param name="text">The text to complete</param>
|
|||
|
/// <param name="opts">The prediction settings</param>
|
|||
|
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
|||
|
/// <returns>The prediction result generated by the model</returns>
|
|||
|
Task<ITextPredictionStreamingResult> GetStreamingPredictionAsync(
|
|||
|
string text,
|
|||
|
PredictRequestOptions opts,
|
|||
|
CancellationToken cancellationToken = default);
|
|||
|
}
|