Table of Contents

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

prompt string

The prompt to submit to the model for text generation.

cancellationToken CancellationToken

A 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

message ChatHistory.Message

The message to submit, which may include text, attachments, or other content.

cancellationToken CancellationToken

A 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.