Method SubmitAsync
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
SubmitAsync(string, CancellationToken)
Submits a user prompt (string) to the model for text generation, asynchronously.
public Task<TextGenerationResult> SubmitAsync(string prompt, CancellationToken cancellationToken = default)
Parameters
prompt
stringThe user's request in natural language.
cancellationToken
CancellationTokenOptional. Monitors for cancellation requests.
Returns
- Task<TextGenerationResult>
A task representing the asynchronous operation. The result is a TextGenerationResult with the generated text.
Exceptions
- ArgumentNullException
Thrown if
prompt
is null or empty.- OperationCanceledException
Thrown if the operation is canceled.
SubmitAsync(Prompt, CancellationToken)
Submits a Prompt object (containing text and/or attachments) to the model, asynchronously.
public Task<TextGenerationResult> SubmitAsync(Prompt prompt, CancellationToken cancellationToken = default)
Parameters
prompt
PromptA Prompt representing the user's request.
cancellationToken
CancellationTokenOptional. Monitors for cancellation requests.
Returns
- Task<TextGenerationResult>
A task representing the asynchronous operation. The result is a TextGenerationResult with the generated text.
Exceptions
- ArgumentNullException
Thrown if
prompt
is null.- OperationCanceledException
Thrown if the operation is canceled.