You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ILLamaExecutor.cs 1.3 kB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. namespace LLama.Abstractions
  4. {
  5. /// <summary>
  6. /// A high level interface for LLama models.
  7. /// </summary>
  8. public interface ILLamaExecutor
  9. {
  10. /// <summary>
  11. /// The loaded context for this executor.
  12. /// </summary>
  13. public LLamaContext Context { get; }
  14. /// <summary>
  15. /// Infers a response from the model.
  16. /// </summary>
  17. /// <param name="text">Your prompt</param>
  18. /// <param name="inferenceParams">Any additional parameters</param>
  19. /// <param name="token">A cancellation token.</param>
  20. /// <returns></returns>
  21. IEnumerable<string> Infer(string text, IInferenceParams? inferenceParams = null, CancellationToken token = default);
  22. /// <summary>
  23. /// Asynchronously infers a response from the model.
  24. /// </summary>
  25. /// <param name="text">Your prompt</param>
  26. /// <param name="inferenceParams">Any additional parameters</param>
  27. /// <param name="token">A cancellation token.</param>
  28. /// <returns></returns>
  29. IAsyncEnumerable<string> InferAsync(string text, IInferenceParams? inferenceParams = null, CancellationToken token = default);
  30. }
  31. }