Method ContinueLastAssistantResponseAsync
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
ContinueLastAssistantResponseAsync(CancellationToken)
Asynchronously continues generating additional tokens for the last assistant's response.
public Task<TextGenerationResult> ContinueLastAssistantResponseAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenOptional. Monitors for cancellation requests.
Returns
- Task<TextGenerationResult>
A task whose result is a TextGenerationResult containing the continued text.
Remarks
Use this method when you want the assistant to extend its last response without any new user input. Note that grammar-based generation does not support continuing the last response.
Exceptions
- InvalidOperationException
Thrown if there is no assistant message in the chat history to continue, or if Grammar is set.
- OperationCanceledException
Thrown if the operation is canceled.