Method SubmitAsync
- Namespace
- LMKit.TextGeneration
- Assembly
- LM-Kit.NET.dll
SubmitAsync(string, CancellationToken)
Asynchronously submits a prompt to the text generation model and returns the result.
Task<TextGenerationResult> SubmitAsync(string prompt, CancellationToken cancellationToken = default)
Parameters
promptstringThe prompt to submit to the model for text generation.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<TextGenerationResult>
A task representing the asynchronous operation, with a TextGenerationResult containing the generated text.
SubmitAsync(Message, CancellationToken)
Asynchronously submits a message to the text generation model and returns the result.
Task<TextGenerationResult> SubmitAsync(ChatHistory.Message message, CancellationToken cancellationToken = default)
Parameters
messageChatHistory.MessageThe message to submit, which may include text, attachments, or other content.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<TextGenerationResult>
A task representing the asynchronous operation, with a TextGenerationResult containing the generated text.
Remarks
Use this overload when the input requires structured content beyond plain text, such as attachments, images, or additional message metadata. For simple text prompts, the SubmitAsync(string, CancellationToken) overload is more convenient.