Method ContinueLastAssistantResponse
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
ContinueLastAssistantResponse(CancellationToken)
Continues generating additional content for the last assistant's response.
public TextGenerationResult ContinueLastAssistantResponse(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenOptional. A CancellationToken to observe while waiting for the task to complete.
Returns
- TextGenerationResult
A TextGenerationResult containing 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
.