Table of Contents

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 string

The user's request in natural language.

cancellationToken CancellationToken

Optional. 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 Prompt

A Prompt representing the user's request.

cancellationToken CancellationToken

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