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.

ITextStreamTransform.cs 803 B

123456789101112131415161718192021222324
  1. using System.Collections.Generic;
  2. namespace LLama.Abstractions
  3. {
  4. /// <summary>
  5. /// Takes a stream of tokens and transforms them.
  6. /// </summary>
  7. public interface ITextStreamTransform
  8. {
  9. /// <summary>
  10. /// Takes a stream of tokens and transforms them, returning a new stream of tokens.
  11. /// </summary>
  12. /// <param name="tokens"></param>
  13. /// <returns></returns>
  14. IEnumerable<string> Transform(IEnumerable<string> tokens);
  15. /// <summary>
  16. /// Takes a stream of tokens and transforms them, returning a new stream of tokens asynchronously.
  17. /// </summary>
  18. /// <param name="tokens"></param>
  19. /// <returns></returns>
  20. IAsyncEnumerable<string> TransformAsync(IAsyncEnumerable<string> tokens);
  21. }
  22. }