Skip to content

AntipromptProcessor

Namespace: LLama

AntipromptProcessor keeps track of past tokens looking for any set Anti-Prompts

1
public sealed class AntipromptProcessor

Inheritance ObjectAntipromptProcessor

Constructors

AntipromptProcessor(IEnumerable<String>)

Initializes a new instance of the AntipromptProcessor class.

1
public AntipromptProcessor(IEnumerable<string> antiprompts)

Parameters

antiprompts IEnumerable<String>
The antiprompts.

Methods

AddAntiprompt(String)

Add an antiprompt to the collection

1
public void AddAntiprompt(string antiprompt)

Parameters

antiprompt String

SetAntiprompts(IEnumerable<String>)

Overwrite all current antiprompts with a new set

1
public void SetAntiprompts(IEnumerable<string> antiprompts)

Parameters

antiprompts IEnumerable<String>

Add(String)

Add some text and check if the buffer now ends with any antiprompt

1
public bool Add(string text)

Parameters

text String

Returns

Boolean
true if the text buffer ends with any antiprompt