Method SubmitAsync
SubmitAsync(string, CancellationToken)
Asynchronously submits a question and returns a response based on the loaded documents.
public Task<DocumentQueryResult> SubmitAsync(string question, CancellationToken cancellationToken = default)
Parameters
questionstringThe question to ask.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DocumentQueryResult>
A task containing a DocumentQueryResult with the generated response and references to source passages used.
Exceptions
- InvalidOperationException
Thrown if no documents have been loaded.
- ArgumentNullException
Thrown if
questionisnullor empty.- ObjectDisposedException
Thrown if this instance has been disposed.