Method Submit
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
Submit(string, CancellationToken)
Submits a request to the model for text generation.
public TextGenerationResult Submit(string prompt, CancellationToken cancellationToken = default)
Parameters
prompt
stringThe user's request in natural language.
cancellationToken
CancellationTokenOptional. A CancellationToken to handle cancellation requests.
Returns
- TextGenerationResult
A TextGenerationResult object containing the generated text result.
Exceptions
- OperationCanceledException
Thrown when the operation is cancelled based on the CancellationToken.
Submit(Message, CancellationToken)
Submits a request to the model for text generation.
public TextGenerationResult Submit(ChatHistory.Message message, CancellationToken cancellationToken = default)
Parameters
message
ChatHistory.MessageA ChatHistory.Message object representing the content to be sent to the language model.
cancellationToken
CancellationTokenOptional. A CancellationToken to handle cancellation requests.
Returns
- TextGenerationResult
A TextGenerationResult object containing the generated text result.
Exceptions
- OperationCanceledException
Thrown when the operation is cancelled based on the CancellationToken.
- ArgumentNullException
Thrown when the
message
parameter is null.- InvalidOperationException
Thrown when the model fails to process the request.