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.

IGenerationControl.cs 1.1 kB

12345678910111213141516171819202122232425262728293031
  1. using LLama.Abstractions;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace LLama.Control
  6. {
  7. /// <summary>
  8. /// Control the text generation of LLama Executors.
  9. /// </summary>
  10. public interface IGenerationControl
  11. {
  12. /// <summary>
  13. /// Use the last output text to determine if the generation should stop.
  14. /// </summary>
  15. /// <param name="context"></param>
  16. /// <param name="inferenceParams"></param>
  17. /// <param name="lastOutputText"></param>
  18. /// <returns></returns>
  19. bool ShouldStopGeneration(LLamaContext context, IInferenceParams inferenceParams, string lastOutputText);
  20. /// <summary>
  21. /// Use the last output ids to determine if the generation should stop.
  22. /// </summary>
  23. /// <param name="context"></param>
  24. /// <param name="inferenceParams"></param>
  25. /// <param name="lastOutputIds"></param>
  26. /// <returns></returns>
  27. bool ShouldStopGeneration(LLamaContext context, IInferenceParams inferenceParams, IEnumerable<int> lastOutputIds);
  28. }
  29. }