Method ContinueLastAssistantResponseAsync
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
ContinueLastAssistantResponseAsync(CancellationToken)
Asynchronously continues generating additional content for the last assistant's response.
public Task<TextGenerationResult> ContinueLastAssistantResponseAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenOptional. A CancellationToken to observe while waiting for the task to complete.
Returns
- Task<TextGenerationResult>
A task representing the asynchronous operation. The task result contains a TextGenerationResult with the continuation of the last assistant's response.
Remarks
Use this method when you want the assistant to extend its last response without any new user input. Note that this method cannot be used when a grammar is attached to the conversation.
Exceptions
- InvalidOperationException
Thrown when there is no assistant message at the end of the chat history to continue, or when a grammar is attached to the conversation.
- OperationCanceledException
Thrown when the operation is canceled via the
cancellationToken
.