Method RegenerateResponseAsync
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
RegenerateResponseAsync(CancellationToken)
Asynchronously regenerates a response to the most recent user inquiry. This does not remove the previous answer from the history; it simply replaces it with a new one.
public Task<TextGenerationResult> RegenerateResponseAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenOptional. Monitors for cancellation requests.
Returns
- Task<TextGenerationResult>
A task whose result is a TextGenerationResult with the newly generated response.
Exceptions
- InvalidOperationException
Thrown if no assistant message is found in the chat history.
- OperationCanceledException
Thrown if the operation is canceled.