Interface IConversation
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
Represents a conversation interface for interacting with a text generation model. Provides methods for submitting prompts, both synchronously and asynchronously, and allows for event handling before and after token sampling, as well as after text completion.
public interface IConversation
Properties
- MaximumCompletionTokens
Defines the maximum number of tokens (text chunks) permitted for text completion or generation.
- RepetitionPenalty
A RepetitionPenalty object specifying the rules for repetition penalties applied during text completion.
- SamplingMode
A TokenSampling object specifying the sampling strategy followed during text completion.
- StopSequences
Specifies a set of sequences for which the API will stop generating additional tokens (or text chunks). The resultant text completion will exclude any occurrence of the specified stop sequences.
- SystemPrompt
Gets or sets the system prompt that is applied to the model before processing the user's request.
Methods
- Submit(string, CancellationToken)
Submits a prompt to the text generation model and returns the result.
- SubmitAsync(string, CancellationToken)
Asynchronously submits a prompt to the text generation model and returns the result.
Events
- AfterTextCompletion
Event triggered following the execution of a text completion.
- AfterTokenSampling
Event triggered just after the generation of a token. Enables detailed modifications to be made to the token selection process via AfterTokenSamplingEventArgs.
- BeforeTokenSampling
Event triggered just before the generation of a token. Allows for precise adjustments to the token sampling process via BeforeTokenSamplingEventArgs.