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.

llama.antipromptprocessor.md 1.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # AntipromptProcessor
  2. Namespace: LLama
  3. AntipromptProcessor keeps track of past tokens looking for any set Anti-Prompts
  4. ```csharp
  5. public sealed class AntipromptProcessor
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [AntipromptProcessor](./llama.antipromptprocessor.md)
  8. ## Constructors
  9. ### **AntipromptProcessor(IEnumerable<String>)**
  10. Initializes a new instance of the [AntipromptProcessor](./llama.antipromptprocessor.md) class.
  11. ```csharp
  12. public AntipromptProcessor(IEnumerable<string> antiprompts)
  13. ```
  14. #### Parameters
  15. `antiprompts` [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  16. The antiprompts.
  17. ## Methods
  18. ### **AddAntiprompt(String)**
  19. Add an antiprompt to the collection
  20. ```csharp
  21. public void AddAntiprompt(string antiprompt)
  22. ```
  23. #### Parameters
  24. `antiprompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  25. ### **SetAntiprompts(IEnumerable&lt;String&gt;)**
  26. Overwrite all current antiprompts with a new set
  27. ```csharp
  28. public void SetAntiprompts(IEnumerable<string> antiprompts)
  29. ```
  30. #### Parameters
  31. `antiprompts` [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  32. ### **Add(String)**
  33. Add some text and check if the buffer now ends with any antiprompt
  34. ```csharp
  35. public bool Add(string text)
  36. ```
  37. #### Parameters
  38. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  39. #### Returns
  40. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  41. true if the text buffer ends with any antiprompt