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

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