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 835 B

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