Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

LanguageModel.GenerateResponseAsync Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
GenerateResponseAsync(LanguageModelContext, String, LanguageModelOptions)

Generates a response to a string prompt while returning progress for each token generated by the language model.

GenerateResponseAsync(String)

Generates a response to a string prompt while returning progress for each token generated by the language model.

GenerateResponseAsync(String, LanguageModelOptions)

Generates a response to a string prompt while returning progress for each token generated by the language model.

GenerateResponseAsync(LanguageModelContext, String, LanguageModelOptions)

Generates a response to a string prompt while returning progress for each token generated by the language model.

public:
 virtual IAsyncOperationWithProgress<LanguageModelResponseResult ^, Platform::String ^> ^ GenerateResponseAsync(LanguageModelContext ^ context, Platform::String ^ prompt, LanguageModelOptions ^ options) = GenerateResponseAsync;
/// [Windows.Foundation.Metadata.Overload("GenerateResponseAsync3")]
IAsyncOperationWithProgress<LanguageModelResponseResult, winrt::hstring const&> GenerateResponseAsync(LanguageModelContext const& context, winrt::hstring const& prompt, LanguageModelOptions const& options);
[Windows.Foundation.Metadata.Overload("GenerateResponseAsync3")]
public IAsyncOperationWithProgress<LanguageModelResponseResult,string> GenerateResponseAsync(LanguageModelContext context, string prompt, LanguageModelOptions options);
function generateResponseAsync(context, prompt, options)
Public Function GenerateResponseAsync (context As LanguageModelContext, prompt As String, options As LanguageModelOptions) As IAsyncOperationWithProgress(Of LanguageModelResponseResult, String)

Parameters

context
LanguageModelContext

The context window that defines the tokens a language model can process at one time for understanding an input prompt and then generating a response. The context window acts like the model's short-term memory, holding the input prompt and the preceding conversation to maintain coherence.

prompt
String

Platform::String

winrt::hstring

The string prompt requiring a response.

options
LanguageModelOptions

Options that affect how the language model responds to the prompt.

Returns

The response to the prompt.

Attributes

Applies to

GenerateResponseAsync(String)

Generates a response to a string prompt while returning progress for each token generated by the language model.

public:
 virtual IAsyncOperationWithProgress<LanguageModelResponseResult ^, Platform::String ^> ^ GenerateResponseAsync(Platform::String ^ prompt) = GenerateResponseAsync;
/// [Windows.Foundation.Metadata.Overload("GenerateResponseAsync")]
IAsyncOperationWithProgress<LanguageModelResponseResult, winrt::hstring const&> GenerateResponseAsync(winrt::hstring const& prompt);
[Windows.Foundation.Metadata.Overload("GenerateResponseAsync")]
public IAsyncOperationWithProgress<LanguageModelResponseResult,string> GenerateResponseAsync(string prompt);
function generateResponseAsync(prompt)
Public Function GenerateResponseAsync (prompt As String) As IAsyncOperationWithProgress(Of LanguageModelResponseResult, String)

Parameters

prompt
String

Platform::String

winrt::hstring

The string prompt requiring a response.

Returns

The response to the prompt.

Attributes

Applies to

GenerateResponseAsync(String, LanguageModelOptions)

Generates a response to a string prompt while returning progress for each token generated by the language model.

public:
 virtual IAsyncOperationWithProgress<LanguageModelResponseResult ^, Platform::String ^> ^ GenerateResponseAsync(Platform::String ^ prompt, LanguageModelOptions ^ options) = GenerateResponseAsync;
/// [Windows.Foundation.Metadata.Overload("GenerateResponseAsync2")]
IAsyncOperationWithProgress<LanguageModelResponseResult, winrt::hstring const&> GenerateResponseAsync(winrt::hstring const& prompt, LanguageModelOptions const& options);
[Windows.Foundation.Metadata.Overload("GenerateResponseAsync2")]
public IAsyncOperationWithProgress<LanguageModelResponseResult,string> GenerateResponseAsync(string prompt, LanguageModelOptions options);
function generateResponseAsync(prompt, options)
Public Function GenerateResponseAsync (prompt As String, options As LanguageModelOptions) As IAsyncOperationWithProgress(Of LanguageModelResponseResult, String)

Parameters

prompt
String

Platform::String

winrt::hstring

The string prompt requiring a response.

options
LanguageModelOptions

Options that affect how the language model responds to the prompt.

Returns

The response to the prompt.

Attributes

Applies to


Feedback

Was this page helpful?